lnorm function

The Lognormal distribution

The Lognormal distribution

Raw moments for the Lognormal distribution.

mlnorm(r = 0, truncation = 0, meanlog = -0.5, sdlog = 0.5, lower.tail = TRUE)

Arguments

  • r: rth raw moment of the distribution, defaults to 1.
  • truncation: lower truncation parameter, defaults to 0.
  • meanlog, sdlog: mean and standard deviation of the distribution on the log scale with default values of 0 and 1 respectively.
  • lower.tail: logical; if TRUE (default), moments are E[xrXy]E[x^r|X \le y], otherwise, E[xrX>y]E[x^r|X > y]

Returns

Provides the y-bounded, rth raw moment of the distribution.

Details

Probability and Cumulative Distribution Function:

f(x)=1xVar2πe(lnxμ)2/2Var2,FX(x)=Φ(lnxμVar) f(x) = \frac{1}{{x Var \sqrt {2\pi } }}e^{- (lnx - \mu )^2/ 2Var^2} , \qquad F_X(x) = \Phi(\frac{lnx- \mu}{Var})

The y-bounded r-th raw moment of the Lognormal distribution equals:

μyr=er(rVar2+2μ)2[1Φ(lny(rVar2+μ)Var)] \mu^r_y = e^{\frac{r (rVar^2 + 2\mu)}{2}}[1-\Phi(\frac{lny - (rVar^2 + \mu)}{Var})]

Examples

## The zeroth truncated moment is equivalent to the probability function plnorm(2, meanlog = -0.5, sdlog = 0.5) mlnorm(truncation = 2) ## The (truncated) first moment is equivalent to the mean of a (truncated) random sample, #for large enough samples. x <- rlnorm(1e5, meanlog = -0.5, sdlog = 0.5) mean(x) mlnorm(r = 1, lower.tail = FALSE) sum(x[x > quantile(x, 0.1)]) / length(x) mlnorm(r = 1, truncation = quantile(x, 0.1), lower.tail = FALSE)
  • Maintainer: Ruben Dewitte
  • License: GPL-3
  • Last published: 2020-05-25

Useful links