Learn R Programming

VGAM (version 0.7-5)

laplace: Laplace Distribution

Description

Maximum likelihood estimation of the 2-parameter Laplace distribution.

Usage

laplace(llocation="identity", lscale="loge",
        elocation=list(), escale=list(),
        ilocation=NULL, iscale=NULL,
        method.init=1, zero=NULL)

Arguments

Value

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

Warning

This family function has not been fully tested. The MLE regularity conditions do not hold for this distribution, therefore misleading inferences may result, e.g., in the summary and vcov of the object.

Details

The Laplace distribution is often known as the double-exponential distribution and, for modelling, has heavier tail than the normal distribution. The Laplace density function is $$f(y) = \frac{1}{2b} \exp \left( - \frac{|y-a|}{b} \right)$$ where $-\infty0$. Its mean is $a$ and its variance is $2b^2$.

For y ~ 1 (where y is the response) the maximum likelihood estimate (MLE) for the location parameter is the sample median, and the MLE for $b$ is mean(abs(y-location)) (replace location by its MLE if unknown).

References

Kotz, S., Kozubowski, T. J. and Podgorski, K. (2001) The Laplace distribution and generalizations: a revisit with applications to communications, economics, engineering, and finance, Boston: Birkhauser.

See Also

rlaplace.

Examples

Run this code
y = rlaplace(n <- 100, loc=2, scale=exp(1))
fit = vglm(y  ~ 1, laplace, trace=TRUE, crit="l")
coef(fit, matrix=TRUE)
Coef(fit)
median(y)

x = runif(n <- 1001)
y = rlaplace(n, loc=2, scale=exp(-1+1*x))
fit = vglm(y  ~ x, laplace(iloc=0.2, meth=2, zero=1), trace=TRUE)
coef(fit, matrix=TRUE)

Run the code above in your browser using DataLab