Value at Risk (VaR) is the most widely used measure of market risk in finance. It answers a simple question: What is the worst loss I can expect over a given horizon with a certain confidence level? For example, a 1-day 99% VaR of $1M means that, on average, only 1 out of 100 days should see a loss exceeding $1M.
But VaR is only useful if it actually captures real losses at the claimed frequency. This is where backtesting comes in: we check whether the number of exceedances (days when losses exceeded the VaR forecast) matches the confidence level.
In this post, we implement three VaR estimation methods from scratch in NumPy:
Historical VaR — ranking past returns and picking the quantile Parametric (Delta-Normal) VaR — assuming returns are normally distributed Monte Carlo VaR — simulating future paths from a calibrated model We then backtest each method against a known portfolio and verify that the coverage rates match the claimed confidence levels.
Traditional Mean-Variance Optimization (Markowitz) is famous for producing extreme, unstable portfolio weights: tiny changes in expected returns or the covariance matrix move the allocation dramatically. The Black-Litterman model attacks that from an unexpected direction — instead of improving the return estimates, it changes where they come from: start from market equilibrium and treat your own views as noisy Bayesian evidence around it.
In this post we implement Black-Litterman from scratch in NumPy, and verify three things: that naive mean-variance really does collapse onto corner solutions, that Black-Litterman weights survive 200 bootstrapped re-estimations essentially unchanged, and — the part most demos skip — that the Black-Litterman portfolio actually has a higher Sharpe ratio out of sample, verified over 50 fresh simulated years.
Every quant accumulates a pile of bookmarks for research: squawk feeds, economic calendars, 13F screeners, data APIs, NLP papers. This is mine — cleaned up, tested this week, and reorganized into what a buy-side research workflow actually consumes: newswires first, releases second, data third, text-mining last. Every link was checked at the time of writing; links that are paywalled, login-gated, or bot-gated are marked as such, and the ones that died are in a graveyard section at the end so you don’t waste an afternoon the way I once did.
You simulate an AR(1) process with parameter ρ = 0.7 and compute its sample autocorrelation at lag 1. What value do you expect? The theoretical answer is simple: the lag-1 autocorrelation of an AR(1) process is exactly ρ. But how quickly does the sample autocorrelation converge to this value — and how noisy is the estimator at realistic sample sizes?
In this post, we derive the theoretical autocorrelation function of an AR(1) process, simulate it in NumPy, and verify both the point estimate and its dispersion against theory with a Monte-Carlo experiment.
You observe a system’s position every second with a noisy GPS sensor, but you need to know both position and velocity for control. You have a physics model (constant velocity) but the measurements are unreliable. How do you recover the true state?
The Kalman Filter answers this question: it estimates a system’s hidden state from noisy measurements, combining a prediction from a dynamic model with a correction from new measurements, weighted by their respective uncertainties.
In this post, we build a complete Kalman Filter from scratch in NumPy, verify it against a known ground-truth trajectory, and show exactly how much uncertainty it reduces compared to raw measurements.