% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/invgauss.R
\name{InvGauss_gpd}
\alias{InvGauss_gpd}
\alias{dInvGaussGpd}
\alias{pInvGaussGpd}
\alias{rInvGaussGpd}
\alias{qInvGaussGpd}
\title{Inverse Gaussian with a GPD tail}
\usage{
dInvGaussGpd(x, mean, shape, threshold, tail_scale, tail_shape, log = 0)

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

rInvGaussGpd(n, mean, shape, threshold, tail_scale, tail_shape)

qInvGaussGpd(
  p,
  mean,
  shape,
  threshold,
  tail_scale,
  tail_shape,
  lower.tail = TRUE,
  log.p = FALSE,
  tol = 1e-10,
  maxiter = 200
)
}
\arguments{
\item{x}{Numeric scalar giving the point at which the density is evaluated.}

\item{mean}{Numeric scalar mean parameter \eqn{\mu>0}.}

\item{shape}{Numeric scalar shape parameter \eqn{\lambda>0}.}

\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. For portability inside NIMBLE,
the RNG implementation supports \code{n = 1}.}

\item{p}{Numeric scalar probability in \eqn{(0,1)} for the quantile function.}

\item{tol}{Numeric tolerance for numerical inversion in \code{qInvGaussGpd}.}

\item{maxiter}{Maximum iterations for numerical inversion in \code{qInvGaussGpd}.}
}
\value{
Spliced density/CDF/RNG functions return numeric scalars.
\code{qInvGaussGpd()} 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
inverse Gaussian bulk.
}
\details{
This is the one-component version of \code{\link[=InvGauss_mixgpd]{InvGauss_mixgpd()}}. The inverse Gaussian governs the bulk
region and the generalized Pareto governs exceedances over the threshold. The splice is
continuous at \eqn{u} because the GPD is scaled by the inverse-Gaussian survival probability at
the threshold.

The ordinary mean of the spliced law exists only when the GPD tail has \eqn{\xi < 1}. When that
condition fails, the package uses restricted means or quantile-based summaries instead of an
ordinary mean.
}
\section{Functions}{
\itemize{
\item \code{dInvGaussGpd()}: Inverse Gaussian + GPD tail density

\item \code{pInvGaussGpd()}: Inverse Gaussian + GPD tail distribution function

\item \code{rInvGaussGpd()}: Inverse Gaussian + GPD tail random generation

\item \code{qInvGaussGpd()}: Inverse Gaussian + GPD tail quantile function

}}
\examples{
mean <- 2.5
shape <- 6
threshold <- 3
tail_scale <- 0.9
tail_shape <- 0.2

dInvGaussGpd(4.0, mean = mean, shape = shape,
            threshold = threshold, tail_scale = tail_scale,
            tail_shape = tail_shape, log = 0)
pInvGaussGpd(4.0, mean = mean, shape = shape,
            threshold = threshold, tail_scale = tail_scale,
            tail_shape = tail_shape, lower.tail = 1, log.p = 0)
qInvGaussGpd(0.50, mean = mean, shape = shape,
            threshold = threshold, tail_scale = tail_scale,
            tail_shape = tail_shape)
qInvGaussGpd(0.95, mean = mean, shape = shape,
            threshold = threshold, tail_scale = tail_scale,
            tail_shape = tail_shape)
replicate(10, rInvGaussGpd(1, mean = mean, shape = shape,
                          threshold = threshold,
                          tail_scale = tail_scale,
                          tail_shape = tail_shape))
}
\seealso{
\code{\link[=InvGauss_mix]{InvGauss_mix()}}, \code{\link[=InvGauss_mixgpd]{InvGauss_mixgpd()}}, \code{\link[=gpd]{gpd()}}, \code{\link[=invgauss_lowercase]{invgauss_lowercase()}}.

Other inverse-gaussian kernel families: 
\code{\link{InvGauss_mix}},
\code{\link{InvGauss_mixgpd}}
}
\concept{inverse-gaussian kernel families}
