| imp | R Documentation |
imp contains a general function for rejection sampling of standardized truncated univariate normal distribution in (a,b).
imp(a, b)
a |
lower bound for truncation. |
b |
upper bound for truncation (must be |
imp returns a list
x: sampled value; and
acc: total number of draw used.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.