Trouble with Serial Test in VAR Model: Consistently Low df and p-values

Hello everyone,

I'm working on a VAR (Vector Autoregression) model using R, and I'm running into some issues with the serial test of the residuals. I am using the vars package for my analysis.

After fitting the VAR model for different lag lengths, I perform a serial correlation test (serial.test() function in vars package) to evaluate the model. Oddly enough, every test comes back with a degrees of freedom (df) value of 0 and a very low p-value, which seems to suggest that there is a serious issue with the model.

Here is the R code snippet I am using for the VAR model and the serial test:

Fitting VAR model

var_fits_reduced <- list()
max_lag_reduced <- 30
for (p in 2:max_lag_reduced) {
var_fits_reduced[[p - 1]] <- VAR(data_reduced, p = p, type = "both")
}

Serial correlation test

serial_tests_reduced <- list()
for (i in 1:length(var_fits_reduced)) {
serial_tests_reduced[[i]] <- serial.test(var_fits_reduced[[i]], lags.pt = var_fits_reduced[[i]]$p)
print(paste("Serial test for lag", var_fits_reduced[[i]]$p))
print(serial_tests_reduced[[i]])
}

Here is an example of one of the test results:
Portmanteau Test (asymptotic)
Chi-squared = 1.7954, df = 0, p-value < 2.2e-16

I've double-checked the data for stationarity and other potential issues but can't seem to find the source of the problem.

  1. Has anyone else encountered this issue?
  2. What might be causing this?
  3. Are there any solutions or alternatives to investigate?

I appreciate any help or insights you can offer. Thank you in advance!

Without a reprex (see the FAQ including this, it's hard to offer much of anything useful.

Sorry, what do you mean?

Click on the link @technocrat posted.

1 Like

@technocrat Hi, may I ask you if would be possible to contact you privately?

Sure, send a DM and we can trade email

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.