Exponentially modified Gaussian distribution
exgauss.Rd
Density, distribution function, quantile function, and random generation for the exponentially modified Gaussian distribution.
Usage
dexgauss(x, mu = 0, sigma = 1, lambda = 1, log = FALSE)
pexgauss(q, mu = 0, sigma = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)
qexgauss(p, mu = 0, sigma = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)
rexgauss(n, mu = 0, sigma = 1, lambda = 1)
Arguments
- x, q
vector of quantiles
- mu
mean parameter of the Gaussian part
- sigma
standard deviation parameter of the Gaussian part, must be positive.
- lambda
rate parameter of the exponential part, must be positive.
- log, log.p
logical; if
TRUE
, probabilities/ densities \(p\) are returned as \(\log(p)\).- lower.tail
logical; if
TRUE
, probabilities are \(P[X <= x]\), otherwise, \(P[X > x]\).- p
vector of probabilities
- n
number of random values to return
Value
dexgauss
gives the density, pexgauss
gives the distribution function, qexgauss
gives the quantile function, and rexgauss
generates random deviates.
Details
This implementation of dexgauss
and pexgauss
allows for automatic differentiation with RTMB
.
qexgauss
and rexgauss
are reparameterised imports from gamlss.dist::exGAUS
.
If \(X \sim N(\mu, \sigma^2)\) and \(Y \sim \text{Exp}(\lambda)\), then \(Z = X + Y\) follows the exponentially modified Gaussian distribution with parameters \(\mu\), \(\sigma\), and \(\lambda\).