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.
whitening(residuals, typeDep, pAR = 1, qMA = 0)
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 |
It returns the estimation of the inverse of the square root of the covariance matrix of each row of the residuals matrix.
data(copals_camera)
Y <- scale(Y[, 1:100])
X <- model.matrix(~ group + 0)
residuals <- lm(as.matrix(Y) ~ X - 1)$residuals
whitening(residuals, "AR1")