Title: | Exponentially Modified Gaussian (EMG) Distribution |
---|---|
Description: | Provides basic distribution functions for a mixture model of a Gaussian and exponential distribution. |
Authors: | Shawn Garbett, Mark Kozdoba |
Maintainer: | Shawn Garbett <[email protected]> |
License: | GPL-2 | file LICENSE |
Version: | 1.0.9 |
Built: | 2025-03-01 05:21:09 UTC |
Source: | https://github.com/spgarbet/emg |
Provide basic functions for a mixture of gaussian and exponential distributions.
Package: | emg |
Type: | Package |
Date: | 2012-01-03 |
License: | GPL 2.0 |
LazyLoad: | yes |
Provides basic distribution functions for the EMG model, pemg, demg, qemg and remg. As well as an MLE estimation routine emg.mle.
Shawn Garbett, Mark Kozdoba, Maintainer: Shawn Garbett <[email protected]>
Gladney H.M., B.F. Dowden, J.D. Swalen. Computer-Assisted Gas-Liquid Chromatography. Anal. Chem., 1969, 41(7):883-8.
Golubev A. Exponentially modified Gaussian (EMG) relevance to distributions related to cell proliferation and differentiation. J Theor Biol. 2010 Jan 21;262(2):257-66.
Grushka E. Charaterization of Exponentially Modified Peaks in Chromatography. Anal. Chem., 1972, 44(11):1733-38.
EMG
emg.mle
Normal
Exponential
y <- remg(200) hist(y, freq=FALSE, ylim=c(0, 0.35), breaks=20) x <- 1:100/100 * 11 - 3 lines(x, demg(x)) m <- emg.mle(y) sqrt(diag(m@vcov)) # Show stderr in estimate ks.test(y, "pemg", 0, 1, 1)
y <- remg(200) hist(y, freq=FALSE, ylim=c(0, 0.35), breaks=20) x <- 1:100/100 * 11 - 3 lines(x, demg(x)) m <- emg.mle(y) sqrt(diag(m@vcov)) # Show stderr in estimate ks.test(y, "pemg", 0, 1, 1)
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)
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)
x , q
|
vector of quantiles. |
p |
vector of probabilities. |
n |
number of observations. If |
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]. |
If mean
or sd
are not specified they assume the default
values of 0
and 1
, respectively.
The EMG distribution has density
where is the mean of the normal distribution,
the standard deviation of the normal and
rate of the exponential. Note
does not represent the mean of the distribution. The mean is
demg
gives the density,
pemg
gives the distribution function,
qemg
gives the quantile function, and
remg
generates random deviates.
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.
plot(demg, -2, 5)
plot(demg, -2, 5)
Compute the maximum likelihood model for the parameters given a set of observations. Returns a model with estimates for mu, sigma, and lambda.
emg.mle(x, lower=NULL, upper=NULL, start=NULL, ...)
emg.mle(x, lower=NULL, upper=NULL, start=NULL, ...)
x |
vector of observations to estimate parameters for. |
lower |
list of lower bounds for parameters. |
upper |
list of upper bounds for parameters. |
start |
list of starting parameters for search. |
... |
optional parameters to pass to 'mle'. |
An object of class mle-class
.
Shawn Garbett
emg.mle(remg(200)) ## a example involving fitting data(pc9_3um_erlotinib) intermitotic.time <- subset(pc9_3um_erlotinib, end.of.movie=='N' & died=='N')$observed hist(intermitotic.time, freq=FALSE, main="PC9 in 3um erlotinib", xlab='intermitotic time (hours)') fit <- emg.mle(intermitotic.time) pdf <- function(x) demg(x, coef(fit)['mu'], coef(fit)['sigma'], coef(fit)['lambda']) curve(pdf, from=0, to=170, add=TRUE, col='red')
emg.mle(remg(200)) ## a example involving fitting data(pc9_3um_erlotinib) intermitotic.time <- subset(pc9_3um_erlotinib, end.of.movie=='N' & died=='N')$observed hist(intermitotic.time, freq=FALSE, main="PC9 in 3um erlotinib", xlab='intermitotic time (hours)') fit <- emg.mle(intermitotic.time) pdf <- function(x) demg(x, coef(fit)['mu'], coef(fit)['sigma'], coef(fit)['lambda']) curve(pdf, from=0, to=170, add=TRUE, col='red')
Negative log likelihood function for EMG
emg.nllik(x, mu, sigma, lambda)
emg.nllik(x, mu, sigma, lambda)
x |
vector of observations |
mu |
mu of normal |
sigma |
sigma of normal |
lambda |
lambda of exponential |
A single real value of the negative log likelihood that the given parameters explain the observations.
Shawn Garbett
y <- remg(200) emg.nllik(y, 0, 1, 1)
y <- remg(200) emg.nllik(y, 0, 1, 1)
PC9 cancer cell observations with 3um erlotinib applied at time 0. Experiment was performed on 2011/9/9 (F07) in the Vito Quaranta laboratory at Vanderbilt University Cancer Biology Center by Darren Tyson. Cells were tracked by nuclear labeling with histone H2B and imaged on a BD Pathway 855 for several days. All numerical values are in hours. Funding was provided by the National Cancer Institute (NCI).
This data set was specifically chosen to give the emg.mle function something difficult to work on.
data(pc9_3um_erlotinib)
data(pc9_3um_erlotinib)
A data frame of lifespan PC9 observations.
Darren Tyson, Shawn Garbett
data(pc9_3um_erlotinib)
data(pc9_3um_erlotinib)