rtnorm: Random sampling from one-sided truncated normal distribution

Description Usage Arguments Details Value Author(s)

View source: R/truncnorm.R

Description

Random sampling from one-sided truncated normal distribution

Usage

1
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.

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.

Value

Numeric length one.

Author(s)

Alexey Shiklomanov


ashiklom/PEcAnRTM documentation built on March 7, 2020, 7:46 a.m.