tnorm | R Documentation |

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

dtnorm(x, mean = 0, sd = 1, left = -Inf, right = Inf, log = FALSE) ptnorm(q, mean = 0, sd = 1, left = -Inf, right = Inf, lower.tail = TRUE, log.p = FALSE) qtnorm(p, mean = 0, sd = 1, left = -Inf, right = Inf, lower.tail = TRUE, log.p = FALSE) rtnorm(n, mean = 0, sd = 1, left = -Inf, right = Inf)

`x, q` |
vector of quantiles. |

`p` |
vector of probabilities. |

`n` |
number of observations. If |

`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]. |

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 truncated normal distribution has density

*f(x) = 1/σ φ((x - μ)/σ) /
(Φ((right - μ)/σ) - Φ((left - μ)/σ))*

for *left ≤ x ≤ right*, and 0 otherwise.

*Φ* 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.

`dtnorm`

gives the density, `ptnorm`

gives the distribution
function, `qtnorm`

gives the quantile function, and `rtnorm`

generates random deviates.

`dnorm`

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.