tnorm: Truncated Normal Functions

Description Usage Arguments Value Author(s) Examples

Description

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

Usage

1
2
3
4
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

x,q

vector of quantiles.

p

vector of probabilities.

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

Value

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

Author(s)

Rob Carnell

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)

TruncatedDistributions documentation built on May 2, 2019, 4:52 p.m.