Laplace Regression Family Function
laplace.RdMaximum likelihood estimation of the 2-parameter classical Laplace distribution.
Usage
laplace(llocation = "identitylink", lscale = "loglink",
ilocation = NULL, iscale = NULL, imethod = 1, zero = "scale")Arguments
- llocation, lscale
Character. Parameter link functions for location parameter \(a\) and scale parameter \(b\). See
Linksfor more choices.- ilocation, iscale
Optional initial values. If given, it must be numeric and values are recycled to the appropriate length. The default is to choose the value internally.
- imethod
Initialization method. Either the value 1 or 2.
- zero
See
CommonVGAMffArgumentsfor information.
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 \(-\infty<y<\infty\), \(-\infty<a<\infty\) and \(b>0\). Its mean is \(a\) and its variance is \(2b^2\). This parameterization is called the classical Laplace distribution by Kotz et al. (2001), and the density is symmetric about \(a\).
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).
Value
An object of class "vglmff"
(see vglmff-class).
The object is used by modelling functions
such as vglm
and vgam.
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.
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. Hence this
family function might be withdrawn from VGAM in the future.
Note
This family function uses Fisher scoring. Convergence may be slow for non-intercept-only models; half-stepping is frequently required.
See also
rlaplace,
alaplace2
(which differs slightly from this parameterization),
exponential,
median.
Examples
ldata <- data.frame(y = rlaplace(nn <- 100, 2, scale = exp(1)))
fit <- vglm(y ~ 1, laplace, ldata, trace = TRUE)
#> Iteration 1: loglikelihood = -263.08587
#> Iteration 2: loglikelihood = -263.08587
#> Iteration 3: loglikelihood = -263.08587
coef(fit, matrix = TRUE)
#> location loglink(scale)
#> (Intercept) 1.482043 0.9377115
Coef(fit)
#> location scale
#> 1.482043 2.554130
with(ldata, median(y))
#> [1] 1.482043
ldata <- data.frame(x = runif(nn <- 1001))
ldata <- transform(ldata, y = rlaplace(nn, 2, scale = exp(-1 + 1*x)))
coef(vglm(y ~ x, laplace(iloc = 0.2, imethod = 2, zero = 1), ldata,
trace = TRUE), matrix = TRUE)
#> Iteration 1: loglikelihood = -2425.44872
#> Iteration 2: loglikelihood = -2509.45689
#> Taking a modified step.
#> Iteration 2 : loglikelihood = -2036.69137
#> Iteration 3: loglikelihood = -1991.03747
#> Iteration 4: loglikelihood = -1452.19732
#> Iteration 5: loglikelihood = -1226.14944
#> Iteration 6: loglikelihood = -1180.47346
#> Iteration 7: loglikelihood = -1178.5229
#> Iteration 8: loglikelihood = -1178.51723
#> Iteration 9: loglikelihood = -1178.51699
#> Iteration 10: loglikelihood = -1178.51775
#> Taking a modified step...
#> Iteration 10 : loglikelihood = -1178.51694
#> Iteration 11: loglikelihood = -1178.51765
#> Taking a modified step...
#> Iteration 11 : loglikelihood = -1178.51689
#> Iteration 12: loglikelihood = -1178.51776
#> Taking a modified step.....
#> Iteration 12 : loglikelihood = -1178.51687
#> Iteration 13: loglikelihood = -1178.51779
#> Taking a modified step.......
#> Iteration 13 : loglikelihood = -1178.51687
#> location loglink(scale)
#> (Intercept) 2.001053 -1.112487
#> x 0.000000 1.160548