% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/lognormal.R
\name{lognormal_gpd}
\alias{lognormal_gpd}
\alias{dLognormalGpd}
\alias{pLognormalGpd}
\alias{rLognormalGpd}
\alias{qLognormalGpd}
\title{Lognormal with a GPD tail}
\usage{
dLognormalGpd(x, meanlog, sdlog, threshold, tail_scale, tail_shape, log = 0)

pLognormalGpd(
  q,
  meanlog,
  sdlog,
  threshold,
  tail_scale,
  tail_shape,
  lower.tail = 1,
  log.p = 0
)

rLognormalGpd(n, meanlog, sdlog, threshold, tail_scale, tail_shape)

qLognormalGpd(
  p,
  meanlog,
  sdlog,
  threshold,
  tail_scale,
  tail_shape,
  lower.tail = TRUE,
  log.p = FALSE
)
}
\arguments{
\item{x}{Numeric scalar giving the point at which the density is evaluated.}

\item{meanlog}{Numeric scalar log-mean parameter for the Lognormal bulk.}

\item{sdlog}{Numeric scalar log-standard deviation for the Lognormal bulk.}

\item{threshold}{Numeric scalar threshold at which the GPD tail is attached.}

\item{tail_scale}{Numeric scalar GPD scale parameter; must be positive.}

\item{tail_shape}{Numeric scalar GPD shape parameter.}

\item{log}{Integer flag \code{0/1}; if \code{1}, return the log-density.}

\item{q}{Numeric scalar giving the point at which the distribution function is evaluated.}

\item{lower.tail}{Integer flag \code{0/1}; if \code{1} (default), probabilities are \eqn{P(X \le q)}.}

\item{log.p}{Integer flag \code{0/1}; if \code{1}, probabilities are returned on the log scale.}

\item{n}{Integer giving the number of draws. The RNG implementation supports \code{n = 1}.}

\item{p}{Numeric scalar probability in \eqn{(0,1)} for the quantile function.}
}
\value{
Spliced density/CDF/RNG functions return numeric scalars. \code{qLognormalGpd()} returns a
numeric vector with the same length as \code{p}.
}
\description{
Spliced family obtained by attaching a generalized Pareto tail above \code{threshold} to a single
lognormal bulk.
}
\details{
This is the single-lognormal counterpart of \code{\link[=lognormal_mixgpd]{lognormal_mixgpd()}}. If \eqn{F_{LN}(u)} denotes the
bulk probability below the threshold, then the spliced density is
\deqn{
f(x) =
\left\{
\begin{array}{ll}
f_{LN}(x \mid \mu,\sigma), & x < u, \\
\{1-F_{LN}(u)\} g_{GPD}(x \mid u,\sigma_u,\xi), & x \ge u.
\end{array}
\right.
}
The ordinary mean is finite only when the GPD tail has \eqn{\xi < 1};
otherwise the package requires restricted means or quantiles.
}
\section{Functions}{
\itemize{
\item \code{dLognormalGpd()}: Lognormal + GPD tail density

\item \code{pLognormalGpd()}: Lognormal + GPD tail distribution function

\item \code{rLognormalGpd()}: Lognormal + GPD tail random generation

\item \code{qLognormalGpd()}: Lognormal + GPD tail quantile function

}}
\examples{
meanlog <- 0.4
sdlog <- 0.35
threshold <- 3
tail_scale <- 0.9
tail_shape <- 0.2

dLognormalGpd(4.0, meanlog, sdlog, threshold, tail_scale, tail_shape, log = FALSE)
pLognormalGpd(4.0, meanlog, sdlog, threshold, tail_scale, tail_shape,
             lower.tail = TRUE, log.p = FALSE)
qLognormalGpd(0.50, meanlog, sdlog, threshold, tail_scale, tail_shape)
qLognormalGpd(0.95, meanlog, sdlog, threshold, tail_scale, tail_shape)
replicate(10, rLognormalGpd(1, meanlog, sdlog, threshold, tail_scale, tail_shape))
}
\seealso{
\code{\link[=lognormal_mix]{lognormal_mix()}}, \code{\link[=lognormal_mixgpd]{lognormal_mixgpd()}}, \code{\link[=gpd]{gpd()}}, \code{\link[=lognormal_lowercase]{lognormal_lowercase()}}.

Other lognormal kernel families: 
\code{\link{lognormal_mix}},
\code{\link{lognormal_mixgpd}}
}
\concept{lognormal kernel families}
