[R] Rolling window VAR (vector autoregressive) estimation

Wesley Burnett burnettwesley at gmail.com
Thu Feb 5 04:15:40 CET 2015


Hi,

I am completely new to R. I have a dataset of several thousand, weekly observations with ten variables. I would like to create a program (algorithm) that does a rolling window VAR regression of window width "w" (for example, a window width of 200 weeks) for all of the variables within the model. The best package I can find to execute VAR regressions seems to be the "vars" package (http://cran.r-project.org/web/packages/vars/index.html). For my algorithm, I would like to retreive certain objects from the class "varest" generated by the "vars" package after a call to "VAR."  More specifically, within each rolling window I'm interested in retreiving a matrix of the variance-covariance residuals and a matrix of the estimated coefficients for the lagged endogenous variables.

There are several examples within this discussion board about estimating rolling window regressions with linear regression models, but I have not been able to find any algorithms for rolling window regressions with a more complicated regression like the vector autoregressive model.

As I have several thousand observations, I would appreciate advise on creating efficient algorithms to execute the rolling window regression for this VAR execution.

Thanks,

Wesley


More information about the R-help mailing list