# Joint evolution using VAR model and pairwise correlation plot in R

I have data for three commodities for which I conducted a time series analysis using VARselect and VAR functions in "vars" package in R.

• How do I describe their joint evolution using the VAR model?
• Also, I know how to generate scatter plots for pairwise correlation but would like to know how to create pair-wise correlation plots using a three-month window for the data?

## 1 Answer

I think you may find this link helpful regarding the interpretation of VAR models.

As windows, you can do this using the window function of the ts{} package. Create a time series object, and then a window using

foo_ts <- ts(data, start = c(2000, 1), end = c(2016, 1))
foo_window <- window(data, start = c(2002, 1), end = c(2005, 1)


To make correlograms, one package that makes pretty plots is corrplot. Make a dataframe of your time series windows, and try using

corrplot.mixed(dataframe)


This is a great website for that package.

Alternatively, you could use the corrgram package, in which case

corrgram(dataframe, order=NULL, lower.panel=panel.pts, upper.panel=NULL)


might give what you're looking for.

• I have daily data for 10 years so does a 3-month window mean that I need to convert that into quarterly data by setting frequency as 4? Jul 5, 2016 at 8:50
• For daily data over a long period, frequency = 7 is a good place to start. You could also make a multiple seasonality ts object, as seen here Jul 5, 2016 at 12:35