Lumenary Scientia
Lumenary Statistics
Statistics from averages and charts to Bayesian computation, causal inference and the statistics of AI in 2026: statistical thinking, models, modern inference, advanced methods and the frontier.
Lumenary Statistics is a subject of Lumenary Scientia, free and open source like the others. Statistics is the science of learning from data in the presence of variation and uncertainty — a discipline of its own, with its own questions and habits of mind, not just a branch of mathematics. The course starts with no experience at all — what an average hides and how graphs mislead — and climbs through distributions and sampling, estimation and testing, regression and experimental design, Bayesian and computational inference, causal inference, time series, survival and multilevel models, to the statistics of machine learning and AI as practised in 2026.
Every lesson teaches with ideas first and calculation second. Simulations and analyses are in Python with NumPy and SciPy (pandas where data tables help), and every block with a Run in browser button runs there, with nothing to install. A lesson says Code tested only when all of its code passed. Lumenary Statistics relies on Lumenary Math for probability and links to its lessons; Lumenary CS's Data Science elective puts these methods to work.
Every lesson was drafted with AI assistance and is awaiting review by a human statistician. The text, exercises and code are original and licensed CC BY-SA 4.0 (code Apache-2.0). Where a statistical society, agency or research group has published the primary source, the lesson links to it rather than retelling it.
- Chloe · The Statistician
“What question are we really asking?” - Margaret · The Simulator
“What happens if we try it ten thousand times?” - Gideon · The Sceptic
“What does this assume, and could it be chance?”
Start · 5 lessons
Making sense of data
No experience needed, from about age 11. What statistics is for, describing data with numbers and pictures, chance and probability, samples and surveys, and how statistics can mislead.
- 1What is statistics?Questions that data can answer, why no two measurements agree, and the people who changed the world by counting carefully. 40 min
- 2Describing dataKinds of data, the mean, median and mode (and when each one misleads), measures of spread, and the four charts every statistician draws first. 50 min
- 3Chance and probabilityProbability as what happens in the long run, coins and dice simulated by the hundred thousand, why no result is ever "due", and how to work out whether a game is fair. 50 min
- 4Samples and surveysHow a thousand well-chosen people can speak for millions, why a million badly chosen ones cannot, what a margin of error really measures, and what famous polling failures teach. 50 min
- 5How statistics can misleadStretched axes and cherry-picked years, correlation that isn't causation, medical tests and base rates, averages of averages, and how to read a news headline about a study. 55 min
Foundations · 5 lessons
Statistical thinking
The core ideas of inference: distributions, sampling distributions and the central limit theorem, estimation and confidence intervals, hypothesis testing, and comparing groups.
- 6DistributionsRandom variables and the four workhorse distributions — binomial, Poisson, normal and exponential — with the stories that produce them, and the habit of checking every formula by simulation. 60 min
- 7Sampling distributions and the central limit theoremEvery statistic varies from sample to sample. How much it varies is the standard error; why its distribution is so often normal is the central limit theorem; and when that theorem is slow, the simulation will tell you. 60 min
- 8Estimation and confidence intervalsFrom a sample to a range of plausible values — estimators and their errors, what "95% confidence" really promises (checked by simulation), the bootstrap, and how many observations to collect. 65 min
- 9Hypothesis testingCould it be chance? The logic of significance tests, what a p-value is and is not, type I and II errors and power computed by simulation, effect sizes, and why "not significant" never means "no effect". 70 min
- 10Comparing groupsWelch's and paired t-tests, proportions and chi-squared tests, rank and permutation tests — and choosing the test by the design of the study, not by trying them all. 70 min
Modelling · 5 lessons
Statistical models
Models that relate variables: linear and multiple regression, generalised linear models, experimental design and analysis of variance, and likelihood and model selection.
- 11Linear regressionFitting a straight line by least squares, reading what its slope and intercept say, measuring how sure we are, and the two classic traps, regression to the mean and extrapolation. 70 min
- 12Multiple regression and diagnosticsSeveral predictors at once, what "holding the others fixed" really means, categorical predictors and interactions, collinearity, the residual checks that keep a model honest, and Simpson's paradox. 75 min
- 13Generalised linear modelsRegression for yes-or-no outcomes and counts — logistic regression fitted by Newton's method, odds ratios, Poisson regression with exposures, link functions, deviance, and what to do when counts vary more than the model allows. 75 min
- 14Experimental design and analysis of varianceWhy randomise, how control, replication and blocking buy precision, one-way and factorial analysis of variance computed from scratch, randomised trials in fields and hospitals, and how many units an experiment needs. 75 min
- 15Likelihood and model selectionThe likelihood function as the common thread of statistical models — maximum likelihood by numerical optimisation, likelihood-ratio tests, AIC, BIC and cross-validation, overfitting seen in action, and what parsimony can and cannot promise. 80 min
Inference · 4 lessons
Modern inference
How statisticians reason today: Bayesian inference, Markov chain Monte Carlo, resampling and simulation, and multiple testing and reproducibility.
- 16Bayesian inferenceUnknown parameters treated as uncertain quantities — priors, likelihoods and posteriors, the beta–binomial model by hand and by computer, credible intervals, prior sensitivity, and a fair account of the Bayesian and frequentist views. 70 min
- 17Markov chain Monte CarloComputing with a posterior you can only write down up to a constant — the Metropolis–Hastings algorithm built from scratch, the diagnostics that tell you whether to trust it, and Hamiltonian Monte Carlo as Stan and PyMC use it. 75 min
- 18Resampling and simulationLetting computation stand in for formulas — the bootstrap in depth, permutation tests, cross-validation as resampling, Monte Carlo studies that test methods where the truth is known, and the cases where resampling fails. 75 min
- 19Multiple testing and reproducibilityWhy testing many hypotheses manufactures false discoveries, how Bonferroni, Holm and Benjamini–Hochberg control them, how flexible analyses do the same damage out of sight, what the large replication projects found, and the practices that make results trustworthy. 75 min
Advanced · 5 lessons
Advanced methods
Methods for the questions real data raise: causal inference, time series, survival analysis, multilevel models, and high-dimensional statistics.
- 20Causal inferenceWhat would have happened otherwise? Potential outcomes, randomisation, causal diagrams, propensity scores, and the natural experiments that won the 2021 economics Nobel prize. 80 min
- 21Time seriesData in order — trend, seasonality and noise; autocorrelation and stationarity; AR, MA and ARIMA models; exponential smoothing; and how to judge a forecast honestly. 75 min
- 22Survival analysisHow long until something happens, when some stories have not finished yet — censoring, the Kaplan–Meier estimator, the log-rank test, hazards and the Cox model, in medicine and engineering. 70 min
- 23Multilevel modelsPupils in schools, patients in hospitals, measurements in people — partial pooling, shrinkage, and why grouped data need models that know about the groups. 70 min
- 24High-dimensional statisticsWhen there are more variables than observations — ridge and the lasso, the bias–variance trade-off, principal components, thousands of tests at once, and the problem of inference after selection. 80 min
Frontier · 5 lessons
The frontier of statistics
Where statistics meets machine learning and society in 2026: statistical learning theory, conformal prediction, causal machine learning, the statistics of evaluating AI, and privacy and official statistics.
- 25Statistical learning theoryWhy fitting the past can predict the future — risk and its decomposition, uniform convergence and the VC dimension, double descent demonstrated, and an honest account of what theory does and does not yet explain about deep learning. 80 min
- 26Conformal predictionPrediction intervals and prediction sets that hold their promised coverage for any model and any distribution, with one assumption — exchangeability — and what to do when it fails. 75 min
- 27Causal machine learningFlexible models in the service of causal questions — heterogeneous treatment effects, double/debiased machine learning with cross-fitting, causal forests, uplift modelling and sensitivity analysis, and where these methods are used and misused. 80 min
- 28The statistics of evaluating AIBenchmarks are samples and scores are estimates — confidence intervals with clustered questions, pass rates done right, fair paired comparisons, the winner's curse and contamination, human and model judges, and how to combine them. 80 min
- 29Privacy and official statisticsWhy trustworthy public numbers matter, how censuses count everyone, how published tables can reveal individuals, and how differential privacy — including its use in the 2020 US census — trades a little accuracy for a provable promise of confidentiality. 80 min
Further reading and resources
- OpenIntro Statistics · David Diez, Mine Çetinkaya-Rundel and Christopher BarrA free, openly licensed introductory statistics textbook.
- Royal Statistical SocietyThe UK's statistical society, with resources on statistical literacy.
- American Statistical AssociationIncluding its 2016 statement on p-values.
- International Statistical Institute
- MIT OpenCourseWare: Mathematics (statistics and probability courses)Free lecture notes and problem sets.