Effects of Ignoring Correlations When Computing...

5

Click here to load reader

Transcript of Effects of Ignoring Correlations When Computing...

Page 1: Effects of Ignoring Correlations When Computing …web.ipac.caltech.edu/.../astro_refs/WrongChiSquare2012.pdfEffects of Ignoring Correlations When Computing Sample Chi-Square John

( )( )χN ij i jj

N

i

Nw x x x x2

11= − −∑∑

==

( )χ

σNei i

ii

N x x2

2

21

≡−

∑=

( )var χ ρNe ijj i

N

i

NN2 2

11

12 4= + ∑∑

= +=

( )p x

eN N N

N

N

( )/

/=

−χ

π

2 2

22 Ω

Ω N

N N

N N

N N N N N

=

⎜⎜⎜⎜

⎟⎟⎟⎟

σ ρ σ σ ρ σ σρ σ σ σ ρ σ σ

ρ σ σ ρ σ σ σ

12

12 1 2 1 1

21 2 1 22

2 2

1 1 2 22

K

L

M M O M

L

Effects of Ignoring Correlations When Computing Sample Chi-Square

John W. FowlerFebruary 26, 2012

It can happen that chi-square must be computed for a sample whose elements are correlated to anunknown extent. We denote the sample elements as xi, i = 1 to N. In general, when there arecorrelations, the form of chi-square is

(1)

where the wij are the elements of the inverse of the covariance matrix ΩN ,

(2)

If the covariance matrix is not known numerically, the only formula available for computing chi-square is that for the case of zero off-diagonal correlation. Since this uncorrelated form is “errone-ous” when non-zero off-diagonal correlations are being ignored, we attach a subscript e:

(3)

As shown below, both forms (Equations 1 and 3) have the expectation value N, but the erroneousform has a larger variance. The mean and variance of the correct form are well known to be N and2N, respectively, whereas the variance for the erroneous form is

(4)

This is found by integrating the moments of the “erroneous” chi-square over the joint densityfunction for the correlated Gaussian random variables involved. In general, for N degrees of freedom,the joint density is

(5)

Page 2: Effects of Ignoring Correlations When Computing …web.ipac.caltech.edu/.../astro_refs/WrongChiSquare2012.pdfEffects of Ignoring Correlations When Computing Sample Chi-Square John

z z z z p z z dz dzi j i j ij i j i j

ij

2 2 2 2

21 2

= ∫∫

= +−∞

−∞

( , )

ρ

( )var χ ρNe ijij

N2 22= ∑

χNe ii

Nz2 2

1≡ ∑

=

χ σNe ii

N

i ii

N

i

N

i

Nz z Nz

2 2

1

2 2

1 111= ∑ = = =∑ =∑∑

= = ==

( ) ( ) ( )χ χ χNe Ne Ne N2 2 2 2 2 2 2− = −

( )χNe ii

N

jj

N

i jj i

N

i

N

i jj i

N

i

Nz z z z z z2 2 2

1

2

1

2 2

1

2 2

1= ∑⎛⎝⎜

⎞⎠⎟ ∑⎛⎝⎜

⎞⎠⎟ = ∑∑ = ∑∑

= = == ==

where χ2N and ΩN are used formally as defined in Equations 1 and 2, and |ΩN | is the determinant of

the covariance matrix. The variance of the “erroneous” chi-square in Equation 4 can be written moresimply by using the fact that the diagonal correlations are always unity and are picked up once in thesummation below, whereas the others are picked up twice:

(6)

Note that this is just twice the square of the Frobenius norm of the correlation matrix. If there are nooff-diagonal correlations, Equation 4 shows (and less obviously, Equation 6) that the variance willreduce to 2N, and the chi-square will not be “erroneous”. Otherwise, any non-zero off-diagonalcorrelation can only increase the variance above 2N.

The fact that the expectation value of the “erroneous” chi-square is N, the same as for the correct chi-square, can be seen as obvious from the fact that the former is simply the sum of N terms, each ofwhich has the expectation value 1, since each term has the expectation value of the numerator in thedenominator.

The variance of the “erroneous” chi-square is not as obvious, since the expectation value of thesquare depends on the underlying density function. For notational brevity, define

(7)

where the zi are generally correlated zero-mean unit-variance Gaussian random variables. Thenobviously

(8)

The variance is

(9)

where

(10)

For any combination of i and j, the form of the expectation value <zi2zj

2> depends only on theproperties of zi and zj, namely their correlation ρij and the fact that both are zero-mean unit-varianceGaussian random variables, so we can compute the expectation value of this product using abivariate joint Gaussian density function, i.e., Equation 5 with all means zero and all variances unityand all the random variables integrated out except the ith and jth:

(11)

Page 3: Effects of Ignoring Correlations When Computing …web.ipac.caltech.edu/.../astro_refs/WrongChiSquare2012.pdfEffects of Ignoring Correlations When Computing Sample Chi-Square John

( ) ( )( )( )

χ ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ ρ ρ

Ne ij jk ik ij jk ikk

N

j

N

i

N

ij jk ik ij jk ikk

N

j

N

i

N

ijj

N

i

N

jkk

N

j

N

ikk

N

i

N

ij jk ikk

N

j

N

i

N

N N N N

2 3 2 2 2

111

3 2 2 2

111

3 2

11

2

11

2

11 11

1 2 4

2 4

2 2 2 8

= + + + +∑∑∑

= + + + +∑∑∑

= + ∑∑ + ∑∑ + ∑∑ + ∑∑

===

===

== == == ===1

3 2

11 1116 8

N

ijj

N

i

N

ij jk ikk

N

