You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-8Lines changed: 30 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,26 @@
8
8
9
9
Bayesian conjugate models in Python
10
10
11
+
## Overview
12
+
13
+
`conjugate-models` is a modern Python package for Bayesian conjugate inference that prioritizes a clean, idiomatic API and seamless integration with widely used Python data analysis libraries. It implements the conjugate likelihood-prior pairs cataloged in [Fink's compendium](https://www.johndcook.com/CompendiumOfConjugatePriors.pdf) and [Wikipedia's conjugate prior table](https://en.wikipedia.org/wiki/Conjugate_prior), making rigorous Bayesian updating, exploration, and visualization accessible for practitioners, educators, and researchers.
14
+
15
+
### Why Conjugate Priors?
16
+
17
+
A prior distribution is conjugate to a likelihood when the posterior remains in the same distribution family after observing data. Conjugate priors provide closed-form posterior updates and posterior predictive distributions, eliminating the need for numerical integration or MCMC sampling. Because these updates are analytic rather than iterative, **posterior computation is instantaneous regardless of data size**—enabling real-time interactive exploration and rapid model iteration.
18
+
19
+
### Key Benefits
20
+
21
+
- ⚡ **Instant Updates:** No MCMC or optimization required—posterior computation is immediate
22
+
- 🔢 **Vectorized Operations:** Batch inference for multi-arm problems without explicit loops
23
+
- 📊 **Built-in Visualization:** Plot priors, posteriors, and predictive distributions
24
+
- 🔗 **SciPy Integration:** Direct access to scipy.stats distributions via `.dist` property
25
+
- 📦 **Data Library Support:** Works seamlessly with numpy, pandas, polars, and general array-like objects
26
+
- 🪶 **Lightweight Dependencies:** Minimal requirements—no heavy ML frameworks or complex toolchains
27
+
28
+
### Lightweight & Easy to Install
29
+
30
+
With minimal dependencies from the scientific Python stack, `conjugate-models` installs quickly without requiring heavyweight probabilistic programming frameworks, MCMC samplers, or complex compilation toolchains.
11
31
12
32
## Installation
13
33
@@ -19,7 +39,7 @@ pip install conjugate-models
19
39
20
40
-[Interactive Distribution Explorer](https://williambdean.github.io/conjugate/explorer) for exploring probability distributions with real-time parameter adjustment
21
41
-**[Raw Data Workflow](https://williambdean.github.io/conjugate/examples/raw-data-workflow)** - Complete examples from raw observational data to posterior distributions with helper functions
22
-
-**Data Input Helper Functions** - Extract sufficient statistics from raw observational data for all supported models
42
+
-**[Data Input Helper Functions](https://williambdean.github.io/conjugate/helpers)** - Extract sufficient statistics from raw observational data for all supported models
23
43
-[Connection to Scipy Distributions](https://williambdean.github.io/conjugate/examples/scipy-connection) with `dist` attribute
24
44
-[Built in Plotting](https://williambdean.github.io/conjugate/examples/plotting) with `plot_pdf`, `plot_pmf`, and `plot_cdf` methods
25
45
-[Vectorized Operations](https://williambdean.github.io/conjugate/examples/vectorized-inputs) for parameters and data
@@ -38,9 +58,11 @@ Many likelihoods are supported including
38
58
-`Normal` (including linear regression)
39
59
- and [many more](https://williambdean.github.io/conjugate/models/)
40
60
61
+
See the [Quick Reference](https://williambdean.github.io/conjugate/quick-reference) for a complete table of likelihood → prior/posterior mappings with links to model functions and helper functions.
62
+
41
63
## Basic Usage
42
64
43
-
### Working with Pre-processed Data
65
+
### Pattern 1: Working with Pre-processed Data
44
66
45
67
1. Define prior distribution from `distributions` module
46
68
1. Pass data and prior into model from `models` modules
0 commit comments