I have seen two $\chi^2$ test across the internet.

  1. [Common wiki Chi-suqare test] To check whether a prediction is a good fit or not (a classical null test):

    • Compute $\sum_{i=1}^{N} (x_i - \textbf{pred}_i)^2/\textbf{pred}_i $
  2. [Mackay 1991: Bayesian interpolant.] Consider $N$ Gaussian variable, and the corresponding mean $\mu_i$ and s.t.d. as $\sigma_i$.

    • The expected of $\chi^2$ misfit between the true interpolant and data is $N$.
    • Then the model parameters should be adjusted to match $\chi^2 = N$.


I have only seen the second one in Mackay's paper, in the original paper of Mackay 1991: Bayesian interpolant, it is said orthodox statistician would like any model parameter to match $\chi^2 = N$.

It seems to be a nice result but when I searched google, I can only find the first one. Does anyone see the second chi-square criterion before?

  • $\begingroup$ The chi-square occurs in still more contexts than those two. There's no paper by Mackay called "Bayesian interpolant" that I can find. Do you mean MacKay, David J. C.. “Bayesian Interpolation.” Neural Computation 4(3) (1992): p415-447. ? $\endgroup$
    – Glen_b
    Jul 14, 2018 at 22:21
  • $\begingroup$ @Glen_b Yes! That is the paper! Mackay is a big guy in practical Bayesian. $\endgroup$ Jul 15, 2018 at 3:03

1 Answer 1


Yes, this is pretty standard when the variance is specified (and the idea is widely used in sciences where suitable values of $\sigma$ are assumed to be known). However it's not as common as the chi-squared tests of goodness of fit and of independence / homogeneity of proportion.

(Setting the misfit value to $N$ is not something I've seen done before though; it would be more common to minimize it and adjust the DF, but I might be missing information about what he's trying to do there.)

If you have $X_1,X_2,\ldots,X_n$ independent and $\sim N(\mu_i,\sigma^2_i)$ then $Z_i=\frac{X_i-\mu_i}{\sigma_i}$, $i=1,2,\ldots,n$ are i.i.d standard normal, in which case $\sum_i Z_i^2$ is distributed as $\chi^2_n$.

Chi-squared tests occur in numerous other contexts; for an important example, see Wilks' theorem, which gives an asymptotic chi-square approximation for $-2\log \Lambda$ where $\Lambda$ is the likelihood ratio statistic.

  • $\begingroup$ Thanks Glen_b. I had the similar feeling that chi-squared test with known mean and known std would definitely lead to a nice chi^2 distribution. But I would say chi-squared-test-of-goodness-of-fit is more practical to use. $\endgroup$ Jul 15, 2018 at 3:05
  • 1
    $\begingroup$ The chi-square goodness of fit test is actually a slightly modified version of the same thing. For example you imagine that the X's are Poisson-distributed counts then $\sigma_i^2=\mu_i$. If the expected counts are large enough to apply the normal approximation to the Poisson, then $Z_i=\frac{X_i-\mu_i}{\sqrt{\mu_i}}$ are approximately standard normal, so $\sum_i\frac{(X_i-\mu_i)^2}{\mu_i}$ will be approximately chi-squared. If you then condition on the marginal total you end up with the same statistic but lose a degree of freedom. So it's pretty much the same idea. $\endgroup$
    – Glen_b
    Jul 15, 2018 at 3:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.