direct-sampler-ar | R Documentation |
Direct sampler with accept-reject
direct_sampler_ar(
n,
w,
g,
tol = 1e-08,
N = 10,
max_rejections,
fill_method = "small_rects",
priority_weight = 1/2,
verbose = FALSE
)
n |
Number of draws to generate. |
w |
A weight function object. |
g |
A base distribution object. |
tol |
Tolerance for step function approximation in customized sampler. |
N |
Number of knots to use in approximation for |
max_rejections |
Maximum number of rejections to allow. If this number is reached, an exception will be thrown. |
fill_method |
Knot selection method for customized sampler. See
|
priority_weight |
TBD |
verbose |
Return a list with the sample |
Direct sampling with accept-reject algorithm can be used to take exact draws from the target distribution, with the added cost that same candidate draws will be rejected.
The function direct_sampler_ar
does not adapt the underlying step
function using rejections; here, the number of knots N
is kept
constant throughout sampling.
A vector of length n
which represents the sample.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.