Density, distribution function, quantile function, and random generation for the truncated lognormal distribution with parameters mean, cv, min, and max.

dlnormTruncAlt(x, mean = exp(1/2), cv = sqrt(exp(1) - 1), min = 0, max = Inf)
  plnormTruncAlt(q, mean = exp(1/2), cv = sqrt(exp(1) - 1), min = 0, max = Inf)
  qlnormTruncAlt(p, mean = exp(1/2), cv = sqrt(exp(1) - 1), min = 0, max = Inf)
  rlnormTruncAlt(n, mean = exp(1/2), cv = sqrt(exp(1) - 1), min = 0, max = Inf)

Arguments

x

vector of quantiles.

q

vector of quantiles.

p

vector of probabilities between 0 and 1.

n

sample size. If length(n) is larger than 1, then length(n) random values are returned.

mean

vector of means of the distribution of the non-truncated random variable. The default is mean=exp(1/2).

cv

vector of (positive) coefficient of variations of the non-truncated random variable. The default is cv=sqrt(exp(1)-1).

min

vector of minimum values for truncation on the left. The default value is min=0.

max

vector of maximum values for truncation on the right. The default value is max=Inf.

Details

See the help file for LognormalAlt for information about the density and cdf of a lognormal distribution with this alternative parameterization.

Let \(X\) denote a random variable with density function \(f(x)\) and cumulative distribution function \(F(x)\), and let \(Y\) denote the truncated version of \(X\) where \(Y\) is truncated below at min=\(A\) and above atmax=\(B\). Then the density function of \(Y\), denoted \(g(y)\), is given by: $$g(y) = frac{f(y)}{F(B) - F(A)}, A \le y \le B$$ and the cdf of Y, denoted \(G(y)\), is given by:

\(G(y) =\)0for \(y < A\)
\(\frac{F(y) - F(A)}{F(B) - F(A)}\)for \(A \le y \le B\)
1for \(y > B\)

The \(p^{th}\) quantile \(y_p\) of \(Y\) is given by:

\(y_p =\)\(A\)for \(p = 0\)
\(F^{-1}\{p[F(B) - F(A)] + F(A)\} \)for \(0 < p < 1\)
\(B\)for \(p = 1\)

Random numbers are generated using the inverse transformation method: $$y = G^{-1}(u)$$ where \(u\) is a random deviate from a uniform \([0, 1]\) distribution.

Value

dlnormTruncAlt gives the density, plnormTruncAlt gives the distribution function, qlnormTruncAlt gives the quantile function, and rlnormTruncAlt generates random deviates.

References

Forbes, C., M. Evans, N. Hastings, and B. Peacock. (2011). Statistical Distributions. Fourth Edition. John Wiley and Sons, Hoboken, NJ.

Johnson, N. L., S. Kotz, and N. Balakrishnan. (1994). Continuous Univariate Distributions, Volume 1. Second Edition. John Wiley and Sons, New York.

Schneider, H. (1986). Truncated and Censored Samples from Normal Populations. Marcel Dekker, New York, Chapter 2.

Author

Steven P. Millard (EnvStats@ProbStatInfo.com)

Note

A truncated lognormal distribution is sometimes used as an input distribution for probabilistic risk assessment.

Examples

  # Density of a truncated lognormal distribution with parameters 
  # mean=10, cv=1, min=0, max=20, evaluated at 2 and 12:

  dlnormTruncAlt(c(2, 12), 10, 1, 0, 20) 
#> [1] 0.08480874 0.03649884
  #[1] 0.08480874 0.03649884

  #----------

  # The cdf of a truncated lognormal distribution with parameters 
  # mean=10, cv=1, min=0, max=20, evaluated at 2 and 12:

  plnormTruncAlt(c(2, 4), 10, 1, 0, 20) 
#> [1] 0.07230627 0.27612429
  #[1] 0.07230627 0.82467603

  #----------

  # The median of a truncated lognormal distribution with parameters 
  # mean=10, cv=1, min=0, max=20:

  qlnormTruncAlt(.5, 10, 1, 0, 20) 
#> [1] 6.329505
  #[1] 6.329505

  #----------

  # A random sample of 3 observations from a truncated lognormal distribution 
  # with parameters mean=10, cv=1, min=0, max=20. 
  # (Note: the call to set.seed simply allows you to reproduce this example.)

  set.seed(20) 
  rlnormTruncAlt(3, 10, 1, 0, 20) 
#> [1] 13.626087 10.614039  4.026795
  #[1]  6.685391 17.445387 18.543553