rtnorm | R Documentation |
This function draws from a one-sided truncated univariate normal distribution.
rtnorm(mu, sig, trunpt, above)
mu |
The mean. |
sig |
The standard deviation. |
trunpt |
The truncation point. |
above |
A boolean, if |
A numeric value.
### samples from a standard normal truncated at 1 from above
R <- 1e4
draws <- replicate(R, rtnorm(0,1,1,TRUE))
plot(density(draws))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.