| MVWNtest {FCVAR} | R Documentation |
Multivariate White Noise Tests
Description
MVWNtest performs multivariate tests for white noise.
It performs both the Ljung-Box Q-test and the LM-test on individual series
for a sequence of lag lengths.
summary.MVWN_stats prints a summary of these statistics to screen.
Usage
MVWNtest(x, maxlag, printResults)
Arguments
x |
A matrix of variables to be included in the system, typically model residuals. |
maxlag |
The number of lags for serial correlation tests. |
printResults |
An indicator to print results to screen. |
Value
An S3 object of type MVWN_stats containing the test results,
including the following parameters:
QA 1xp vector of Q statistics for individual series.
pvQA 1xp vector of P-values for Q-test on individual series.
LMA 1xp vector of LM statistics for individual series.
pvLMA 1xp vector of P-values for LM-test on individual series.
mvQA multivariate Q statistic.
pvMVQA p-value for multivariate Q-statistic using
p^2*maxlagdegrees of freedom.maxlagThe number of lags for serial correlation tests.
pThe number of variables in the system.
Note
The LM test is consistent for heteroskedastic series; the Q-test is not.
See Also
FCVARoptions to set default estimation options.
FCVARestn produces the residuals intended for this test.
LagSelect uses this test as part of the lag order selection process.
summary.MVWN_stats prints a summary of the MVWN_stats statistics to screen.
Other FCVAR postestimation functions:
FCVARboot(),
FCVARhypoTest(),
GetCharPolyRoots(),
plot.FCVAR_roots(),
summary.FCVAR_roots(),
summary.MVWN_stats()
Examples
opt <- FCVARoptions()
opt$gridSearch <- 0 # Disable grid search in optimization.
opt$dbMin <- c(0.01, 0.01) # Set lower bound for d,b.
opt$dbMax <- c(2.00, 2.00) # Set upper bound for d,b.
opt$constrained <- 0 # Impose restriction dbMax >= d >= b >= dbMin ? 1 <- yes, 0 <- no.
x <- votingJNP2014[, c("lib", "ir_can", "un_can")]
results <- FCVARestn(x, k = 2, r = 1, opt)
MVWNtest_stats <- MVWNtest(x = results$Residuals, maxlag = 12, printResults = 1)
set.seed(27)
WN <- stats::rnorm(100)
RW <- cumsum(stats::rnorm(100))
MVWN_x <- as.matrix(data.frame(WN = WN, RW = RW))
MVWNtest_stats <- MVWNtest(x = MVWN_x, maxlag = 10, printResults = 1)