Random sampling from one-sided truncated normal distribution

rtnorm(mu, sd, MIN)

Arguments

mu

The mean parameter of the truncated normal. NOTE that this is NOT equal to the mean of the distribution

sd

The standard deviation parameter of the truncated normal. Again, NOTE tht this is not the SD of the distribution.

MIN

The minimum value, which defines the truncation.

Value

Numeric length one.

Details

Draws a random number and, if it doesn't fall within the specified range, resample using an adjusted Normal CDF. This isn't performed immediately because CDF sampling calls three functions -- qnorm, runif, and pnorm--and therefore is much less efficient than a simple random sample.