whitening_test {MultiVarSel} | R Documentation |
This function provides the p-value of an adaptation of the Portmanteau statistic to test if there is some dependence in the rows of the residuals matrix given as an argument of the function.
Description
This function provides the p-value of an adaptation of the Portmanteau statistic to test if there is some dependence in the rows of the residuals matrix given as an argument of the function.
Usage
whitening_test(residuals)
Arguments
residuals |
the residuals matrix obtained by fitting a linear model to each column of the response matrix as if they were independent |
Value
the p-value of a whitening test. If the p-value is small (generally smaller than 0.05) it means that the hypothesis that each row of the residuals matrix is a white noise, is rejected.
Examples
data(copals_camera)
Y <- scale(Y[, 1:100])
X <- model.matrix(~ group + 0)
residuals <- lm(as.matrix(Y) ~ X - 1)$residuals
whitening_test(residuals)
[Package MultiVarSel version 1.1.3 Index]