wbnicholson / BigVAR

Dimension Reduction Methods for Multivariate Time Series
56 stars 17 forks source link

BigVAR.fit not respecting VARX$contemp = FALSE #29

Closed jonlachmann closed 2 years ago

jonlachmann commented 2 years ago

When I use BigVAR.fit to fit a model, I may have a VARX list on the form list(k=2, s=1, s1=0, contemp=FALSE). Then, BigVAR.fit will run the following code:

if (!is.null(VARX$contemp)) {
  contemp <- TRUE
  s1 <- 1
} else {
  contemp <- FALSE
  s1 <- 0
}

This will then, erroneously set contemp to TRUE, and the accompanying parameter s1 to 1. I would expect it to respect that I have chosen to not have contemporaneous interaction of the exogenous variables if I set it to FALSE.

Another question, which relates to this, is why does EFX not support contemp=TRUE?

jonlachmann commented 2 years ago

The same behavious is expressed in the function VARXConsModel, which to be fair is just an internal function, but something I sometimes end up using to modify a BigVAR model object.

wbnicholson commented 2 years ago

Thanks, this has been fixed.

Regarding EFX not supporting contemp=TRUE, my reasoning was that since the EFX shrinks from a VARX to a VAR it didn't make sense to allow contemporaneous exogenous coefficients since there is no corresponding VAR coefficient to shrink toward.

jonlachmann commented 2 years ago

Nice! Thank you!

And that explanation makes sense, thanks!