Probability & Statistics

ABC Tolerance Posterior

See how a simulator acceptance tolerance changes an approximate posterior.

By Riano · Published · Updated · Report a correction

ABC Tolerance Posterior

Approximate Bayesian Computation (ABC) is a class of methods used in Bayesian statistics when the likelihood function is difficult or impossible to evaluate, but simulating from the model is feasible. In this toy benchmark, we examine how a simulator acceptance tolerance affects the approximate posterior distribution.

Worked Example: Calculating Acceptance and ABC Posterior

Let us manually calculate the ABC posterior for a specific case. Consider the following parameters:

  • Prior: Uniform (weights = 0.2 for each p ∈ {0, 0.25, 0.5, 0.75, 1})
  • Trials (n): 4
  • Observed count (k): 2
  • Tolerance (ε): 1
  • Probe probability (p): 0.5

Our simulator draws K ~ Binomial(n, p). We accept the simulation if |K - k| ≤ ε, which means K ∈ {1, 2, 3}. We want to calculate the acceptance probability at the probe probability p = 0.5:

P(accept | p=0.5) = P(K=1) + P(K=2) + P(K=3)
P(K=1) = 4 * 0.5^1 * 0.5^3 = 4 * 0.0625 = 0.25
P(K=2) = 6 * 0.5^2 * 0.5^2 = 6 * 0.0625 = 0.375
P(K=3) = 4 * 0.5^3 * 0.5^1 = 4 * 0.0625 = 0.25

P(accept | p=0.5) = 0.25 + 0.375 + 0.25 = 0.875

We calculate the acceptance probabilities for all p:

pP(accept|p)Prior(p)Prior * P(accept)
000.20
0.250.67968750.20.1359375
0.50.8750.20.175
0.750.67968750.20.1359375
100.20

For p = 0.25 (and symmetrically p = 0.75), the binomial probabilities are P(K=1) = 4 × 0.251 × 0.753 = 0.421875, P(K=2) = 6 × 0.252 × 0.752 = 0.2109375, and P(K=3) = 4 × 0.253 × 0.751 = 0.046875, which sum to P(accept | p=0.25) = 0.6796875. The overall acceptance probability is the sum of the weighted column:

Overall Acceptance = 0 + 0.1359375 + 0.175 + 0.1359375 + 0 = 0.446875

The ABC posterior at probe p = 0.5 is:

ABC Posterior(p=0.5) = (Prior(0.5) * P(accept|p=0.5)) / Overall Acceptance
ABC Posterior(p=0.5) = (0.2 * 0.875) / 0.446875 ≈ 0.3916083916083916

Interactive Experiment

You can interact with these parameters in the ABC Tolerance Posterior module to see how they impact the approximate posterior.

  1. Set Prior to "Uniform". Note how the prior distribution is flat across all probabilities.
  2. Set Trials to 4 and Observed count to 2. This simulates observing exactly half successes.
  3. Change Tolerance from 0 to 1. Notice how the acceptance probability curve widens, making it easier for parameter values farther from the observed proportion to be accepted. This flattens the ABC posterior compared to the exact posterior.
  4. Change the Probe probability to 0.5 to see the specific numerical values of acceptance and posterior at the center of the grid.
  5. Set Prior to "Center". Observe how a peaked prior influences the exact and ABC posteriors, pulling them towards the center (p=0.5).

Limitations

While this module provides an intentionally tractable benchmark to build intuition about ABC, it has several limitations:

  • Finite Grid: We use a small, discrete grid of parameter values (0, 0.25, 0.5, 0.75, 1). Real-world ABC applications typically explore continuous parameter spaces, often using Markov Chain Monte Carlo (MCMC) or Sequential Monte Carlo (SMC) methods.
  • Sufficient Statistics: In this binomial model, the observed count K is a sufficient statistic for the probability p. In practice, ABC is used when the full likelihood is intractable, and we often have to rely on summary statistics that may not be sufficient, introducing further approximation error.
  • Tolerance Bias: As demonstrated in the module, using a tolerance ε > 0 introduces bias. The ABC posterior is no longer the exact posterior but rather an approximation. As ε increases, the ABC posterior tends towards the prior distribution. An ε of 0 gives the exact posterior (since K is a sufficient statistic), but in complex models, an exact match is highly improbable, necessitating a non-zero tolerance.
  • Endpoint Behavior: Endpoints like p=0 or p=1 can have exactly zero acceptance depending on the observed count and tolerance, but they remain valid hypotheses in the model.

References

For a deeper understanding of Approximate Bayesian Computation and its applications, consult the following source:

Experience it interactively

Adjust parameters, observe in real time, and build deep intuition with Riano’s interactive ABC Tolerance Posterior module.

Try ABC Tolerance Posterior on Riano →

More in Probability & Statistics