pub fn rejection_sampling<R, P, T, D>(
target: T,
proposal: P,
proposal_density: D,
m: f64,
n: usize,
rng: &mut R,
) -> Vec<f64>Expand description
Rejection sampling from a target distribution.
§Arguments
target- Target density function (unnormalized OK)proposal- Proposal distribution samplerproposal_density- Proposal density functionm- Constant such that target(x) <= M * proposal_density(x) for all xn- Number of samples desiredrng- Random number generator
§Returns
Vector of accepted samples