rtn: random variates from truncated normal distribution
Description
Random variates from the left or right truncated normal
distribution are generated. An efficient algorithm based
on the inverse CDF method is used. This algorithm can be
used to verify empirically the correcntess of the mean
and variance computation done by the other function
in this package, mvtn.
Usage
rtn(n, zmu = 0, zsig = 1, c = 1.96, side = c("left", "right"))
Arguments
n
number of random variables
zmu
mean parameter for normal distribution
zsig
standard deviation parameter
c
truncation point
side
either left or right
Value
the random variates, vector of length n
Details
The inverse cdf method is used in the case of the right truncated normal
distribution. In the left truncated case, the negative of the corresponding
right truncated distribution is used.