Lognormal
The Lognormal Distribution

Description

Calculates density, cumulative probability, quantile, and generate random sample for the lognormal distribution (continuous).

Usage

dlnorm(x, meanlog = 0, sdlog = 1, log = FALSE) # density
plnorm(q, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) # probability
qlnorm(p, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE) # quantile
rlnorm(n, meanlog = 0, sdlog = 1) # random

Arguments

x, q numeric vectors in the range [0, Inf) that specify the quantiles.
p a numeric vector in the range [0, 1] that specifies the probabilities.
n an integer scalar in the range [0, Inf) that specifies the number of random samples requested. If the input value is not an integer, it is truncated. If length(n) is greater than 1, the random function returns length(n) random samples.
meanlog a numeric vector in the range (-Inf, Inf) that specifies the mean value.
sdlog a numeric vector in the range [0, Inf) that specifies the standard deviation.
log a logical value. If FALSE (default), the density function returns the density itself. If TRUE, it returns the log of the density.
lower.tail a logical value. If TRUE (default), the probability supplied to the quantile function or returned by the probability function is P[X <= x]. If FALSE, it is P[X > x].
log.p a logical value. If FALSE (default), the probability supplied to the quantile function or returned by the probability function is the probability itself. If TRUE, it is the log of the probability.

Details

The distribution parameter(s) are replicated cyclically to be the same length as the input x, q, p, or the number of random samples requested.
Missing values (NAs) in the input or the distribution parameter(s) will cause the corresponding elements of the result to be missing.
Value
returns density (dlnorm), cumulative probability (plnorm), quantile (qlnorm), or random sample (rlnorm) for the log-normal distribution with parameters meanlog and sdlog.
Side Effects
If the .Random.seed dataset exists, the random sample function updates its value. The random sample function creates the .Random.seed dataset if it does not exist.
Background
The lognormal distribution is a family of continuous probability distributions defined on the interval [0, Inf) and parameterized by two parameters, meanlog and stdlog.
References
Johnson, N. L. and Kotz, S. (1970). Continuous Univariate Distributions, vol. 1. Houghton-Mifflin, Boston.
Lognormal Distribution. In Encyclopedia of Statistical Sciences. S. Kotz and N. L. Johnson, eds.
See Also
set.seed, Normal
Examples
log(rlnorm(50)) # hard way to generate a sample of normals

dlnorm(seq(0, 6, length = 20), meanlog = 1, sdlog = 3)

Package stats version 6.1.1-7
Package Index