center_matrix | R Documentation |
Obtains the mean of each column of the matrix and subtracts it from the given matrix in a centering operation.
center_matrix(x)
x |
A |
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}
A matrix
with the same dimensions of X that has been centered.
James Joseph Balamuta
cIRT()
nobs = 500 nvars = 20 x = matrix(rnorm(nobs * nvars), nrow = nobs, ncol = nvars) r_centered = scale(x) arma_centered1 = center_matrix(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.