Rank and trace are equal for a real symmetric idempotent matrix

Mathematical Odds & Ends

Proposition. Let $latex mathbf{X} in mathbb{R}^{n times n}$ be a matrix that is symmetric ($latex mathbf{X}^top = mathbf{X}$) and idempotent ($latex mathbf{X}^2 = mathbf{X}$). Then the rank of $latex mathbf{X}$ is equal to the trace of $latex mathbf{X}$. In fact, they are both equal to the sum of the eigenvalues of $latex mathbf{X}$.

The proof is relatively straightforward. Since $latex mathbf{X}$ is real and symmetric, it is orthogonally diagonalizable, i.e. there is an orthogonal matrix $latex mathbf{U}$ ($latex mathbf{U}^top mathbf{U} = mathbf{I}$) and a diagonal matrix $latex mathbf{D}$ such that $latex mathbf{D} = mathbf{UXU}^top$ (see here for proof).

Since $latex mathbf{X}$ is idempotent,

$latex begin{aligned} mathbf{X}^2 &= mathbf{X},
mathbf{U}^top mathbf{D}^2 mathbf{U} &= mathbf{U}^T mathbf{DU},
mathbf{D}^2 &= mathbf{D}. end{aligned}$

Since $latex mathbf{D}$ is a diagonal matrix, it implies that the entries on the diagonal must be zeros or ones. Thus, the number of ones on the diagonal (which is $latex text{rank}(mathbf{D})…

View original post 16 more words

General chi-square tests

Imagen tomada de Lifeder.

Statistical Odds & Ends

In this previous post, I wrote about the asymptotic distribution of the Pearson $latex chi^2$ statistic. Did you know that the Pearson $latex chi^2$ statistic (and the related hypothesis test) is actually a special case of a general class of $latex chi^2$ tests? In this post we describe the general $latex chi^2$ test. The presentation follows that in Chapters 23 and 24 of Ferguson (1996) (Reference 1). I’m leaving out the proofs, which can be found in the reference.

(Warning: This post is going to be pretty abstract! Nevertheless, I think it’s worth a post since I don’t think the idea is well-known.)

Let’s define some quantities. Let $latex Z_1, Z_2, dots in mathbb{R}^d$ be a sequence of random vectors whose distribution depends on a $latex k$-dimensional parameter $latex theta$ which lies in a parameter space $latex Theta$. $latex Theta$ is assumed to be a non-empty open subset…

View original post 696 more words