aux.preprocess | R Documentation |
aux.preprocess
can perform one of following operations; "center"
, "scale"
,
"cscale"
, "decorrelate"
and "whiten"
. See below for more details.
aux.preprocess( data, type = c("center", "scale", "cscale", "decorrelate", "whiten") )
data |
an (n\times p) matrix or data frame whose rows are observations and columns represent independent variables. |
type |
one of |
named list containing:
an (n\times p) matrix after preprocessing in accordance with type
parameter
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".
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.
Kisung You
## 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.