A research calculation needs reproducible outputs and explicit failure conditions. This lab implements three deterministic NumPy checkpoints: an OLS / linear solve, a Cholesky (or eigenvalue) PSD check, and a Newton bond-yield root. Outputs appear as comments. One assertion checks a known analytic value from Least Squares and Regression Geometry.
Learning objectives. By the end of this note you should be able to:
- solve a small least-squares problem in NumPy and verify the normal equations;
- factor a PD covariance with Cholesky and confirm ;
- recover a par yield by Newton and match the known root;
- treat these blocks as templates for larger research code.
In this lesson
- Lab 1 — Least squares
- Lab 2 — Cholesky and eigenvalues
- Lab 3 — Newton bond yield
- How the three blocks connect
Before you start
- Least Squares and Regression Geometry
- Positive Definite Matrices
- Root-Finding and Numerical Integration
The full lesson, with worked examples and exercise solutions, is for members.
Read the full lessonNew to SelfMadeQuant.com? See membership options or browse the Linear Algebra, Optimisation and Numerical Methods syllabus.