27 tutorials· Ordered reading path
Bayesian inference lets you update beliefs as evidence arrives. This path starts with the frequentist baseline (MLE), shows why Bayesian thinking is a natural extension, then builds toward real-world probabilistic models.
You will implement Metropolis-Hastings samplers, fit mixture models with EM, build Gaussian process regressors, and run hierarchical regressions in PyMC. Each tutorial is self-contained but follows a clear progression.
Build MLE from scratch in NumPy and SciPy across Bernoulli, Normal, and Multinomial: why we use log-likelihood, and how MLE connects to the EM algorithm.
Fit a GARCH model in Python with NumPy and SciPy, verify it against arch, and compare volatility forecasts with EWMA on pinned S&P 500 returns.
Implement the Kelly criterion in Python. Simulate uncertain returns, compare fractional Kelly and inspect a GARCH allocation with explicit costs.
Entropy, KL divergence and mutual information from first principles, with mode-seeking vs mean-seeking Python demos.
Bridge from Maximum Likelihood to Bayesian inference using the Beta-Binomial conjugate pair. Priors, posteriors, and why a 99% accurate test can be wrong.
AIC vs BIC explained: build both information criteria from scratch, see why they penalise complexity differently, and when to use each for model selection.
How Bayesian model comparison uses the marginal likelihood to pick model complexity: Bayes factors, BIC, AIC, and a polynomial regression demo in Python.
Hands-on guide to Monte Carlo sampling: inverse-CDF, Box-Muller, rejection, and importance sampling, with Python code, animations, and a decision matrix.
The Metropolis-Hastings algorithm through the island hopping analogy. Proposal distributions, acceptance ratios, and why random walks recover any target.
Gibbs sampling exploits conditionals; slice sampling adapts step size. Both cure random-walk Metropolis on correlated targets, with Python and animations.
Hamiltonian Monte Carlo in Python, built from the leapfrog up. It beats random-walk Metropolis 41 to 1 on a correlated target, and an 11% bigger step costs 18x.
Build a Metropolis-Hastings sampler from scratch to infer hidden regimes in earthquake data. Full posterior distributions instead of point estimates.
Learn the Expectation-Maximisation algorithm through the classic two-coin problem. Understand soft assignments, weighted MLE, and why EM always converges.
Implement Gaussian Mixture Models from scratch using the EM algorithm. Cluster Old Faithful eruptions and understand responsibilities and convergence.
Derive variational Bayesian linear regression in NumPy, compare it to PyMC NUTS on the same dataset, and watch the lower bound pick the true polynomial degree.
Build a variational autoencoder from scratch in NumPy with hand-derived gradients. Measure what the KL term buys: without it the model can only generate 3 of 10 digits.
Build a diffusion model from scratch in NumPy with hand-derived gradients. Measured over three seeds: DDIM's deterministic sampler is not worse on average, it is unreliable.
Gaussian process regressor from scratch in NumPy. How kernels encode smoothness, posteriors collapse with data, and GPs power Bayesian optimisation.
Turn a point-estimate MLP into a Bayesian neural network with the Laplace approximation and the evidence framework. Fit a GELU net with error bars.
Build a relevance vector machine from scratch. The RVM gives sparser, calibrated alternatives to the SVM via ARD priors and evidence maximisation.
Split conformal prediction in Python delivers exactly the coverage you ask for. Measured per class it gives 95% on the common ones and 29% on the rare.
Probabilistic PCA as a latent variable model. EM-PCA, Bayesian PCA with ARD that picks dimensionality automatically, and Factor Analysis. From scratch in NumPy.
Build a Bayesian network in pgmpy from a toy lung-cancer dataset. Parameter learning, d-separation, structure search, causality.
Detect regime shifts in real time with BOCD. Track posterior probabilities on S&P 500 data, choose your detection threshold, and compare with offline PELT.
Hierarchical Bayesian regression in PyMC for insurance claim severity across policy types. Partial pooling, shrinkage, and MCMC diagnostics with ArviZ.
One-Inflated Beta regression in PyMC with a custom log-likelihood for loan data. Handle boundary spikes, write Beta densities, and interpret with ArviZ.
Bayesian accelerated failure time model in PyMC for customer churn. Censored data with pm.Potential, Weibull vs Log-Logistic, and ArviZ survival curves.
Calculate posterior probabilities with interactive visualisation. Includes classic presets (medical tests, spam filtering) and sequential evidence updates.
Try itInteractive probability distribution calculators. Visualise Normal, Binomial, Poisson, Beta, and 12 more distributions with live PDF/CDF charts.
Try itEditable transition matrices, stationary distribution computation, and convergence simulation with stacked area charts.
Try itGet notified when new tutorials and deep-dives are published. No spam, unsubscribe anytime.
Common questions about this topic