Why Categories Must Be Built Carefully
A chi-square goodness-of-fit setup compares observed counts with counts expected under a model. Before those counts can be compared, the possible losses must be organized into categories. The categories need to cover the relevant outcome space without overlapping: every observation belongs to one category, and only one.
For a continuous severity model, categories are commonly intervals, including lower and upper tail intervals. For a discrete model, categories may consist of individual values or groups of values. In either case, the model assigns a probability to each category; multiplying that probability by the sample size gives the category’s expected count.
The expected count \(E_j\) is not the count actually observed in the data. The observed count records how many sample losses fall in \(C_j\); the expected count is determined by the fitted model and the sample size. This tutorial focuses on constructing the categories and calculating their probabilities and expected counts, not on calculating a test statistic.
From a Loss Model to Category Probabilities
Suppose \(X\) is a loss with cumulative distribution function \(F_X(x)=P(X\le x)\) and survival function \(S_X(x)=P(X>x)\). If \(X\) is continuous, the probability of a finite interval \([a,b)\) is
For a continuous distribution, including or excluding a single finite endpoint does not change the probability, because \(P(X=a)=0\). The interval notation still needs to define categories consistently, especially when categories are listed in a table. For example, \([0,c)\) and \([c,\infty)\) are disjoint and together cover all nonnegative losses.
For a discrete distribution, a single value can have positive probability. Boundary conventions therefore matter: the probability of \(X\le c\) includes the mass at \(c\), while the probability of \(X>c\) does not. Category probabilities should be computed by summing the probability masses of the values included in each category.
Why Expected Counts Equal \(np_j\)
The expected-count formula follows directly by representing category membership with indicator variables. For observation \(r\), define \(I_{rj}=1\) if its loss falls in \(C_j\), and \(I_{rj}=0\) otherwise. The observed count in category \(j\) is the sum of these indicators.
Each indicator has expectation \(E[I_{rj}]=1\cdot p_j+0\cdot(1-p_j)=p_j\). By linearity of expectation,
This expectation calculation does not require the category indicators to be independent of one another across categories for the same observation. They cannot be: one observation belongs to exactly one category. It does rely on each of the \(n\) observations having the same category probability \(p_j\). If the observations have different distributions or are included under a truncation rule, the relevant probabilities must reflect that sampling setup.
Worked Example: Two Categories Under a Fitted Exponential Model
A hypothetical portfolio has \(n=80\) observed losses. An exponential severity model with fitted mean \(\theta=50\) dollars is used to calculate expected category counts. Form two categories, losses below \$50 and losses of at least \$50. Find both category probabilities and expected counts. Treat the fitted model as given; each observed loss is assumed independent and to follow this model.
Method. For an exponential loss with mean \(\theta\), \(S_X(x)=e^{-x/\theta}\) for \(x\ge0\), and \(F_X(x)=1-e^{-x/\theta}\). The categories are \([0,50)\) and \([50,\infty)\), so they are disjoint and cover all nonnegative losses. Since the model is continuous, assigning the boundary at 50 to either category would not change the probabilities.
For the first category,
For the second category,
The probabilities sum to \(0.6321206+0.3678794=1.0000000\), as required. The expected counts are
Rounded to two decimal places, the expected counts are 50.57 and 29.43. Their sum is \(80.00\), which checks that the entire sample has been allocated. A common mistake is to assume that a cutoff at the mean divides an exponential distribution into equal halves. It does not: the probabilities here are approximately 0.6321 and 0.3679, not 0.5000 and 0.5000.
Several Continuous Categories, Including the Tail
With more than two categories, calculate each interval probability from the distribution function, or use the survival function for an upper tail. A useful check is that the probabilities across all categories sum to one before they are multiplied by \(n\). If they do not, a range may have been omitted, a boundary may have been counted twice, or a probability may have been evaluated incorrectly.
Worked Example: Three Categories Under an Exponential Model
A hypothetical insurer studies \(n=200\) independent losses using a fitted exponential model with mean \(\theta=100\) dollars. Use the categories \([0,50)\), \([50,150)\), and \([150,\infty)\). Calculate the probability and expected count for each category. Round expected counts to two decimal places.
Method. The fitted model has \(F_X(x)=1-e^{-x/100}\) and \(S_X(x)=e^{-x/100}\), for \(x\ge0\). For the first category,
For the middle interval, subtract the probability below 50 from the probability below 150:
For the upper tail, use the survival function:
The probability check gives \(0.3934693+0.3834005+0.2231302=1.0000000\), up to displayed precision. Multiplying each probability by \(n=200\) gives
Thus the expected counts, rounded to two decimal places, are 78.69, 76.68, and 44.63. They sum to 200.00. The common error to avoid is calculating the middle category as \(F_X(150)\) alone: that includes all losses below 50 as well as losses from 50 to 150.
Categories for a Discrete Loss Model
For a discrete severity model, categories may group multiple possible loss amounts. The probability of a group is the sum of the probabilities of its included values. It is often convenient to use the survival function for a final category that contains all values from a threshold upward, but the threshold’s inclusion must match the category definition.
Worked Example: Grouping Values Under a Geometric Loss Model
A hypothetical product has integer-valued losses \(X=1,2,\ldots\). Under a fitted geometric model, \(P(X=k)=0.4(0.6)^{k-1}\) for \(k\ge1\). For \(n=150\) independent losses, use categories \(\{1\}\), \(\{2,3\}\), and \(\{4,5,\ldots\}\). Find the probabilities and expected counts.
Method. The first category contains only \(X=1\), so \(p_1=0.4\). For the second category, add the masses at 2 and 3:
The final category contains \(X\ge4\). Its probability is the remaining probability, or equivalently the geometric tail:
As a check, \(0.4+0.384+0.216=1\). The expected counts are
The counts sum to \(150\), as they should. The common mistake is to calculate the last category as \(P(X>4)\), which would exclude \(X=4\). The category is \(X\ge4\), so its probability includes the mass at 4; using the complement \(1-P(X\le3)\) makes that inclusion explicit.
When the Observed Losses Are Truncated
The model probability used for an expected count must match the population from which the observations were sampled. If losses are observed only when \(X>a\), then the recorded sample is conditional on exceeding \(a\). Using unconditional category probabilities would allocate expected counts to outcomes that could not appear in the recorded data.
For an original loss model with survival function \(S_X\), and a category \(C\) contained in \(X>a\), the appropriate probability among observed losses is
This formula follows from conditional probability because \(C\) is contained in the event \(X>a\). The resulting conditional category probabilities should sum to one over a partition of the observable range. This adjustment is for truncation, where losses below the threshold are not in the sample; it is not the same as treating a known loss above the threshold as an incomplete or censored observation.
Worked Example: Conditional Categories Above an Observation Threshold
A hypothetical data set contains \(n=90\) losses, and only losses exceeding \$50 are recorded. The underlying severity model is exponential with mean \(\theta=100\) dollars. Partition the observed range into \(50<X\le150\) and \(X>150\). Calculate the conditional probabilities and expected counts, rounding counts to two decimal places.
Method. Since the sample is restricted to \(X>50\), calculate probabilities conditional on that event. For the first category,
For the upper category,
These conditional probabilities sum to one. The corresponding expected counts are
Rounded to two decimal places, the expected counts are 56.89 and 33.11, summing to 90.00. The trap is to use the unconditional probabilities \(P(50<X\le150)\) and \(P(X>150)\). Those probabilities describe all losses under the original model, not the losses in a sample where every recorded value already exceeds 50.
Checks Before Using the Category Counts
Before using the resulting expected counts in a goodness-of-fit calculation, verify the setup rather than relying only on arithmetic. In particular, identify the support of the model, specify every category boundary, and confirm that the probabilities correspond to the actual observation scheme.
- Check exclusivity. No value should be assigned to two categories. For continuous intervals, conventions such as \([a,b)\) and \([b,c)\) avoid overlap at a shared boundary.
- Check coverage. Every modeled outcome that can appear in the sample should be included. A final tail category is often needed.
- Check the probability total. The category probabilities should sum to one, subject only to rounding.
- Check the sample basis. Use unconditional probabilities for an untruncated sample and conditional probabilities when the sample is restricted to a specified range.
- Check the counts. Expected counts should sum to \(n\), apart from small rounding differences.
Check Your Understanding
For each problem, identify the category probabilities before calculating expected counts. Answers are rounded as stated.
- A hypothetical sample has \(n=50\) independent losses from an exponential model with fitted mean \(\theta=40\) dollars. Categories are \(X<40\) and \(X\ge40\). Find the probabilities and expected counts. (Answer: probabilities 0.6321 and 0.3679; expected counts 31.61 and 18.39.)
- A hypothetical sample of \(n=120\) losses follows a fitted exponential model with mean \(\theta=75\) dollars. Use categories \([0,75)\), \([75,225)\), and \([225,\infty)\). Give probabilities to four decimal places and expected counts to three decimals. (Answer: probabilities 0.6321, 0.3181, 0.0498; expected counts 75.854, 38.171, 5.975.)
- Under a fitted geometric model \(P(X=k)=0.25(0.75)^{k-1}\), \(k\ge1\), a hypothetical sample contains \(n=160\) independent losses. Use categories \(\{1,2\}\), \(\{3,4,5\}\), and \(\{6,7,\ldots\}\). Give expected counts to three decimal places. (Answer: category probabilities 0.4375, 0.3252, 0.2373; expected counts 70.000, 52.031, 37.969.)
- A hypothetical sample of \(n=100\) independent losses follows a fitted normal model \(X\sim N(100,20^2)\), where 20 is the standard deviation. Use categories \(X<80\), \(80\le X\le120\), and \(X>120\). Give expected counts to two decimal places. (Answer: probabilities approximately 0.1587, 0.6827, 0.1587; expected counts approximately 15.87, 68.27, 15.87.)
- A hypothetical sample includes only losses exceeding 50 dollars, with \(n=90\). The underlying model is exponential with mean \(\theta=100\) dollars. Partition the recorded losses into \(50<X\le150\) and \(X>150\). Find conditional probabilities and expected counts to two decimal places. (Answer: conditional probabilities 0.6321 and 0.3679; expected counts 56.89 and 33.11.)