dot-rtrunc: Simulate sample from truncated distribution

.rtruncR Documentation

Simulate sample from truncated distribution

Description

a function to generate truncated distribution. Simulate one random sample from a standard normal distribution truncated to the left in the middle .rtrunc(1, spec = "norm", a = -Inf, b = 0)

Usage

.rtrunc(n, spec, a = -Inf, b = Inf, ...)

Arguments

n

the number of observations.

spec

a character string to specify the distribution.

a

lower bound.

b

upper bound.

...

any other arguments that can be used for the functions of different distribution such as "mean", "sd" for "qnorm()".

Value

A vector contains n random samples from the truncated distribution "spec".


XiaoruiZhu/parasol documentation built on Feb. 12, 2024, 7:34 a.m.