Learn R Programming

MRIaggr (version 1.1.5)

tnorm: Truncated Normal distribution

Description

Density and random generation for the truncated Normal distribution with mean equal to mean and standard deviation equal to sd before truncation, and truncated on the interval [lower, upper]. For internal use.

Usage

dtnorm(x, mean = 0, sd = 1, lower = -Inf, upper = Inf, log = FALSE) rtnorm(n, mean = 0, sd = 1, lower = -Inf, upper = Inf)

Arguments

x
vector of quantiles. numeric vector.
n
number of observations. integer.
mean
mean vector of means. numeric. Default is 0.
sd
vector of standard deviations. numeric. Default is 1.
lower
truncation point. numeric. Default is -Inf.
upper
upper truncation point. numeric. Default is Inf.
log
if TRUE, probabilities p are given as log(p). logical. Default is FALSE.

Details

These functions are a copy of the dtnorm and rtnorm of the msm package. See the corresponding help page for additional details.