Unbiased and efficient log-likelihood estimation with inverse binomial sampling

Bas van Opheusden, Luigi Acerbi, Wei Ji Ma

Fitting complex computational models to data often hits a wall: the likelihood function. For many "simulator-based" models in fields like neuroscience and biology, we can easily generate synthetic data, but we cannot analytically calculate the probability of observing a specific real-world data point. This paper introduces Inverse Binomial Sampling (IBS) as a powerful, unbiased, and surprisingly simple way to overcome this bottleneck.

TL;DR

This paper presents Inverse Binomial Sampling (IBS) as a method to estimate the log-likelihood of simulator-based models without the systematic biases found in standard simulation techniques. By sampling from a model until a match is found—rather than for a fixed number of trials—IBS provides a "uniformly unbiased" estimate that is more robust and efficient for parameter estimation and model comparison.

What Problem Does This Paper Address?

In modern statistical inference, the likelihood function is king. It tells us how well a model’s parameters explain the observed data. However, for many complex models, the likelihood is "intractable"—it’s too hard to compute.

Researchers often turn to "likelihood-free" methods like Approximate Bayesian Computation (ABC), which rely on summary statistics, or simple simulation where you draw a fixed number of samples ($M$) and see how many match the data. The problem? To get the log-likelihood (which we need for optimization and model selection), you have to take the logarithm of your estimate. Because the logarithm is a non-linear transformation, a simple average of simulations becomes systematically biased. If your model predicts an event is very rare, a fixed-sampling approach might never see it, leading to an infinite bias ($\log(0)$), which can completely derail model fitting.

Methods

The authors propose a shift from "fixed sampling" to "inverse sampling."

  1. The Policy: Instead of drawing $M$ samples and counting matches, you keep drawing samples from your simulator until you get exactly one match (a "hit") with the observed data point.
  2. The Estimator: The log-likelihood estimate for that data point is then a function of $K$ (the number of samples it took to get a hit). Specifically, it is calculated using a sum of reciprocal integers (related to the harmonic series or the digamma function).
  3. Key Properties:
    • Unbiased: Unlike fixed sampling, the expected value of the IBS estimator is exactly the true log-likelihood.
  4. Bounded Variance: The variance of the estimate is uniformly bounded (it never exceeds $\pi^2/6 \approx 1.645$), regardless of how low the true probability is.
  5. Multi-fidelity: You can repeat the process $R$ times and average the results to further reduce noise.

Datasets

The authors evaluate IBS using three model-fitting problems of increasing complexity from computational cognitive science:

  • Orientation Discrimination: A simple psychometric task where a participant judges the tilt of a line. This has an analytical solution, serving as a ground-truth baseline.
  • Change Localization: A task where participants identify which of six items changed orientation. This requires numerical integration for an "exact" solution.
  • Four-in-a-Row Game: A complex sequential decision-making task (a variant of tic-tac-toe). The likelihood here is truly intractable, representing the "real-world" use case for IBS.

Key Insights and Ideas

  • The "Lapse" Sensitivity: In behavioral data, participants occasionally make random errors ("lapses"). Fixed sampling is notoriously bad at handling these rare events because it often misses them entirely. IBS handles them naturally by simply sampling longer until the event occurs.
  • Efficiency through Adaptation: IBS automatically allocates more computational effort to "hard" trials (low-probability events) and less to "easy" ones. This makes it more sample-efficient than fixed-sampling methods that use the same $M$ for every trial.
  • Gaussian Noise: Because the total log-likelihood is a sum of independent estimates across many trials, the Central Limit Theorem ensures the total estimate is approximately Gaussian. This makes IBS a perfect partner for optimization algorithms like Bayesian Adaptive Direct Search (BADS), which are designed to handle Gaussian noise.

Key Results

  • Superior Parameter Recovery: Across all three tasks, IBS produced lower Root Mean Squared Error (RMSE) in estimated parameters compared to fixed sampling, even when fixed sampling used the same average number of samples.
  • Accurate Model Evidence: IBS recovered maximum log-likelihood values within 1–2 points of the ground truth. In contrast, fixed sampling remained strongly biased even with a large number of samples, potentially leading to incorrect scientific conclusions during model comparison.
  • Robustness: IBS was shown to be "practically robust," meaning it works out-of-the-box without the need for the extensive tuning often required by other likelihood-free methods.

Limitations and Future Work

  • Discrete Responses Only: In its basic form, IBS requires the model's output to be discrete (e.g., "left" vs. "right" or "square A" vs. "square B").
  • Continuous Extension: The authors propose "Approximate IBS" (AIBS) for continuous data—using a distance metric and a tolerance threshold—but acknowledge this requires further theoretical exploration.
  • The "Hang" Risk: If a model parameter is so bad that the probability of a match is near zero, IBS could theoretically sample forever (an infinite loop). The authors recommend using a small "lapse rate" in the model or an early-stopping threshold to prevent this.
  • Future Directions: Integrating IBS with more advanced Bayesian inference techniques like Markov Chain Monte Carlo (MCMC) or Variational Inference.

Summary updated

BibTeX
@article{opheusden2020unbiased,
  author = {Bas van Opheusden and Luigi Acerbi and Wei Ji Ma},
  title = {{Unbiased and efficient log-likelihood estimation with inverse binomial sampling}},
  journal = {PLOS Computational Biology},
  year = {2020},
  doi = {10.1371/journal.pcbi.1008483},
}

Loading related content...

Figure