3

I am doing a SVAR (structural vector auto regression) analysis in which I want to plot IRFs (impulse response functions). My time series have length 137 and I only use 3 variables, furthermore I select 1 lag when specifying the VAR model.
Specifying the VAR model works fine, but when I want to summarize it I get the following error message

VAR_reduced <- VAR(VAR_data_1, p = 1, type = "both")
summary(VAR_reduced)

Error in solve.default(Sigma) : 
  system is computationally singular: reciprocal condition number = 1.03353e-16

From what I read in another question this error usually come up when there are not enough observations leading to overfitting, but in my example this should not be a problem, as I have enough observations.

As R does not display an error message if I don't run the summary command it is still possible to calculate the IRFs using:

plot(irf(VAR_reduced, n.ahead = 40))

But, the plot seems rather counter-intuitive, as there is no reaction from any variable other than assets. Therefore, my guess is that the error message hints at something I got wrong but haven't realised yet.

Is this correct, that is do I need to solve that error, or do my IRFs have nothing to do with this?



For completeness here is all the code:

library(quantmod)
library(urca)
library(vars)
library(tseries)
getSymbols('CPILFESL',src='FRED')
getSymbols('INDPRO',src='FRED')
getSymbols('WALCL',src='FRED')
CPI <- ts(CPILFESL, frequency = 12, start = c(1957,1))
output <- ts(INDPRO, frequency = 12, start = c(1919,1))
assets <- as.xts(WALCL)
assets <- to.monthly(assets, indexAt='yearmon', drop.time = TRUE)
assets <- ts(assets[,4], frequency = 12, start = c(2002,12))
assets <- window(assets, start = c(2008,9), end = c(2020,1))
CPI <- window(CPI, start = c(2008,9), end = c(2020,1))
output <- window(output, start = c(2008,9), end = c(2020,1))
loutput <- log(output)
lCPI <- log(CPI)
data_0 <- cbind(loutput, lCPI, assets)
plot(data_0)
VAR_data_1 <- ts.intersect(diff(loutput), diff(lCPI), diff(assets, differences = 2))
VAR_reduced <- VAR(VAR_data_1, p = 1, type = "both")
summary(VAR_reduced)
ArOk
  • 193
  • 7
  • I assume that you only see the error in summary as the inverse of the covariance matrix of the residuals is not computed by the VAR command. It is needed for the standard errors for the coefficient estimates, computed in summary. As to the IRF, it does not seem to be a structural one, right? In that case one would not need the covariance matrix at all, and even if it were, one would only need (depending on the identification scheme), e.g., the Cholesky matrix of the matrix itself, not its inverse. That said, if the inverse cannot be computed, that points to numerical instabilities also w.r.t. – Christoph Hanck Jul 25 '20 at 14:50
  • 1
    the matrix itself. My hunch would be that is due to the hugely different levels of your variables, which are like 8 orders of magnitude apart. You could try rescaling. – Christoph Hanck Jul 25 '20 at 14:51
  • From my understanding (but I am new to this) `irf()` with `ortho = TRUE` (the default) should implement the Cholesky decomposition, thus a SVAR?? Regarding the error message, rescaling did the trick. Thanks! – ArOk Jul 25 '20 at 14:59
  • Yes, that is what `ortho=T` does. BTW, what I wrote about the s.e.s wasn't correct, maybe `summary` needs it for some Wald test. Anyways, glad the issue seems solved. – Christoph Hanck Jul 25 '20 at 19:15

0 Answers0