Learn R Programming

BayesDecon (version 0.1.4)

TruncNormal: The Truncated Normal Distribution

Description

Density, distribution, quantile, and random variate generation functions for the Truncated Normal distribution, with mu and sig equal to the mean and standard deviation before truncation and truncated to [lwr, upr]. Wrappers for functions from msm.

Usage

dtnorm(x, mu, sig, lwr, upr, log = FALSE)

ptnorm(q, mu, sig, lwr, upr, lower.tail = TRUE, log.p = FALSE)

qtnorm(p, mu, sig, lwr, upr, lower.tail = TRUE, log.p = FALSE)

rtnorm(n, mu, sig, lwr = -Inf, upr = Inf)

Value

dtnorm gives the density, ptnorm gives the distribution function, qtnorm gives the quantile function, and rtnorm generates random variates. The length of the result is determined by the length of x for dtnorm.

Arguments

x, q

A vector of quantiles.

mu

A real-valued mean.

sig

A strictly positive standard deviation.

lwr

A lower bound.

upr

An upper bound.

log, log.p

A logical value indication whether a probability p should be given as log(p)

lower.tail

A logical value indicating whether to take lower or upper tail probabilities.

p

A vector of probabilities.

n

A number of observations.