Laplace mixture with a GPD tail
laplace_MixGpd.RdSpliced bulk-tail family formed by attaching a generalized Pareto tail to a Laplace mixture bulk.
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
- x
Numeric scalar giving the point at which the density is evaluated.
- w
Numeric vector of mixture weights of length \(K\).
- location
Numeric vector of length \(K\) giving component locations.
- scale
Numeric vector of length \(K\) giving component scales.
- threshold
Numeric scalar threshold at which the GPD tail is attached.
- tail_scale
Numeric scalar GPD scale parameter; must be positive.
- tail_shape
Numeric scalar GPD shape parameter.
- log
Logical; if
TRUE, return the log-density.- q
Numeric scalar giving the point at which the distribution function is evaluated.
- lower.tail
Logical; if
TRUE(default), probabilities are \(P(X \le q)\).- log.p
Logical; if
TRUE, probabilities are returned on the log scale.- n
Integer giving the number of draws. The RNG implementation supports
n = 1.- p
Numeric scalar probability in \((0,1)\) for the quantile function.
- tol
Numeric scalar tolerance passed to
stats::uniroot.- maxiter
Integer maximum iterations for
stats::uniroot.
Value
Spliced density/CDF/RNG functions return numeric scalars. qLaplaceMixGpd() returns a
numeric vector with the same length as p.
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 $$ 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.
Functions
dLaplaceMixGpd(): Laplace mixture + GPD tail densitypLaplaceMixGpd(): Laplace mixture + GPD tail distribution functionrLaplaceMixGpd(): Laplace mixture + GPD tail random generationqLaplaceMixGpd(): Laplace mixture + GPD tail quantile function
See also
laplace_mix(), laplace_gpd(), gpd(), laplace_lowercase(), dpmgpd().
Other laplace kernel families:
laplace_gpd,
laplace_mix
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)
#> [1] 0.0865078
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)
#> [1] 0.8961906
qLaplaceMixGpd(0.50, w = w, location = location, scale = scale,
threshold = threshold, tail_scale = tail_scale,
tail_shape = tail_shape)
#> [1] -0.02546085
qLaplaceMixGpd(0.95, w = w, location = location, scale = scale,
threshold = threshold, tail_scale = tail_scale,
tail_shape = tail_shape)
#> [1] 2.943917
replicate(10, rLaplaceMixGpd(1, w = w, location = location, scale = scale,
threshold = threshold,
tail_scale = tail_scale,
tail_shape = tail_shape))
#> [1] 0.5347682 2.2306633 1.4405908 2.5020907 6.5262022 6.1675301
#> [7] -0.5760894 -0.6940654 0.6934115 -1.1575630