whitening {MultiVarSel} | R Documentation |
This function provides an estimation of the inverse of the square root of the covariance matrix of each row of the residuals matrix.
Description
This function provides an estimation of the inverse of the square root of the covariance matrix of each row of the residuals matrix.
Usage
whitening(residuals, typeDep, pAR = 1, qMA = 0)
Arguments
residuals |
the residuals matrix obtained by fitting a linear model to each column of the response matrix as if they were independent |
typeDep |
character in c("AR1", "ARMA", "nonparam") defining which type of dependence to use |
pAR |
numerical, only use if typeDep = "ARMA", the parameter p for the ARMA(p, q) process |
qMA |
numerical, only use if typeDep = "ARMA", the parameter q for the ARMA(p, q) process |
Value
It returns the estimation of the inverse of the square root of the covariance matrix of each row of the residuals matrix.
Examples
data(copals_camera)
Y <- scale(Y[, 1:100])
X <- model.matrix(~ group + 0)
residuals <- lm(as.matrix(Y) ~ X - 1)$residuals
whitening(residuals, "AR1")
[Package MultiVarSel version 1.1.3 Index]