Introduction
In Bayesian statistics, the "prior" represents our knowledge or uncertainty about a parameter before observing new data. Choosing an appropriate prior is a critical yet notoriously difficult and subjective step in the modeling workflow. Many researchers currently rely on ad hoc procedures, such as using "uninformative" priors that may have unintended consequences or selecting distributions based on convention rather than domain expertise. PreliZ addresses this gap by providing a unified, user-friendly Python library for prior elicitation, designed to move Bayesian practitioners toward more robust and reproducible model foundations.
The PreliZ Framework
PreliZ is built on top of SciPy and extends it specifically for Bayesian modeling. Its functionality is structured around four core pillars:
- Enhanced Distributions: PreliZ includes standard distributions but utilizes "canonical" parameterizations that are more intuitive for human experts (e.g., defining a Beta distribution by its mean and standard deviation). It also introduces distributions missing from SciPy, such as
HalfStudentTandLogitNormal. - Interactive Visualization: Using
ipywidgets, the library provides sliders (plot_interactive) that allow users to manually adjust parameters and observe real-time changes in the distribution's shape and cumulative density. - Algorithmic Learning: The tool offers automated fitting methods. For instance, the Maximum Entropy (
maxent) feature finds a distribution that satisfies specific user constraints with minimal additional information. - Predictive Elicitation: This advanced feature allows experts to reason about observable data (the predictive space) rather than abstract model parameters. PreliZ then works backward to identify the parameter priors that would generate those observations.
Interactive and Algorithmic Elicitation
One of the most user-centric features of PreliZ is the "Roulette Method." This interactive component allows a user to "draw" a histogram representing their beliefs. PreliZ then algorithmically fits a formal probability distribution to this input, bridging the gap between subjective belief and mathematical rigor.
Bridging the Parameter-Observable Gap
A key insight of the PreliZ project is that experts are often more proficient at predicting outcomes—such as the expected range of a physical measurement—than estimating abstract latent variables like variance. By prioritizing predictive elicitation, PreliZ leverages this human strength to inform complex models.
Integration and Future Directions
PreliZ is designed to be "plug-and-play" with major probabilistic programming languages (PPLs) like PyMC and PyStan. It integrates seamlessly with the broader Python ecosystem, including ArviZ, Matplotlib, and NumPy.
While the library currently excels at unidimensional elicitation, the authors acknowledge that high-dimensional elicitation remains a frontier. The Prior Predictive Assistant (ppa), a semi-automated tool for selecting priors via visual samples, remains experimental. Future development will focus on refining these assistants and expanding the library's capacity to handle multi-parameter dependencies during the elicitation process.
Summary updated