Learn R Programming

VGAM (version 0.8-1)

exponential: Exponential Distribution

Description

Maximum likelihood estimation for the exponential distribution.

Usage

exponential(link = "loge", earg = list(), location = 0, expected = TRUE)

Arguments

link
Parameter link function applied to the positive parameter $rate$. See Links for more choices.
earg
List. Extra argument for the link. See earg in Links for general information.
location
Numeric of length 1, the known location parameter, $A$, say.
expected
Logical. If TRUE Fisher scoring is used, otherwise Newton-Raphson. The latter is usually faster.

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Details

The family function assumes the response $Y$ has density $$f(y) = \lambda \exp(-\lambda (y-A))$$ for $y > A$, where $A$ is the known location parameter. By default, $A=0$. Then $E(Y) = A + 1/ \lambda$ and $Var(Y) = 1/ \lambda^2$.

References

Evans, M., Hastings, N. and Peacock, B. (2000) Statistical Distributions, New York: Wiley-Interscience, Third edition.

See Also

amlexponential, laplace, poissonff, mix2exp, freund61.

Examples

Run this code
edata = data.frame(x2 = runif(nn <- 100) - 0.5)
edata = transform(edata, x3 = runif(nn) - 0.5)
edata = transform(edata, eta = 0.2 - 0.7 * x2 + 1.9 * x3)
edata = transform(edata, rate = exp(eta))
edata = transform(edata, y = rexp(nn, rate=rate))
with(edata, stem(y))
fit.slow = vglm(y ~ x2 + x3, exponential, edata, trace=TRUE, crit="c")
fit.fast = vglm(y ~ x2 + x3, exponential(exp=FALSE), edata, trace=TRUE, crit="c")
coef(fit.slow, mat=TRUE)
summary(fit.slow)

Run the code above in your browser using DataLab