Hubbry Logo
Centering matrixCentering matrixMain
Open search
Centering matrix
Community hub
Centering matrix
logo
7 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Centering matrix
Centering matrix
from Wikipedia

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

[edit]

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

where is the identity matrix of size n and is an n-by-n matrix of all 1's.

For example

,
,

Properties

[edit]

Given a column-vector, of size n, the centering property of can be expressed as

where is a column vector of ones and is the mean of the components of .

is symmetric positive semi-definite.

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

is singular. The effects of applying the transformation cannot be reversed.

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

has a nullspace of dimension 1, along the vector .

is an orthogonal projection matrix. That is, is a projection of onto the (n − 1)-dimensional subspace that is orthogonal to the nullspace . (This is the subspace of all n-vectors whose components sum to zero.)

The trace of is .

Application

[edit]

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 .

The left multiplication by subtracts a corresponding mean value from each of the n columns, so that each column of the product has a zero mean. Similarly, the multiplication by on the right subtracts a corresponding mean value from each of the m rows, and each row of the product has a zero mean. The multiplication on both sides creates a doubly centred matrix , whose row and column means are equal to zero.

The centering matrix provides in particular a succinct way to express the scatter matrix, of a data sample , where is the sample mean. The centering matrix allows us to express the scatter matrix more compactly as

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

References

[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
The centering matrix, also known as the data centering matrix, is an n×nn \times n symmetric and idempotent matrix in linear algebra and statistics, defined as H=In1n1n1n\mathbf{H} = \mathbf{I}_n - \frac{1}{n} \mathbf{1}_n \mathbf{1}_n^\top, where In\mathbf{I}_n is the n×nn \times n identity matrix and 1n\mathbf{1}_n is the n×1n \times 1 column vector of ones. This matrix serves as an orthogonal projection onto the hyperplane orthogonal to 1n\mathbf{1}_n, effectively centering a vector x\mathbf{x} by subtracting its mean xˉ=1ni=1nxi\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i from each component, yielding Hx=xxˉ1n\mathbf{Hx} = \mathbf{x} - \bar{x} \mathbf{1}_n. In , the centering matrix plays a crucial role in data preprocessing by transforming an n×pn \times p X\mathbf{X} (with nn observations and pp variables) into HX\mathbf{HX}, which subtracts the of each column from its entries, resulting in a centered where each variable has zero . This operation is essential for computing unbiased sample matrices, as the sample S=1n1XHX\mathbf{S} = \frac{1}{n-1} \mathbf{X}^\top \mathbf{H} \mathbf{X} ensures that the means are removed, preventing from non-zero centroids. The matrix's (H2=H\mathbf{H}^2 = \mathbf{H}) and (H=H\mathbf{H}^\top = \mathbf{H}) guarantee that repeated applications do not alter the centered data, and its eigenvalues consist of 1 with multiplicity n1n-1 and 0 with multiplicity 1, reflecting its rank of n1n-1 and the one-dimensional kernel spanned by 1n\mathbf{1}_n. Beyond centering, the matrix facilitates (PCA) and other techniques by ensuring that variance is computed around the origin after mean subtraction, and it appears in regression models to orthogonalize data against constant terms. Its rows and columns sum to zero, underscoring its role in removing the overall effect across observations.

Definition and Construction

Matrix Representation

The centering matrix HH in nn-dimensional space is defined as the symmetric matrix given by H=In1n1n1nT,H = I_n - \frac{1}{n} \mathbf{1}_n \mathbf{1}_n^T, where InI_n denotes the n×nn \times n and 1n\mathbf{1}_n is the n×1n \times 1 column vector of all ones. This formulation represents the orthogonal projection onto the subspace perpendicular to 1n\mathbf{1}_n. A common notational convention denotes the all-ones matrix as Jn=1n1nTJ_n = \mathbf{1}_n \mathbf{1}_n^T, which is the n×nn \times n matrix with every entry equal to 1; thus, the centering matrix simplifies to H=In1nJnH = I_n - \frac{1}{n} J_n. This matrix arises from the general formula for the orthogonal projection onto the column space of a matrix AA, which is P=A(ATA)1ATP = A (A^T A)^{-1} A^T, assuming AA has full column rank./06%3A_Orthogonality/6.03%3A_Orthogonal_Projection) Applying this to A=1nA = \mathbf{1}_n, we obtain ATA=nA^T A = n, so (ATA)1=1n(A^T A)^{-1} = \frac{1}{n} and P=1n(1n)1nT=1nJnP = \mathbf{1}_n \left( \frac{1}{n} \right) \mathbf{1}_n^T = \frac{1}{n} J_n, the projection onto the span of 1n\mathbf{1}_n. The centering matrix is then the complementary projection H=InPH = I_n - P. For explicit construction with small nn, consider n=3n=3. Substituting into the formula yields H=(100010001)13(111111111)=(231313132313131323).H = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix} - \frac{1}{3} \begin{pmatrix} 1 & 1 & 1 \\ 1 & 1 & 1 \\ 1 & 1 & 1 \end{pmatrix} = \begin{pmatrix} \frac{2}{3} & -\frac{1}{3} & -\frac{1}{3} \\ -\frac{1}{3} & \frac{2}{3} & -\frac{1}{3} \\ -\frac{1}{3} & -\frac{1}{3} & \frac{2}{3} \end{pmatrix}.
Add your contribution
Related Hubs
User Avatar
No comments yet.