Description Usage Arguments Details Value Author(s) References Examples
'ars' generates random sample from log-concave densify function interested by users using adapative rejection sampling.
1 |
N |
- numeric: sample size (number of observations). |
fn |
- function: log-concave function that is proporitional to the sampling density. |
l |
- numeric: the lower bound of the density function. The default is -Inf. |
u |
- numeric: the upper bound of the density function. The default is Inf. |
center |
- numeric: estimated center of function. The default is 0. |
step |
- numeric: value of bandwidth around center used to find the starting abscissaes. The default is 0.5. |
This function takes a numeric argument n and a function argument f to generate random numbers from the given distribution in the specified sample size, based on adapative rejection sampling method. For more detials, see Gilks and Wild (1992).
ars
returns a vector of sampled values.
Vincent Myers, Yanting Pan, and Zhenni Ye, based on Gilks and Wild (1992).
W. R. Gilks, P. Wild. (1992), "Adaptive Rejection Sampling for Gibbs Sampling," Applied Statistics 41:337<e2><80><93>348.
1 2 3 4 5 6 7 8 9 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.