tnorm: Truncated normal distribution functions

Description Usage Arguments Value Examples

Description

pdf, cdf, inverse cdf, and random deviates of the truncated normal distribution.

Usage

1
2
3
4
5
6
7
rtnorm(n, mean = 0, sd = 1, a = -Inf, b = Inf)

dtnorm(x, mean = 0, sd = 1, a = -Inf, b = Inf)

ptnorm(q, mean = 0, sd = 1, a = -Inf, b = Inf)

qtnorm(p, mean = 0, sd = 1, a = -Inf, b = Inf)

Arguments

n

number of observations. If length(n) > 1, the length is taken to be the number required.

mean

vector of means.

sd

vector of standard deviations.

a

vector of lower truncation limits

b

vector of upper truncation limits

x, q

vector of quantiles.

p

vector of probabilities.

Value

dtnorm gives the density, ptnorm gives the distribution function, qtnorm gives the quantile function, and rtnorm generates random deviates.

Examples

1
2
3
4
rtnorm(5, 1, 2, 0.5, 3.0)
dtnorm(seq(0, 4, by=0.5), 1, 2, 0.5, 3.0)
ptnorm(seq(0, 4, by=0.5), 1, 2, 0.5, 3.0)
qtnorm(seq(0, 1, by=0.1), 1, 2, 0.5, 3.0)

bertcarnell/truncateddist documentation built on May 11, 2021, 11:07 a.m.