tnorm: truncated normal distribution

tnormR Documentation

truncated normal distribution

Description

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

Usage

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)

rtnorm(n, mean = 0, sd = 1)

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 Feb. 10, 2024, 11:07 p.m.