rttnorm: Draw from two-sided truncated normal

View source: R/RcppExports.R

rttnormR Documentation

Draw from two-sided truncated normal

Description

This function draws from a two-sided truncated univariate normal distribution.

Usage

rttnorm(mu, sig, lower_bound, upper_bound)

Arguments

mu

The mean.

sig

The standard deviation.

lower_bound

The lower truncation point.

upper_bound

The upper truncation point.

Value

A numeric value.

Examples

### samples from a standard normal truncated at -2 and 2
R <- 1e4
draws <- replicate(R, rttnorm(0,1,-2,2))
plot(density(draws))

loelschlaeger/RprobitB documentation built on Oct. 15, 2024, 11:08 a.m.