Learn R Programming

emg (version 1.0.9)

EMG: The Exponential Modified Gaussian (EMG) Distribution

Description

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.

Usage

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)

Arguments

x,q

vector of quantiles.

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mu

mu value, the mean of the normal component. Note: this is not the mean of the distribution. The mean is mu+1/lambda

sigma

sigma value, the deviation of the normal component. Note: this is not the deviation of the distribution

lambda

lambda value (1/kappa), the rate of the exponential component.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE(default), probabilities are P[X <= x] otherwise, P[X > x].

Value

demg gives the density, pemg gives the distribution function, qemg gives the quantile function, and remg generates random deviates.

Details

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\)

References

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.

Examples

Run this code
# NOT RUN {
  plot(demg, -2, 5)
# }

Run the code above in your browser using DataLab