# center_matrix: 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

 1 center_matrix(x) 

### Arguments

 x A matrix with any dimensions

### 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

centered_matrix A matrix with the same dimensions of X that has been centered.

### Author(s)

James J Balamuta

cIRT

### Examples

 1 2 3 4 5 nobs = 500 nvars = 20 x = matrix(rnorm(nobs*nvars),nrow=nobs,ncol=nvars) r_centered = scale(x) arma_centered1 = center_matrix(x) 

Search within the cIRT package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.