7.8 Full information statistics (Cont’d)

Two full-information statistics can be defined as \[ \chi^2=N\sum_y \frac{(p_y-\hat{\pi}_y)^2}{\hat{\pi}_y} \] and \[ G^2=2N\sum_y p_y\frac{p_y}{\hat{\pi}_y} \]

Both statistics are \(\chi^2\) distributed. The associated degrees of freedom is equal to the number of response patterns - the number of parameters - 1.

  • \(H_0\): The model fits data well
  • \(H_1\): The model does not fit data well

Exercise: write your own function to calculate these two statistics.