Description Usage Arguments Details Value Author(s) References See Also Examples

Density, distribution function, quantile function and random
generation for the truncated Normal distribution with mean equal to `mean`

and standard deviation equal to `sd`

before truncation, and
truncated on the interval `[lower, upper]`

.

1 2 3 4 5 6 |

`x,q` |
vector of quantiles. |

`p` |
vector of probabilities. |

`n` |
number of observations. If |

`mean` |
vector of means. |

`sd` |
vector of standard deviations. |

`lower` |
lower truncation point. |

`upper` |
upper truncation point. |

`log` |
logical; if TRUE, return log density or log hazard. |

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

The truncated normal distribution has density

* f(x, mu, sigma) = phi(x, mu, sigma) / (Phi(upper, mu, sigma) - Phi(lower, mu, sigma))
*

for *lower <= x <= upper*, and 0 otherwise.

*mean* is the mean of the original Normal distribution before
truncation,

*sd* is the corresponding standard deviation,

*u* is the upper truncation point,

*l* is the lower truncation point,

*phi(x)* is the density of the corresponding normal
distribution, and

*Phi(x)* is the distribution function of the corresponding normal
distribution.

If `mean`

or `sd`

are not specified they assume the default values
of `0`

and `1`

, respectively.

If `lower`

or `upper`

are not specified they assume the default values
of `-Inf`

and `Inf`

, respectively, corresponding to no
lower or no upper truncation.

Therefore, for example, `dtnorm(x)`

, with no other arguments, is
simply equivalent to `dnorm(x)`

.

Only `rtnorm`

is used in the `msm`

package, to simulate
from hidden Markov models with truncated normal
distributions. This uses the rejection sampling algorithms described
by Robert (1995).

These functions are merely provided for completion,
and are not optimized for numerical stability or speed. To fit a hidden Markov
model with a truncated Normal response distribution, use a
`hmmTNorm`

constructor. See the `hmm-dists`

help page for further details.

`dtnorm`

gives the density, `ptnorm`

gives the distribution
function, `qtnorm`

gives the quantile function, and `rtnorm`

generates random deviates.

C. H. Jackson [email protected]

Robert, C. P. Simulation of truncated normal variables. Statistics and Computing (1995) 5, 121–125

1 2 3 |

msm documentation built on Feb. 3, 2018, 1:04 a.m.

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.