Centering matrix explained

In mathematics and multivariate statistics, the centering matrix[1] is a symmetric and idempotent matrix, which when multiplied with a vector has the same effect as subtracting the mean of the components of the vector from every component of that vector.

Definition

The centering matrix of size n is defined as the n-by-n matrix

Cn=In-\tfrac{1}{n}Jn

where

In

is the identity matrix of size n and

Jn

is an n-by-n matrix of all 1's.

For example

C1=\begin{bmatrix} 0\end{bmatrix}

,

C2=\left[\begin{array}{rrr}1&0\\ 0&1\end{array}\right]-

1
2

\left[\begin{array}{rrr}1&1\\ 1&1 \end{array}\right]=\left[\begin{array}{rrr}

1
2

&-

1\\ -
2
1
2

&

1
2

\end{array}\right]

,

C3=\left[\begin{array}{rrr} 1&0&0\\ 0&1&0\\ 0&0&1\end{array}\right]-

1
3

\left[\begin{array}{rrr} 1&1&1\\ 1&1&1\\ 1&1&1\end{array}\right] =\left[\begin{array}{rrr}

2
3

&-

1
3

&-

1\\ -
3
1
3

&

2
3

&-

1\\ -
3
1
3

&-

1
3

&

2
3

\end{array}\right]

Properties

Given a column-vector,

v

of size n, the centering property of

Cn

can be expressed as

Cnv=v-

rm{T}v)J
(\tfrac{1}{n}J
n,1
where

Jn,1

is a column vector of ones and
rm{T}v
\tfrac{1}{n}J
n,1
is the mean of the components of

v

.

Cn

is symmetric positive semi-definite.

Cn

is idempotent, so that
k=C
C
n
, for

k=1,2,\ldots

. Once the mean has been removed, it is zero and removing it again has no effect.

Cn

is singular. The effects of applying the transformation

Cnv

cannot be reversed.

Cn

has the eigenvalue 1 of multiplicity n - 1 and eigenvalue 0 of multiplicity 1.

Cn

has a nullspace of dimension 1, along the vector

Jn,1

.

Cn

is an orthogonal projection matrix. That is,

Cnv

is a projection of

v

onto the (n - 1)-dimensional subspace that is orthogonal to the nullspace

Jn,1

. (This is the subspace of all n-vectors whose components sum to zero.)

The trace of

Cn

is

n(n-1)/n=n-1

.

Application

Although multiplication by the centering matrix is not a computationally efficient way of removing the mean from a vector, it is a convenient analytical tool. It can be used not only to remove the mean of a single vector, but also of multiple vectors stored in the rows or columns of an m-by-n matrix

X

.

The left multiplication by

Cm

subtracts a corresponding mean value from each of the n columns, so that each column of the product

CmX

has a zero mean. Similarly, the multiplication by

Cn

on the right subtracts a corresponding mean value from each of the m rows, and each row of the product

XCn

has a zero mean.The multiplication on both sides creates a doubly centred matrix

CmXCn

, whose row and column means are equal to zero.

The centering matrix provides in particular a succinct way to express the scatter matrix,

S=(X-\mu

T
J
n,1

)(X-\mu

T
J
n,1

)T

of a data sample

X

, where

\mu=\tfrac{1}{n}XJn,1

is the sample mean. The centering matrix allows us to express the scatter matrix more compactly as

S=XCn(XC

T
n)

=XCnC

T
nX
T
=XC
nX

.

Cn

is the covariance matrix of the multinomial distribution, in the special case where the parameters of that distribution are

k=n

, and

p1=p2= … =p

n=1
n
.

Notes and References

  1. John I. Marden, Analyzing and Modeling Rank Data, Chapman & Hall, 1995,, page 59.