tnorm: truncated normal distribution

Description Usage Arguments Details Value

Description

Density, distribution function, and quantile function for truncated normal distribution.

Usage

1
2
3
4
5
dtnorm(x, mean = 0, sd = 1, log = FALSE)

ptnorm(q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)

qtnorm(p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)

Arguments

x, q

A numeric vector of quantiles.

mean

A numeric value of mean parameter for the normal distirbution.

sd

A numeric value of standard deviation for the normal distirbution.

log, log.p

A logical; if TRUE, the probability p is given as log(p).

lower.tail

A logical; if TRUE, the probability is P[X <= x], otherwise, P[X > x].

p

A numeric vector of probabilities.

Details

The truncated normal distribution has the cumulative distribution function F(q) = 1-(1-G(q))/(1-G(0)), where G(q) is the cumulative distribution function of normal distribution with mean and sd.

Value

'dtnorm' gives the desity, 'ptnorm' gives the distribution, and 'qtnorm' gives the quantile function.


okamumu/Rsrat documentation built on April 2, 2018, 7:33 p.m.