% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/normal.R
\name{normal_gpd}
\alias{normal_gpd}
\alias{dNormGpd}
\alias{pNormGpd}
\alias{rNormGpd}
\alias{qNormGpd}
\title{Normal with a GPD tail}
\usage{
dNormGpd(x, mean, sd, threshold, tail_scale, tail_shape, log = 0)

pNormGpd(
  q,
  mean,
  sd,
  threshold,
  tail_scale,
  tail_shape,
  lower.tail = 1,
  log.p = 0
)

rNormGpd(n, mean, sd, threshold, tail_scale, tail_shape)

qNormGpd(
  p,
  mean,
  sd,
  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{mean}{Numeric scalar mean parameter for the Normal bulk.}

\item{sd}{Numeric scalar standard deviation for the Normal 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{qNormGpd()} 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
normal bulk component.
}
\details{
This is the single-component version of \code{\link[=normal_mixgpd]{normal_mixgpd()}}. If \eqn{\Phi_u =
\Phi((u-\mu)/\sigma)} denotes the normal bulk probability below the threshold, then the density
is
\deqn{
f(x) =
\left\{
\begin{array}{ll}
\phi(x \mid \mu, \sigma^2), & x < u, \\
(1-\Phi_u) g_{GPD}(x \mid u,\sigma_u,\xi), & x \ge u.
\end{array}
\right.
}
The distribution is continuous at \eqn{u} by construction, although the derivative generally
changes there because the tail is modeled by a different family.

The ordinary mean exists only when the GPD tail satisfies \eqn{\xi < 1}. When that condition
fails, downstream mean prediction is intentionally blocked and the package directs the user to
restricted means or quantile-based summaries instead.
}
\section{Functions}{
\itemize{
\item \code{dNormGpd()}: Normal + GPD tail density

\item \code{pNormGpd()}: Normal + GPD tail distribution function

\item \code{rNormGpd()}: Normal + GPD tail random generation

\item \code{qNormGpd()}: Normal + GPD tail quantile function

}}
\examples{
mean <- 0.5
sd <- 1.0
threshold <- 2
tail_scale <- 1.0
tail_shape <- 0.2

dNormGpd(3.0, mean, sd, threshold, tail_scale, tail_shape, log = FALSE)
pNormGpd(3.0, mean, sd, threshold, tail_scale, tail_shape,
        lower.tail = TRUE, log.p = FALSE)
qNormGpd(0.50, mean, sd, threshold, tail_scale, tail_shape)
qNormGpd(0.95, mean, sd, threshold, tail_scale, tail_shape)
replicate(10, rNormGpd(1, mean, sd, threshold, tail_scale, tail_shape))
}
\seealso{
\code{\link[=normal_mix]{normal_mix()}}, \code{\link[=normal_mixgpd]{normal_mixgpd()}}, \code{\link[=gpd]{gpd()}}, \code{\link[=normal_lowercase]{normal_lowercase()}}.

Other normal kernel families: 
\code{\link{normal_mix}},
\code{\link{normal_mixgpd}}
}
\concept{normal kernel families}
