liveBook · Manning

Accept/reject algorithm

An accept-reject algorithm samples candidate outcomes from a proposal process and accepts or rejects them according to a specified rule or probability.

How 2 Manning books explain it

Causal AI

An accept/reject algorithm repeatedly samples from a proposal process and retains only outcomes satisfying a specified condition or acceptance rule.

How it is used
Uses generated joint outcomes to perform probabilistic inference for a conditional distribution.
How deep it goes
Explains the sampling and filtering procedure with Pyro code, but only briefly contrasts efficiency and alternative inference algorithms.
Examples
Demonstrates estimating E(Z | Y = 3) by filtering Pyro samples generated from gamma, Poisson, and Bernoulli distributions.
What you can do after
Apply it via Pyro to estimate conditional distributions or expectations from simulated samples.

Read how Causal AI explains accept/reject algorithm →

Grokking Bayes

How it is used
Filters proposed moves within MCMC so the resulting chain follows the target posterior’s density.
How deep it goes
Explains initialization, proposal, density ratio, probabilistic acceptance, and retention, but defers the mathematical guarantee proof.
Examples
Uses a Beta(4, 3) posterior, an unnormalized Python density function, and a NumPy sampling loop.
What you can do after
Apply it via Python and NumPy to generate MCMC samples from a posterior known only up to a constant.

Read how Grokking Bayes explains accept/reject algorithm →

Related concepts

Questions about accept/reject algorithm

What is accept/reject algorithm?

An accept-reject algorithm samples candidate outcomes from a proposal process and accepts or rejects them according to a specified rule or probability.

Which Manning books explain accept/reject algorithm?

Causal AI and Grokking Bayes.

What is accept/reject algorithm a kind of?

Accept/reject algorithm is a kind of probabilistic reasoning. Probabilistic reasoning is drawing conclusions or making decisions under uncertainty by representing and evaluating possibilities using probabilities.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.