Goodness of fit test

Used to test how well a proposed model (distribution) fits the observed data. The χ2 Chi-Squared Test is often a common choice for carrying out a goodness-of-fit test

Step 1. Estimate the parameter for the assumed distribution

Step 2. Compute the probability for each observation under the assumed distribution

Step 3. Compute the expected frequencies

Step 4. Test the goodness-of-fit of the assumed distribution to the observed data

Examples

Number of errors Observed frequencies fi Poisson probability with λ=3 Expected frequencies Ei
0 18
1 53
2 103
3 107
4 82
5 46
6 18
7 10
8 2
9 1

Step 1. Estimate the parameter for the assumed distribution
n=440,ixi=1341, the number of errors observed in the sample

λ^=x¯=xin=1341440=3.05

We test

H0:XPoisson(3)vsHa:XPoisson(3)

Could indicate that the estimate given is not good, or that the distribution doesn't fit

Step 2. Compute the probability for each observation under the assumed distribution

P(x=x)=eλλxx!=e33xx! under H0,x=0,,9
Number of errors Observed frequencies fi Poisson probability with λ=3 Expected frequencies Ei
0 18 0.0498
1 53 0.1494
2 103 0.2240
3 107 0.1680
4 82 0.1008
5 46 0.0504
6 18 0.0216
7 10 0.0081
8 2 0.0081
9 1 0.0038

Step 3. Compute the expected frequencies

Let Eij be the expected # of observations that make j errors among 440 observations

Number of errors Observed frequencies fi Poisson probability with λ=3 Expected frequencies Ei
0 18 0.0498 21.9
1 53 0.1494 65.7
2 103 0.2240 98.6
3 107 0.1680 98.6
4 82 0.1008 73.9
5 46 0.0504 44.4
6 18 0.0216 22.2
7 10 0.0081 9.5
8 2 0.0081 3.6
9 1 0.0038 1.7
10 0
...

Step 4.de
Test the goodness-of-fit of the Poisson distribution to the observed data

H0:XPoisson(3)vsHa:XPoisson(3)

under H0:

χ2=i=08(fiEi)2Eiχmt12=χ72

df= number of groups - number of unknown parameters

Reject H0 if

χobs2χ7,0.952=14.067χobs2=6.8314.067