goodness-of-fit tests (chi-square, Kolmogorov-Smirnov)
/ GOOD-ness uv fit; KY-square; kol-MOG-or-off SMEER-noff /
You have fitted a tidy mathematical curve — say a bell shape or an exponential decay — to your messy real data. The natural next question is: does the curve actually fit, or is it kidding itself? Goodness-of-fit tests answer this. They compare what your chosen distribution predicts against what the data actually did, and measure how badly the two disagree, turning 'eyeballing the histogram' into a number with a p-value.
The chi-square test works on grouped data: bin the observations, compare the observed count in each bin with the count the fitted model expects, and add up the squared gaps scaled by the expected counts. If the total is large, the fit is poor. The Kolmogorov-Smirnov (KS) test works on the cumulative curve instead: it finds the single largest vertical gap between the data's step-function CDF and the fitted smooth CDF, and asks whether a gap that big is plausible by chance. Roughly, chi-square asks 'do the bin frequencies line up?' while KS asks 'does the whole shape track, especially in the body?' Each turns into a p-value via its own reference distribution.
For actuaries these tests are the standard gatekeepers when fitting loss-severity and claim-frequency distributions: before trusting a fitted Pareto or lognormal to set reserves or reinsurance layers, you check that it actually describes the data. The honest caveats are important. With small samples the tests have weak power and rarely reject anything; with huge samples they reject almost every model, because no tidy curve perfectly matches reality. KS is known to be insensitive in the tails — exactly where heavy-tailed insurance losses matter most — so actuaries supplement it with tail-focused diagnostics rather than trusting a single p-value.
An actuary fits a Poisson to the number of claims per policy. The chi-square test compares the observed count of policies with 0, 1, 2, ... claims against the Poisson's predicted counts; a small p-value would say the Poisson is the wrong frequency model.
Chi-square pits observed bin counts against the counts a fitted model expects.
Failing to reject does not prove the model is correct, and with enough data every model gets rejected. KS in particular is weak in the tails, which is where insurance losses hurt most.