Solved – the best model for time series data with independent and dependent variables

rtime seriesvector-autoregression

I have two different variables across a time series over a couple thousand time steps. I want to predict the values of the dependent variable (y) based values of the independent variable (x) in the future. I have been using a VAR model in R from the vars package. The problem here seems to be that the VAR model predicts both x and y and treats the future time steps as the independent variable. What is the appropriate model or method to use predict y in the future given x?

Best Answer

The documentation for the vars package vignette describes Impulse / Response Analysis as the last step. This sounds like what you are looking for. They end with unemployment predicted by the other variables with the command:

svec.irf <- irf(svec, response = "U", n.ahead = 48, boot = TRUE)

"irf" is an acronym for Impulse Response Function.

There is also a wiki page with a general introduction for several disciplines. My guess is that the one on Economics might be closest to what you want.