rtuvn_r: Univariate Truncated Normal Distribution

Description Usage Arguments Value References Examples

View source: R/dtuvn.R

Description

Random number generator for the truncated normal distribution. To calculate the density please use dtuvn.

Usage

1
rtuvn_r(n = 1, mean = 0, sd = 1, lower, upper)

Arguments

n

number of samples

mean

mean

sd

standard deviation

lower

lower bound

upper

upper bound

Value

a vector of generated samples

References

Li, Y., & Ghosh, S. K. (2015). Efficient sampling methods for truncated multivariate normal and student-t distributions subject to linear inequality constraints. Journal of Statistical Theory and Practice, 9(4), 712-732.

Examples

1
2
# sample from truncated normal with mean 10, sd 20, and lower = 10, upper = 20
rtuvn(n = 1, mean = 10, sd = 20, lower = 10, upper = 20)

suchitm/tmvn documentation built on Dec. 10, 2020, 10:25 a.m.