Chi-Square Goodness-of-Fit Test
Study guide: Exam MAS-I
The Chi-Square Goodness-of-Fit Test checks whether a sample came from a hypothesized distribution by sorting the observations into k cells and comparing each cell's observed count O_j with the count E_j the model predicts. Large discrepancies give a large statistic Q and lead to rejecting the model, so it is a right-tailed hypothesis test.
Q = \sum_{j=1}^{k} \frac{(O_j - E_j)^2}{E_j}
E_j = n\,p_j = n\left[F(c_j) - F(c_{j-1})\right]
Q \ \dot\sim\ \chi^2_{\,k-1-r} \quad \text{under } H_0
nis the sample size,p_jthe model probability of cellj(from the CDFFat the cell boundariesc_{j-1} < c_j), andris the number of parameters estimated from the data. RejectH_0at level\alphawhenQexceeds the upper-\alphacritical value of the chi-squared distribution withk - 1 - rdegrees of freedom.- Degrees of freedom. One is lost because the counts must sum to
n; one more is lost for each estimated parameter. A fully specified model (r = 0) hask - 1; a Poisson with\lambdaestimated, on four cells, has4 - 1 - 1 = 2. - Large-sample rule of thumb: the chi-squared approximation needs every
E_j \ge 5; combine sparse cells (usually in the tail) until it holds. - The value of
Qdepends on how the cells are chosen, and the test works for discrete models such as the Poisson and binomial as well as for binned continuous data. The Kolmogorov–Smirnov and Anderson–Darling tests are the alternatives for ungrouped continuous data. - Test of independence. The same statistic on a
k \times mcontingency table, withE_{ij} = (\text{row } i \text{ total})(\text{column } j \text{ total})/n, tests whether two classifications are independent, on(k-1)(m-1)degrees of freedom.
Claim Counts Against a Fully Specified Size Distribution An insurer's pricing model says that 50% of claims are under $1,000, 30% are $1,000–$5,000, 15% are $5,000–$25,000 and 5% exceed $25,000. Last year's 400 claims fell 186, 132, 58 and 24 into these bands. Test the model at the 5% level.
Answer The expected counts are
400 \times (0.50, 0.30, 0.15, 0.05) = (200, 120, 60, 20), all at least 5:\begin{align*} Q &= \frac{(186-200)^2}{200} + \frac{(132-120)^2}{120} + \frac{(58-60)^2}{60} + \frac{(24-20)^2}{20} \\ &= 0.980 + 1.200 + 0.067 + 0.800 \\ &= 3.05 \end{align*}No parameters were estimated, so there are
4 - 1 = 3degrees of freedom and the critical value is\chi^2_{0.05,\,3} = 7.81. Since3.05 < 7.81, do not reject — the pricing model's size bands are consistent with the year's claims.
Testing a Fitted Poisson Frequency Model Of 500 policies, 260 had no claims, 190 had one, 40 had two and 10 had three (none had more). Fit a Poisson by maximum likelihood and test it at the 5% level using the cells
0, 1, 2, 3{+}.Answer The MLE is the sample mean,
\hat\lambda = (190 + 2 \cdot 40 + 3 \cdot 10)/500 = 0.6. The Poisson probabilities are0.5488, 0.3293, 0.0988, leaving0.0231for3{+}, so the expected counts are274.41, 164.64, 49.39, 11.56:\begin{align*} Q &= \frac{(260-274.41)^2}{274.41} + \frac{(190-164.64)^2}{164.64} + \frac{(40-49.39)^2}{49.39} + \frac{(10-11.56)^2}{11.56} \\ &= 0.756 + 3.905 + 1.786 + 0.210 \\ &= 6.66 \end{align*}One parameter was estimated, so there are
4 - 1 - 1 = 2degrees of freedom and\chi^2_{0.05,\,2} = 5.99. Since6.66 > 5.99, reject the Poisson model at 5% (but not at 2.5%, where the critical value is7.38). Forgetting to subtract the estimated parameter would have compared6.66with\chi^2_{0.05,\,3} = 7.81and wrongly kept the model: the policies show more one-claim risks than a single Poisson rate allows.