j

N

i

NN N

= + ∑∑ + ∑∑∑== ===ρ ρ ρ ρ

μ ρ ρ ρ ρ

ρ

ρ ρ ρ

33 2

11 111

2 2

11

3

111

6 8

3 2

8

2

= + ∑∑ + ∑∑∑

− + ∑∑⎛⎝⎜

⎞⎠⎟ +

= ∑∑∑

== ===

==

===

N

N N N

N ijj

N

i

N

ij jk ikk

N

j

N

i

N

ijj

N

i

N

ij jk ikk

N

j

N

i

N

( ) ( )χ ρ ρNe ijj

N

i

N

ijj

N

i

NN2 2 2

11

2 2

111 2 2= +∑∑ = + ∑∑

== ==

μ3 3 2 1 133 2= − +m m m m

( ) ( )χ χ ρNe Ne ijj

N

i

N2 2 2 2 2

112− = ∑∑

==

Note that for i = j, this reduces to <zi4> = 3, the well known value for the 4th moment of a zero-mean

unit-variance Gaussian random variable. Using Equation 11 in Equation 10,

(12)

and Equation 9 becomes

(13)

which is just Equation 6, hence equivalent to Equation 4. Similar computations can be used to showthat the third raw moment is

(14)

Denoting the nth raw moment mn and the nth central moment µn, the third central moment is

(15)

So the third central moment of the “erroneous” chi-square is

(16)

The skewness is Equation (16) divided by the right-hand side of either Equation 4 or 6 (or 13) raisedto the 3/2 power:

Page 4: Effects of Ignoring Correlations When Computing …web.ipac.caltech.edu/.../astro_refs/WrongChiSquare2012.pdfEffects of Ignoring Correlations When Computing Sample Chi-Square John

( ) ( ) ( )

m N NN

m N N NN

skewN

N NskewNe N

22

2

33 2

3

23 2

2

2

2

6 8

8

8

2

8

⇒ +⇒

⇒ + +⇒

⇒ = =

μ

μ

χ χ/

( )( )( )( )( )

m Ne

ij ik im jk jm km

ij km ik jm im jk

ij ik jk ij im jm ik im km jk jm km

ij ik jm km ij im jk km ik im jk jm

m

N

k

N

j

N

i

N

42 4

2 2 2 2 2 2

2 2 2 2 2 2

1111

1 2

4

8

16

=

=

+ + + + + +

+ + +

+ + + +

+ + +

⎜⎜⎜⎜⎜⎜⎜

⎟⎟⎟⎟⎟⎟⎟

∑∑∑====

χ

ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ ρ

= + ∑∑ + ∑∑∑∑

+ ∑∑∑ + ∑∑∑∑

== ====

=== ====

N N ijj

N

i

N

ij kmm

N

k

N

j

N

i

N

ij ik jkk

N

j

N

i

N

ij ik jm kmm

N

k

N

j

N

i

NN

4 2 2

11

2 2

1111

111 1111

12 12

32 48

ρ ρ ρ

ρ ρ ρ ρ ρ ρ ρ

μ4 4 3 1 2 12

144 6 3= − + −m m m m m m

( )skew Ne

ij jk ikk

N

j

N

i

N

ijj

N

i

ρ ρ ρ

ρ

2 111

2

11

3 2

8

2

=∑∑∑

∑∑⎛⎝⎜

⎞⎠⎟

===

==

/ (17)

If all the off-diagonal correlations are set to zero, then

(18)

Continuing to the fourth raw moment, we integrate zi2zj

2zk2zm

2 over the joint density function to obtain<zi

2zj2zk

2zm2>, which is then summed over all four indexes to give us

(19)

The fourth central moment is

(20)

The fourth central moment of the “erroneous” chi-square is therefore

Page 5: Effects of Ignoring Correlations When Computing …web.ipac.caltech.edu/.../astro_refs/WrongChiSquare2012.pdfEffects of Ignoring Correlations When Computing Sample Chi-Square John

( )μ ρ ρ ρ ρ ρ ρ42 2

111112 4= +∑∑∑∑

====ij km ij ik jm km

m

N

k

N

j

N

i

N

( )( )

kurt Ne

ij km ij ik jm kmm

N

k

N

j

N

i

N

ijj

N

i

ρ ρ ρ ρ ρ ρ

ρ

2

2 2

1111

2

11

2

3 4=

+∑∑∑∑

∑∑⎛⎝⎜

⎞⎠⎟

====

==

μ ρ ρ ρ

ρ ρ ρ ρ ρ ρ ρ

ρ ρ ρ ρ

44 2 2

11

2 2

1111

111 1111

3 2

11 111

12 12

32 48

4 6 8

= + ∑∑ + ∑∑∑∑

+ ∑∑∑ + ∑∑∑∑

− + ∑∑ + ∑∑∑⎛⎝⎜

⎞⎠

== ====

=== ====

== ===

N N

N N

ijj

N

i

N

ij kmm

N

k

N

j

N

i

N

ij ik jkk

N

j

N

i

N

ij ik jm kmm

N

k

N

j

N

i

N

ijj

N

i

N

ij ik jkk

N

j

N

i

N

N

+ + ∑∑⎛⎝⎜

⎞⎠⎟ −

==

N

N N Nijj

N

i

N6 2 32 2

11

2 4ρ

( ) ( ) ( )μ

χ χ

42

22

22

12 48

12 48

23

12

⇒ +

⇒+

= + =

N N

kurtN N

N NkurtNe N

(21)

Expanding and canceling,

(22)

So the kurtosis is

(23)

If all the off-diagonal correlations are set to zero, then

(24)