| Title: | Truncated Normal Distribution |
|---|---|
| Description: | Truncated Normal Distributions can be generated by other packages such as msm, but these are slow. tnorm is a faster C++ replacement. |
| Authors: | Mark Padgham [aut, cre] |
| Maintainer: | Mark Padgham <[email protected]> |
| License: | GPL-3 |
| Version: | 0.0.1 |
| Built: | 2026-05-16 07:56:08 UTC |
| Source: | https://github.com/mpadge/tnorm |
Generates truncated normal distributions. Current best R method is
msm::rtnorm, but this is entirely R-based and therefore s l o w.
trunc-norm is Rcpp-based and much faster.
tnormn
|
The sole function; used to generate truncated normal distributions |
Generates a truncated normal distribution
tnormn(n, sd, seed)tnormn(n, sd, seed)
n |
Number of truncated normally distributed observations to be simulated |
sd |
Standard deviation of truncated normal distribution |
seed |
Random seed |
A vector of n truncated normally distributed values
x <- tnormn (n=100, sd=0.1)x <- tnormn (n=100, sd=0.1)