Density, distribution function, quantile function and random generation for the log normal distribution whose logarithm has mean equal to
meanlog and standard deviation equal to
dlnorm(x, meanlog = 0, sdlog = 1, log = FALSE) plnorm(q, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) qlnorm(p, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) rlnorm(n, meanlog = 0, sdlog = 1)
- x, q
- vector of quantiles.
- vector of probabilities.
- number of observations. If
length(n) > 1, the length is taken to be the number required.
- meanlog, sdlog
- mean and standard deviation of the distribution on the log scale with default values of
- log, log.p
- logical; if TRUE, probabilities p are given as log(p).
- logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].
The log normal distribution has density f(x) = 1/(√(2 π) σ x) e^-((log x - μ)^2 / (2 σ^2)) where μ and σ are the mean and standard deviation of the logarithm. The mean is E(X) = exp(μ + 1/2 σ^2), the median is med(X) = exp(μ), and the variance Var(X) = exp(2*μ + σ^2)*(exp(σ^2) - 1) and hence the coefficient of variation is sqrt(exp(σ^2) - 1) which is approximately σ when that is small (e.g., σ < 1/2).
dlnorm gives the density,
plnorm gives the distribution function,
qlnorm gives the quantile function, and
rlnorm generates random deviates. The length of the result is determined by
rlnorm, and is the maximum of the lengths of the numerical parameters for the other functions. The numerical parameters other than
n are recycled to the length of the result. Only the first elements of the logical parameters are used.
Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.
Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 1, chapter 14. Wiley, New York.
Distributions for other standard distributions, including
dnorm for the normal distribution.
Documentation reproduced from R 2.15.3. License: GPL-2.