# Thread: Chi-Square Test With Good Mean & Variance Estimate

1. ## Chi-Square Test With Good Mean & Variance Estimate

Hello,

I have come across some computer code that is attempting (what looks like) a Pearson's Chi-Square Test for normality.

The program has good knowledge of the mean and variance of the quantity being tested (it maintains it over time through some fancy converging filter), however, rather than performing the statistic using expectations, it simply substitutes the estimates and computes the value for each incoming measurement.

That is, measurements are processed one by one, and if it doesn't match the good mean and variance estimate, then it chucks it away.

The statistic is programmed as:

$\displaystyle Chi^2 = (Measurement - EstimatedMean)^2/EstimatedVariance$

And the significance test is performed using one degree of freedom.

My question is, how is this derived from the basic Pearson's Chi-Square formula where expectations are defined? And is this a good test for normality?

Thankyou.

2. Originally Posted by Trido
Hello,

I have come across some computer code that is attempting (what looks like) a Pearson's Chi-Square Test for normality.

The program has good knowledge of the mean and variance of the quantity being tested (it maintains it over time through some fancy converging filter), however, rather than performing the statistic using expectations, it simply substitutes the estimates and computes the value for each incoming measurement.

That is, measurements are processed one by one, and if it doesn't match the good mean and variance estimate, then it chucks it away.

The statistic is programmed as:

$\displaystyle Chi^2 = (Measurement - EstimatedMean)^2/EstimatedVariance$

And the significance test is performed using one degree of freedom.

My question is, how is this derived from the basic Pearson's Chi-Square formula where expectations are defined? And is this a good test for normality?

Thankyou.
$\displaystyle X^2 = (Measurement - Mean)^2/Variance$

is the square of a standard normal RV and so has a $\displaystyle \chi^2$ distribution with 1 degree of freedom. So if the estimates are good:

$\displaystyle Y^2 = (Measurement - EstimatedMean)^2/EstimatedVariance$

is approximately distributed with a $\displaystyle \chi^2$ distribution with 1 degree of freedom.

This is not derived from Pearson's Chi-Square as it is a more primitive result, which underlies Pearson's Chi-Square.

(the sum of the squares of $\displaystyle n$ independent standard normal RV's has a $\displaystyle \chi^2$ distribution with $\displaystyle n$ degrees of freedom)

.

3. Thankyou Constatine11.