# Appendix to the paper “A goodness-of-fit test for multinomial

Document Sample

```					  Appendix to the paper: “A goodness-of-ﬁt
test for multinomial logistic regression”
J. J. Goeman                      S. le Cessie

February 8, 2006

Numbers in brackets refer to equations in the paper.

A     Variance of the test statistic
˜                               ˜       g   g
We calculate the variance of Q as given in (5). Write Q = ∑s=1 ∑t=1 Qst , where
n     n   ˜ st (yis − µis )(y jt − µ jt ) for s, t = 1, . . . g. We will calculate the
Qst = ∑i=1 ∑ j=1 Rij
g4 covariances of all Qst terms and sum them to ﬁnd the variance of Q.               ˜
st                                      st uv
Deﬁne Sij = (yis − µis )(y jt − µ jt ). Then Cov(Sij , Skl ) = 0 unless i = k and
j = l or i = l and j = k, due to the independence of the samples under the null
hypothesis. Therefore

Cov( Qst , Quv )   =      ∑ Rii Rii Cov(Sii , Sii ) + ∑ ∑ Rij Rij Cov(Sij , Sij )
˜ st ˜ uv    st uv            ˜ st ˜ uv    st uv
i                                 i j =i

+ ∑ ∑ Rij Ruv Cov(Sij , Suv ).
˜ st ˜
ji
st
ji
i j =i

st
If i = j, E(Sij ) = 0, for all s and t, so that
st uv                                                                         su tv
Cov(Sij , Sij ) = E[(yis − µis )(yiu − µiu )] · E[(y jt − µ jt )(y jv − µ jv )] = Wii Wjj ,

while if i = j,
st uv           st uv         st     uv        st uv       st uv
Cov(Sii , Sii ) = E[Sii Sii ] − E[Sii ]E[Sii ] = E[Sii Sii ] − Wii Wii .

Using these expressions,
n                    n    n
Cov( Qst , Quv )        =   ∑ Rii Rii κistuv + ∑
˜ st ˜ uv               ∑ Rij Rvu Wii Wjj
˜ st ˜
ji
su tv
i =1                 i =1 j =1
n   n
+∑        ∑ Rij Ruv Wii Wjj
˜ st ˜
ji
sv tu
i =1 j =1

1
st uv       st uv        su tv     sv tu
where κistuv = E(Sii Sii ) − Wii Wii − Wii Wii − Wii Wii . It is easy to check
that the value of κistuv does not depend on the order of s, t, u and v. Calculation
of the values of κistuv as given in (6) is straightforward but tedious.
Taking all covariances of the Qst terms together, we have
g           g       g       g
˜
Var( Q) =                  ∑ ∑ ∑ ∑ Cov(Qst , Quv ).
s =1 t =1 u =1 v =1

The result (5) follows by rewriting
n         n
∑ ∑ Rij Rvu Wii Wjj = trace( Rst W tv Rvu W su )
˜ st ˜
ji
su tv          ˜        ˜
i =1 j =1

and
g    g        g          g
∑ ∑ ∑ ∑ trace( Rst W tu Ruv W sv ) = trace(RWRW).
˜        ˜                  ˜ ˜
s =1 t =1 u =1 v =1

B     Derivation of the test statistic
We derive the expression (9) for the score test statistic from the random ef-
fects model (7). The likelihood L(τ 2 ) = exp{ (τ 2 )} can be written L(τ 2 ) =
n                                                             g
Ez ∏i=1 f i (z) , where f i (r) = exp{li (z)} and li (z) = ∑s=1 yis log{νis (z)};
compare (8). Note that f i (z) only depends on (zi1 , . . . , zig ). Therefore, Taylor
expanding L(τ 2 ) with respect to z at z = 0 gives
n                               g       n
∂ f i (0)
L(τ 2 )    = Ez                ∏ fi (0) + ∑ ∑ zis                                    ∂zis       ∏ f j (0)
i =1                         s =1 i =1                           j =i
g          g       n
1                    i (0)                   ∂2 f
2 s∑ t∑ i∑ is it ∂zis ∂zit                                    ∏ f j (0)
+                  z z
=1 =1 =1                                                   j =i
g       n  g
1                      ∂ f i (0) ∂ f j (0)
+        ∑ ∑ ∑ ∑ zis z jt ∂zis ∂z jt
2 s =1 t =1 i =1 j = i                                                      ∏        f k (0) + o (zz )
k =i,j
n                                          g       g       n
1                                         ∂2 f ( 0 )
=        ∏ fi (0) + 2 τ2 ∑ ∑ ∑ Rii ∂zisi∂zit ∏ f j (0)
st
i =1                                    s =1 t =1 i =1                             j =i
g       g           n
1                      st ∂ f ( 0 )
∂ f j (0)
+ τ 2 ∑ ∑ ∑ ∑ Rij i
∂zis ∂z jt k∏ k
f ( 0 ) + o ( τ 2 ).
2 s =1 t =1 i =1 j = i                        =i,j

2
∂ f (z)
i            i     ∂l (z)        ∂2 f i ( z )                     ∂2 li ( z )         ∂li (z) ∂li (z)
Using ∂z = f i (z) ∂z and                 ∂zis ∂zit      = f i (z)         ∂zis ∂zit     +      ∂zis ∂zit        , this expres-
is           is
sion can be rewritten to
n                              g
n       g
1                st ∂l ( 0 )
L(τ 2 )     =      ∏      f i (0) 1 + τ 2 ∑ ∑ ∑ Rii i
2 s =1 t =1 i =1   ∂zis ∂zit
i =1
g g n n
1                                ∂l (0)
st ∂l ( 0 ) j
+ τ 2 ∑ ∑ ∑ ∑ Rij i                      + o (τ 2 )
2 s =1 t =1 i =1 j =1     ∂zis ∂z jt

∂ (0)        1 ∂L(0)
Because    ∂τ 2
=   L(0) ∂τ 2
,     the score function at τ 2 = 0 is

g     g      n                            g        g     n        n
∂ (0)   1                              ∂2 l ( 0 )                                                ∂li (0) ∂l j (0)
∂τ 2
=
2         ∑ ∑ ∑ Rii ∂zisi∂zit + ∑ ∑ ∑ ∑ Rij
st                      st
∂zis ∂z jt
s =1 t =1 i =1                         s =1 t =1 i =1 j =1

∂li (0)                                       ∂2 li ( 0 )       st
The result (9) follows from              ∂zis         = yis − µis and                 ∂zis zit      = −Wii .

3

```
DOCUMENT INFO
Shared By:
Categories:
Stats:
 views: 3 posted: 3/20/2010 language: English pages: 3