For example, let us say that we have a 3-variable VAR system, originally ordered realGDP, realcons, and realinv, contained within the VARResults class 'res'. Reordering the variables in the system is as simple as follows:
In : import scikits.statsmodels.api as sm In : import numpy as np In : mdata = sm.datasets.macrodata.load().data In : mdata = mdata[['realgdp','realcons','realinv']] In : names = mdata.dtype.names In : data = mdata.view((float,3)) In : from scikits.statsmodels.tsa.api import VAR In : res = VAR(data, names=names).fit(maxlags=3,ic=None) In : res.names Out: ['realgdp', 'realcons', 'realinv'] In : res_re = res.reorder(['realinv','realcons','realgdp']) In : res_re.names Out: ['realinv', 'realcons', 'realgdp']
The reorder function reuses all of the results from the original VAR class, but rearranges them to be in line with the new system. If working with large a # of observations, the computational advantage becomes useful pretty quickly. For example, with a 100,000 observation system with three variables, re-estimating the system after changing the variable order took 3.37 seconds, while using the reorder function took 0.57 seconds.
In the next few weeks I am planning on adding more impulse response function error band estimation methods. The current package only includes analytical error bands.