Lognormal Distribution
lognormal.RdMaximum likelihood estimation of the (univariate) lognormal distribution.
Arguments
- lmeanlog, lsdlog
Parameter link functions applied to the mean and (positive) \(\sigma\) (standard deviation) parameter. Both of these are on the log scale. See
Linksfor more choices.
- zero
Specifies which linear/additive predictor is modelled as intercept-only. For
lognormal(), the values can be from the set {1,2} which correspond tomu,sigma, respectively. SeeCommonVGAMffArgumentsfor more information.
Details
A random variable \(Y\) has a 2-parameter lognormal distribution if \(\log(Y)\) is distributed \(N(\mu, \sigma^2)\). The expected value of \(Y\), which is $$E(Y) = \exp(\mu + 0.5 \sigma^2)$$ and not \(\mu\), make up the fitted values. The variance of \(Y\) is $$Var(Y) = [\exp(\sigma^2) -1] \exp(2\mu + \sigma^2).$$
Value
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm,
and vgam.
References
Kleiber, C. and Kotz, S. (2003). Statistical Size Distributions in Economics and Actuarial Sciences, Hoboken, NJ, USA: Wiley-Interscience.
Examples
ldata2 <- data.frame(x2 = runif(nn <- 1000))
ldata2 <- transform(ldata2, y1 = rlnorm(nn, 1 + 2 * x2, sd = exp(-1)),
y2 = rlnorm(nn, 1, sd = exp(-1 + x2)))
fit1 <- vglm(y1 ~ x2, lognormal(zero = 2), data = ldata2, trace = TRUE)
#> Iteration 1: loglikelihood = -3197.2027
#> Iteration 2: loglikelihood = -2796.8539
#> Iteration 3: loglikelihood = -2518.7865
#> Iteration 4: loglikelihood = -2405.8189
#> Iteration 5: loglikelihood = -2390.9619
#> Iteration 6: loglikelihood = -2390.7367
#> Iteration 7: loglikelihood = -2390.7367
#> Iteration 8: loglikelihood = -2390.7367
fit2 <- vglm(y2 ~ x2, lognormal(zero = 1), data = ldata2, trace = TRUE)
#> Iteration 1: loglikelihood = -1936.982
#> Iteration 2: loglikelihood = -1926.3452
#> Iteration 3: loglikelihood = -1926.1601
#> Iteration 4: loglikelihood = -1926.1598
#> Iteration 5: loglikelihood = -1926.1598
coef(fit1, matrix = TRUE)
#> meanlog loglink(sdlog)
#> (Intercept) 1.000216 -1.034123
#> x2 1.989582 0.000000
coef(fit2, matrix = TRUE)
#> meanlog loglink(sdlog)
#> (Intercept) 0.9986204 -1.084249
#> x2 0.0000000 1.163677