Brief
Real data rarely comes labelled with its distribution. Waiting times might be exponential, gamma or Weibull. File sizes might be lognormal. In this project you fit each candidate to real data, put error bars on every parameter, and let the numbers pick a winner.
The fitting rule is maximum likelihood. Given data and a model with density , choose the that maximises the log-likelihood . For the exponential with rate , , which peaks at . Gamma and Weibull have no such formula, so you climb the log-likelihood with the optimisers you already have.
The shape of the peak tells you how sure to be. A sharp peak means small error bars. The standard errors are approximately the square roots of the diagonal of , the inverse of the negative Hessian at the optimum. To compare models with different numbers of parameters, use AIC, which adds a penalty of 2 per parameter to .
DATA · a public real-world dataset
Objectives
Read-only. Log in to update progress.
VICTORY CONDITIONS
- Fitted parameters for all four candidates match scipy.stats (expon, lognorm, gamma, weibull_min with floc=0) within 1e-4 relative. Record the worst gap with `python tools/mlarena.py record BM-27 "<max relative difference>"`.
- Your Hessian standard errors match λ̂/√n for the exponential to 1e-6, and agree with a 1,000-resample bootstrap within 10% for the others.
- The report names a winner by AIC, shows its QQ plot, and says where it still fits badly.
Side quests
Terms in plain words
- Likelihood
- The probability (or density) of the data you actually saw, viewed as a function of the model's parameters.
- Maximum likelihood estimate (MLE)
- The parameter values that make the observed data most probable. In practice you maximise the log-likelihood, which turns a product into a sum.
- Fisher information
- How sharply the log-likelihood curves around its peak. More information means a narrower peak and a more precise estimate.
- Standard error
- The typical error of an estimate. For an MLE it is approximately the square root of the diagonal of the inverse of the negative Hessian at the peak.
- AIC
- Akaike's information criterion, 2k − 2·(max log-likelihood) for a model with k parameters. Lower is better; the 2k term charges for extra parameters.