truncnorm {bayess} | R Documentation |
This is a plain random generator for a normal variate
\mathcal{N}(\mu,\tau^2)
truncated
to (a,b)
, using the inverse cdf qnorm
. It may thus
be imprecise for extreme values of the bounds.
truncnorm(n, mu, tau2, a, b)
n |
number of simulated variates |
mu |
mean of the original normal |
tau2 |
variance of the original normal |
a |
lower bound |
b |
upper bound |
a sample of real numbers over (a,b)
with size n
x=truncnorm(10^3,1,2,3,4)
hist(x,nclass=123,col="wheat",prob=TRUE)