% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/laplace.R
\name{laplace_MixGpd}
\alias{laplace_MixGpd}
\alias{dLaplaceMixGpd}
\alias{pLaplaceMixGpd}
\alias{rLaplaceMixGpd}
\alias{qLaplaceMixGpd}
\title{Laplace mixture with a GPD tail}
\usage{
dLaplaceMixGpd(
  x,
  w,
  location,
  scale,
  threshold,
  tail_scale,
  tail_shape,
  log = 0
)

pLaplaceMixGpd(
  q,
  w,
  location,
  scale,
  threshold,
  tail_scale,
  tail_shape,
  lower.tail = 1,
  log.p = 0
)

rLaplaceMixGpd(n, w, location, scale, threshold, tail_scale, tail_shape)

qLaplaceMixGpd(
  p,
  w,
  location,
  scale,
  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{w}{Numeric vector of mixture weights of length \eqn{K}.}

\item{location}{Numeric vector of length \eqn{K} giving component locations.}

\item{scale}{Numeric vector of length \eqn{K} giving component scales.}

\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}{Logical; if \code{TRUE}, return the log-density.}

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

\item{lower.tail}{Logical; if \code{TRUE} (default), probabilities are \eqn{P(X \le q)}.}

\item{log.p}{Logical; if \code{TRUE}, 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.}

\item{tol}{Numeric scalar tolerance passed to \code{stats::uniroot}.}

\item{maxiter}{Integer maximum iterations for \code{stats::uniroot}.}
}
\value{
Spliced density/CDF/RNG functions return numeric scalars. \code{qLaplaceMixGpd()} returns a
numeric vector with the same length as \code{p}.
}
\description{
Spliced bulk-tail family formed by attaching a generalized Pareto tail to a Laplace mixture
bulk.
}
\details{
This family keeps the Laplace mixture body below the threshold and replaces the upper tail with a
generalized Pareto exceedance model scaled by the residual survival mass at the threshold. The
tail density is therefore
\deqn{
f(x) = \{1-F_{mix}(u)\} g_{GPD}(x \mid u,\sigma_u,\xi), \qquad x \ge u.
}
Bulk quantiles are found numerically from the mixture CDF, and tail quantiles are computed by
rescaling the upper-tail probability and applying the GPD inverse.
}
\section{Functions}{
\itemize{
\item \code{dLaplaceMixGpd()}: Laplace mixture + GPD tail density

\item \code{pLaplaceMixGpd()}: Laplace mixture + GPD tail distribution function

\item \code{rLaplaceMixGpd()}: Laplace mixture + GPD tail random generation

\item \code{qLaplaceMixGpd()}: Laplace mixture + GPD tail quantile function

}}
\examples{
w <- c(0.50, 0.30, 0.20)
location <- c(-1, 0.5, 2.0)
scale <- c(1.0, 0.7, 1.4)
threshold <- 1
tail_scale <- 1.0
tail_shape <- 0.2

dLaplaceMixGpd(2.0, w = w, location = location, scale = scale,
              threshold = threshold, tail_scale = tail_scale,
              tail_shape = tail_shape, log = FALSE)
pLaplaceMixGpd(2.0, w = w, location = location, scale = scale,
              threshold = threshold, tail_scale = tail_scale,
              tail_shape = tail_shape, lower.tail = TRUE, log.p = FALSE)
qLaplaceMixGpd(0.50, w = w, location = location, scale = scale,
              threshold = threshold, tail_scale = tail_scale,
              tail_shape = tail_shape)
qLaplaceMixGpd(0.95, w = w, location = location, scale = scale,
              threshold = threshold, tail_scale = tail_scale,
              tail_shape = tail_shape)
replicate(10, rLaplaceMixGpd(1, w = w, location = location, scale = scale,
                            threshold = threshold,
                            tail_scale = tail_scale,
                            tail_shape = tail_shape))
}
\seealso{
\code{\link[=laplace_mix]{laplace_mix()}}, \code{\link[=laplace_gpd]{laplace_gpd()}}, \code{\link[=gpd]{gpd()}}, \code{\link[=laplace_lowercase]{laplace_lowercase()}}, \code{\link[=dpmgpd]{dpmgpd()}}.

Other laplace kernel families: 
\code{\link{laplace_gpd}},
\code{\link{laplace_mix}}
}
\concept{laplace kernel families}
