Learn R Programming

oeli (version 0.5.2)

rtnorm_cpp: Draw from univariate truncated normal

Description

rtnorm_cpp draws from a one-sided truncated univariate normal distribution. rttnorm_cpp draws from a two-sided truncated univariate normal distribution.

Usage

rtnorm_cpp(mean, sd, point, above, log = FALSE)

rttnorm_cpp(mean, sd, lower, upper, log = FALSE)

Value

A numeric, the random draw.

Arguments

mean

A numeric, the mean.

sd

A numeric, the standard deviation.

point

A numeric, the truncation point.

above

A logical, if TRUE truncation from above and if FALSE truncation from below.

log

A logical, if TRUE the draw is taken from the log-normal distribution. By default, log = FALSE.

lower

A numeric, the lower truncation point.

upper

A numeric, the upper truncation point.

Details

These function performs no input checks.