Density, distribution function, quantile function and random generation for the EMG distribution with three parameters, mu, sigma, lambda. The distribution is a mixture of an exponential and gaussian (normal) distribution.
demg(x, mu = 0, sigma = 1, lambda = 1, log = FALSE)
pemg(q, mu = 0, sigma = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)
qemg(p, mu = 0, sigma = 1, lambda = 1, lower.tail = TRUE, log.p = FALSE)
remg(n, mu = 0, sigma = 1, lambda = 1)
vector of quantiles.
vector of probabilities.
number of observations. If length(n) > 1
, the length
is taken to be the number required.
mu value, the mean of the normal component. Note: this is not the mean of the distribution. The mean is mu+1/lambda
sigma value, the deviation of the normal component. Note: this is not the deviation of the distribution
lambda value (1/kappa), the rate of the exponential component.
logical; if TRUE, probabilities p are given as log(p).
logical; if TRUE(default), probabilities are P[X <= x] otherwise, P[X > x].
demg
gives the density,
pemg
gives the distribution function,
qemg
gives the quantile function, and
remg
generates random deviates.
If mean
or sd
are not specified they assume the default
values of 0
and 1
, respectively.
The EMG distribution has density $$ f(x) = \frac{1}{2} \lambda e^{\frac{\lambda}{2} (2 \mu + \lambda \sigma^2 - 2 x)} erfc((\mu + \lambda \sigma \sigma - x) / (\sqrt{2} \sigma)) $$ where \(\mu\) is the mean of the normal distribution, \(\sigma\) the standard deviation of the normal and \(\lambda\) rate of the exponential. Note \(\mu\) does not represent the mean of the distribution. The mean is \(\mu + 1/\lambda\)
Golubev. Exponentially modified Gaussian (EMG) relevance to distributions related to cell proliferation and differentiation. J Theor Biol. 2010 Jan 21;262(2):257-66. Epub 2009 Oct 13.
# NOT RUN {
plot(demg, -2, 5)
# }
Run the code above in your browser using DataLab