dist_lognormal {distributional} | R Documentation |
The log-normal distribution
Description
The log-normal distribution is a commonly used transformation of the Normal
distribution. If follows a log-normal distribution, then
would be characteristed by a Normal distribution.
Usage
dist_lognormal(mu = 0, sigma = 1)
Arguments
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. |
Details
We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.
In the following, let be a Normal random variable with mean
mu
= and standard deviation
sigma
= . The
log-normal distribution
is characterised by:
Support: , the set of all real numbers greater than or equal to 0.
Mean:
Variance:
Probability density function (p.d.f):
Cumulative distribution function (c.d.f):
The cumulative distribution function has the form
Where is the CDF of a standard Normal distribution, N(0,1).
See Also
Examples
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)