View source: R/family.normal.R
| lognormal | R Documentation |
Maximum likelihood estimation of the (univariate) lognormal distribution.
lognormal(lmeanlog = "identitylink", lsdlog = "loglink", zero = "sdlog")
lmeanlog, lsdlog |
Parameter link functions applied to the mean and (positive)
|
zero |
Specifies which
linear/additive predictor is modelled as intercept-only.
For |
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).
An object of class "vglmff" (see vglmff-class).
The object is used by modelling functions such as vglm,
and vgam.
T. W. Yee
Kleiber, C. and Kotz, S. (2003). Statistical Size Distributions in Economics and Actuarial Sciences, Hoboken, NJ, USA: Wiley-Interscience.
Lognormal,
uninormal,
CommonVGAMffArguments,
simulate.vlm.
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)
fit2 <- vglm(y2 ~ x2, lognormal(zero = 1), data = ldata2, trace = TRUE)
coef(fit1, matrix = TRUE)
coef(fit2, matrix = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.