Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cnorm

The Censored Normal Distribution


Description

Density, distribution function, quantile function, and random generation for the left and/or right censored normal distribution.

Usage

dcnorm(x, mean = 0, sd = 1, left = -Inf, right = Inf, log = FALSE)

pcnorm(q, mean = 0, sd = 1, left = -Inf, right = Inf, 
  lower.tail = TRUE, log.p = FALSE)

rcnorm(n, mean = 0, sd = 1, left = -Inf, right = Inf)

qcnorm(p, mean = 0, sd = 1, left = -Inf, right = Inf,
  lower.tail = TRUE, log.p = FALSE)

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.

left

left censoring point.

right

right censoring point.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P[X <= x] otherwise, P[X > x].

Details

If mean or sd are not specified they assume the default values of 0 and 1, respectively. left and right have the defaults -Inf and Inf respectively.

The censored normal distribution has density f(x):

Φ((left - μ)/σ) if x ≤ left
1 - Φ((right - μ)/σ) if x ≥ right
φ((x - μ)/σ)/σ if left < x < right

where Φ and φ are the cumulative distribution function and probability density function of the standard normal distribution respectively, μ is the mean of the distribution, and σ the standard deviation.

Value

dcnorm gives the density, pcnorm gives the distribution function, qcnorm gives the quantile function, and rcnorm generates random deviates.

See Also


crch

Censored Regression with Conditional Heteroscedasticity

v1.0-4
GPL-2 | GPL-3
Authors
Jakob Messner [aut, cre] (<https://orcid.org/0000-0002-1027-3673>), Achim Zeileis [aut] (<https://orcid.org/0000-0003-0918-3766>), Reto Stauffer [aut] (<https://orcid.org/0000-0002-3798-5507>)
Initial release
2019-08-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.