I wrote a free, open-source book: "Advanced Methods in SciPy and Statsmodels"
SciPy and statsmodels documentation tells you how to call a function. This book tells you what that function does and why it works.
23 chapters covering optimization, Monte Carlo methods, likelihood inference, time series, survival analysis, and causal inference — each with:
- The mathematical theory explaining WHY the method works (not just the formula — the intuition that changes how you think about it)
- From-scratch Python implementations verified against the library output
- Diagnostics showing how to detect when the method fails
- 92 exercises with full worked solutions
The book fills the gap between "read the docs" and "read the textbook." If you've ever wondered why scipy.optimize.minimize defaults to BFGS, why statsmodels uses HC1 for robust standard errors, why the bootstrap fails for the sample maximum, or why two-way fixed effects gives wrong answers under staggered adoption — this book explains it with code you can run.
147,000 words. All code executes in a pinned Python environment. Free to read online, source on GitHub.
Read it: https://kundeng.github.io/bayeslearner-scikit-refresh/ Source: https://github.com/kundeng/bayeslearner-scikit-refresh