Truncated normal distribution
truncnorm.Rd
Density, distribution function, quantile function, and random generation for the truncated normal distribution.
Usage
dtruncnorm(x, mean = 0, sd = 1, min = -Inf, max = Inf, log = FALSE)
ptruncnorm(q, mean = 0, sd = 1, min = -Inf, max = Inf,
lower.tail = TRUE, log.p = FALSE)
qtruncnorm(p, mean = 0, sd = 1, min = -Inf, max = Inf,
lower.tail = TRUE, log.p = FALSE)
rtruncnorm(n, mean = 0, sd = 1, min = -Inf, max = Inf)
Arguments
- x, q
vector of quantiles
- mean
mean parameter, must be positive.
- sd
standard deviation parameter, must be positive.
- min, max
truncation bounds.
- log, log.p
logical; if
TRUE
, probabilities/ densities \(p\) are returned as \(\log(p)\).- lower.tail
logical; if
TRUE
, probabilities are \(P[X <= x]\), otherwise, \(P[X > x]\).- p
vector of probabilities
- n
number of random values to return.