aux_preprocess: Preprocessing the data

View source: R/RcppExports.R

aux.preprocessR Documentation

Preprocessing the data

Description

aux.preprocess can perform one of following operations; "center", "scale", "cscale", "decorrelate" and "whiten". See below for more details.

Usage

aux.preprocess(
  data,
  type = c("center", "scale", "cscale", "decorrelate", "whiten")
)

Arguments

data

an (n\times p) matrix or data frame whose rows are observations and columns represent independent variables.

type

one of "center", "scale", "cscale", "decorrelate" or "whiten".

Value

named list containing:

pX

an (n\times p) matrix after preprocessing in accordance with type parameter

info

a list containing

  • type: name of preprocessing procedure.

  • mean: a mean vector of length p.

  • multiplier: a (p\times p) matrix or 1 for "center".

Operations

we have following operations,

"center"

subtracts mean of each column so that every variable has mean 0.

"scale"

turns each column corresponding to variable have variance 1.

"cscale"

combines "center" and "scale".

"decorrelate"

"center" and sets its covariance term having diagonal entries only.

"whiten"

"decorrelate" and sets all diagonal elements be 1.

Author(s)

Kisung You

Examples


## Generate data
set.seed(100)
X = aux.gensamples(n=200)

## 5 types of preprocessing
X_center = aux.preprocess(X)
X_scale  = aux.preprocess(X,type="scale")
X_cscale = aux.preprocess(X,type="cscale")
X_decorr = aux.preprocess(X,type="decorrelate")
X_whiten = aux.preprocess(X,type="whiten")



Rdimtools documentation built on Sept. 23, 2022, 1:06 a.m.