Description Usage Arguments Details Value Note Author(s) References See Also Examples
Density, distribution function, quantile function, and random generation
for the truncated lognormal distribution with parameters meanlog
,
sdlog
, min
, and max
.
1 2 3 4  dlnormTrunc(x, meanlog = 0, sdlog = 1, min = 0, max = Inf)
plnormTrunc(q, meanlog = 0, sdlog = 1, min = 0, max = Inf)
qlnormTrunc(p, meanlog = 0, sdlog = 1, min = 0, max = Inf)
rlnormTrunc(n, meanlog = 0, sdlog = 1, min = 0, max = Inf)

x 
vector of quantiles. 
q 
vector of quantiles. 
p 
vector of probabilities between 0 and 1. 
n 
sample size. If 
meanlog 
vector of means of the distribution of the nontruncated random variable
on the log scale.
The default is 
sdlog 
vector of (positive) standard deviations of the nontruncated random variable
on the log scale.
The default is 
min 
vector of minimum values for truncation on the left. The default value is

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

See the help file for the lognormal distribution for information about the density and cdf of a lognormal distribution.
Probability Density and Cumulative Distribution Function
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 ≤ y ≤ B
and the cdf of Y, denoted G(y), is given by:
G(y) =  0  for y < A 
\frac{F(y)  F(A)}{F(B)  F(A)}  for A ≤ y ≤ B  
1  for y > B  
Quantiles
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
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.
dlnormTrunc
gives the density, plnormTrunc
gives the distribution function,
qlnormTrunc
gives the quantile function, and rlnormTrunc
generates random
deviates.
A truncated lognormal distribution is sometimes used as an input distribution for probabilistic risk assessment.
Steven P. Millard (EnvStats@ProbStatInfo.com)
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.
Lognormal, Probability Distributions and Random Numbers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31  # Density of a truncated lognormal distribution with parameters
# meanlog=1, sdlog=0.75, min=0, max=10, evaluated at 2 and 4:
dlnormTrunc(c(2, 4), 1, 0.75, 0, 10)
#[1] 0.2551219 0.1214676
#
# The cdf of a truncated lognormal distribution with parameters
# meanlog=1, sdlog=0.75, min=0, max=10, evaluated at 2 and 4:
plnormTrunc(c(2, 4), 1, 0.75, 0, 10)
#[1] 0.3558867 0.7266934
#
# The median of a truncated lognormal distribution with parameters
# meanlog=1, sdlog=0.75, min=0, max=10:
qlnormTrunc(.5, 1, 0.75, 0, 10)
#[1] 2.614945
#
# A random sample of 3 observations from a truncated lognormal distribution
# with parameters meanlog=1, sdlog=0.75, min=0, max=10.
# (Note: the call to set.seed simply allows you to reproduce this example.)
set.seed(20)
rlnormTrunc(3, 1, 0.75, 0, 10)
#[1] 5.754805 4.372218 1.706815

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
Please suggest features or report bugs in the GitHub issue tracker.
All documentation is copyright its authors; we didn't write any of that.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.