imp: Rejection sampling of standardized truncated univariate...

Description Usage Arguments Value Examples

View source: R/imp.R

Description

imp contains a general function for rejection sampling of standardized truncated univariate normal distribution in (a,b).

Usage

1
imp(a, b)

Arguments

a

lower bound for truncation.

b

upper bound for truncation (must be > a).

Value

imp returns a list x: sampled value; and acc: total number of draw used.

Examples

1
2
3
imp(1,Inf) # Case 1: [a,infty)
imp(-1,1) # Case 2: 0 in [a,b], a<0<b
imp(1,2) # Case 3: [a,b], a>=0

tmvmixnorm documentation built on Sept. 19, 2020, 1:07 a.m.

Related to imp in tmvmixnorm...