imp {tmvmixnorm}R Documentation

Rejection sampling of standardized truncated univariate normal distribution

Description

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

Usage

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

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


[Package tmvmixnorm version 1.1.1 Index]