Contents
Contents
Tap any chapter to start reading.
Chapter 1 Pandas Foundations
Series and DataFrames end-to-end: indexes, alignment, missing values, selection, filtering with .loc/.iloc/query, groupby, joins, and method chaining.
From raw closing prices to portfolio diagnostics: simple and log returns, equity curves, resampling, rolling stats, volatility (√T scaling), drawdowns, Sharpe, cross-asset correlation, and volatility drag.
Chapter 3 Simple Linear Regression and CAPMFitting, inference, residual diagnostics, and the canonical risk model. Train/test, t-stats, and the meaning of R² in finance.
Chapter 4 Multi-factor and Beta ModelsMultiple regression, Fama–French factors, multicollinearity, partial F-tests, and the use of beta models for attribution and hedging.
Chapter 5 Alpha Models and Machine LearningFrom predictions to decisions: regularized regression, gradient boosting, walk-forward validation, the Information Coefficient, and a complete cross-section alpha lab.
Appendix A A Minimum of Linear AlgebraJust enough vectors, matrices, transpose, inverse, and matrix multiplication to read the OLS formula and the Ridge/LASSO chapters. Written for students with no prior linear-algebra exposure.
Appendix B Solutions to ExercisesComplete worked solutions for every exercise in Chapters 1–5 and Appendix A — restated question, prose explanation, running Pyodide code, and a note on the common pitfall.