center_matrix {cIRT} | R Documentation |
Center a Matrix
Description
Obtains the mean of each column of the matrix and subtracts it from the given matrix in a centering operation.
Usage
center_matrix(x)
Arguments
x |
A |
Details
The application of this function to a matrix mimics the use of a centering matrix given by:
{C_n} = {I_n} - \frac{1}{n}{11^T}
Value
A matrix
with the same dimensions of X that has been centered.
Author(s)
James Joseph Balamuta
See Also
Examples
nobs = 500
nvars = 20
x = matrix(rnorm(nobs * nvars), nrow = nobs, ncol = nvars)
r_centered = scale(x)
arma_centered1 = center_matrix(x)
[Package cIRT version 1.3.2 Index]