lognormal {VGAM} | R Documentation |
Maximum likelihood estimation of the (univariate) lognormal distribution.
lognormal(lmeanlog = "identity", lsdlog = "loge", emeanlog = list(), esdlog = list(), zero = 2) lognormal3(lmeanlog = "identity", lsdlog = "loge", emeanlog = list(), esdlog = list(), powers.try = (-3):3, delta = NULL, zero = 2)
lmeanlog, lsdlog |
Parameter link functions applied to the mean and (positive)
sigma (standard deviation) parameter.
Both of these are on the log scale.
See |
emeanlog, esdlog |
List. Extra argument for each of the links.
See |
zero |
An integer-valued vector specifying which
linear/additive predictors are modelled as intercepts only.
For |
powers.try |
Numerical vector. The initial lambda is chosen
as the best value from |
delta |
Numerical vector. An alternative method for
obtaining an initial lambda. Here, |
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.
A random variable Y has a 3-parameter lognormal distribution if log(Y-lambda) is distributed N(mu, sigma^2). Here, lambda < Y. The expected value of Y, which is
E(Y) = lambda + exp(mu + 0.5 sigma^2)
and not mu, make up the fitted values.
lognormal()
and lognormal3()
fit the 2- and 3-parameter
lognormal distribution respectively. Clearly, if the location
parameter lambda=0 then both distributions coincide.
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: Wiley-Interscience.
rlnorm
,
normal1
,
CommonVGAMffArguments
.
ldat <- data.frame(y = rlnorm(nn <- 1000, meanlog = 1.5, sdlog = exp(-0.8))) fit <- vglm(y ~ 1, lognormal, ldat, trace = TRUE) coef(fit, mat = TRUE) Coef(fit) ldat2 <- data.frame(x2 = runif(nn <- 1000)) ldat2 <- transform(ldat2, y = rlnorm(nn, mean = 0.5, sd = exp(x2))) fit <- vglm(y ~ x2, lognormal(zero = 1), ldat2, trace = TRUE, crit = "c") coef(fit, mat = TRUE) Coef(fit) lambda <- 4 ldat3 <- data.frame(y = lambda + rlnorm(n = 1000, mean = 1.5, sd = exp(-0.8))) fit <- vglm(y ~ 1, lognormal3, ldat3, trace = TRUE, crit = "c") coef(fit, mat = TRUE) summary(fit)