Testing Continuous Uniform Models Using Chi-Square Goodness-of-Fit

Apply the chi-square goodness-of-fit test to assess whether a continuous sample is consistent with a fully specified Uniform(a,b) distribution by binning the data into equal-width subintervals, computing expected counts, and comparing the test statistic to a critical value with k-1 degrees of freedom.

Step 1 of 119%

Tutorial

Discretizing a Continuous Uniform Distribution

The chi-square goodness-of-fit test compares observed counts to expected counts in kk categories. To apply it to a continuous distribution, we first need to discretize the data by partitioning the sample space into bins.

To test whether a sample X1,X2,,XnX_1, X_2, \ldots, X_n comes from Uniform(a,b),\text{Uniform}(a,b), partition the interval [a,b][a,b] into kk equal-width subintervals

[a,  a+bak),  [a+bak,  a+2(ba)k),  ,  [a+(k1)(ba)k,  b]\Big[a,\; a+\tfrac{b-a}{k}\Big),\; \Big[a+\tfrac{b-a}{k},\; a+\tfrac{2(b-a)}{k}\Big),\; \ldots,\; \Big[a+\tfrac{(k-1)(b-a)}{k},\; b\Big]

and let OiO_i denote the number of observations falling into the ii-th bin.

Under H0:XUniform(a,b),H_0: X \sim \text{Uniform}(a,b), every equal-width subinterval has the same probability:

P(Xbini)=1k.P(X \in \text{bin}_i) = \frac{1}{k}.

Therefore the expected count in each bin is

Ei=n1k=nk.E_i = n \cdot \frac{1}{k} = \frac{n}{k}.

For instance, with n=60n = 60 observations partitioned into k=4k = 4 equal-width bins on [0,8],[0,8], the expected count in each bin is Ei=60/4=15.E_i = 60/4 = 15.

navigate · Enter open · Esc close · ⌘K/Ctrl K toggle