dist_lognormal {distributional} | R Documentation |
The log-normal distribution is a commonly used transformation of the Normal distribution. If X follows a log-normal distribution, then \ln{X} would be characteristed by a Normal distribution.
dist_lognormal(mu = 0, sigma = 1)
mu |
The mean (location parameter) of the distribution, which is the mean of the associated Normal distribution. Can be any real number. |
sigma |
The standard deviation (scale parameter) of the distribution. Can be any positive number. |
We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.
In the following, let Y be a Normal random variable with mean
mu
= μ and standard deviation sigma
= σ. The
log-normal distribution X = exp(Y) is characterised by:
Support: R+, the set of all real numbers greater than or equal to 0.
Mean: e^(μ + σ^2/2
Variance: (e^(σ^2)-1) e^(2μ + σ^2
Probability density function (p.d.f):
f(x) = 1 / (x * sqrt(2 π σ^2)) exp(-(log(x) - μ)^2 / (2 σ^2))
Cumulative distribution function (c.d.f):
The cumulative distribution function has the form
F(x) = Phi((log(x) - μ)/σ)
Where Phi is the CDF of a standard Normal distribution, N(0,1).
dist <- dist_lognormal(mu = 1:5, sigma = 0.1) dist mean(dist) variance(dist) skewness(dist) kurtosis(dist) generate(dist, 10) density(dist, 2) density(dist, 2, log = TRUE) cdf(dist, 4) quantile(dist, 0.7) # A log-normal distribution X is exp(Y), where Y is a Normal distribution of # the same parameters. So log(X) will produce the Normal distribution Y. log(dist)