comovement with VAR forecast errors and frequency domain filters

These programs were written by Steve Sumner with support of NSF grant 9708587.

These files will need to be downloaded from this website. In addition to these programs the user will also need to provide a data file. This file is assumed to contain two columns of data (one column for each time-series) and cannot accommodate larger files with more than two time-series.

VAR Forecast Error Method and High-Pass Filter Method

infile-File name where data is stored (character string)methodology-Indicator variable that selects which method will be usedforecastrange-Range of forecast horizons/periodicities for which you wish to calculate resultsHigh-Pass Filter Method

truncparam-Truncation parameter for the high-pass filter methodVAR Forecast Error Method

nlags-Maximum number of lags to use in selecting the best VARinfocrit-Criterion to use in choosing the best VAR ('aic' or 'bic')unitroot-Boolean (0 or 1) indicating whether a unitroot should be imposed in the estimation of the VARsciyes-Boolean (0 or 1) indicating whether confidence intervals should be calculated for the estimated correlationnumreplic-Number of simulated economies to be used in the confidence interval calculation

Method 1 (VAR Forecast errors):

Given the user-defined variables and the data (stored in the file namedinfile), the program estimates several VARs and chooses the best fitting model using the user-specified model selection criterion (infocrit). Before VAR estimation the data is differenced if the variableunitroothas been set to equal one. If this is the case then one observation is lost. In the estimation of the VAR, the program always includes a constant and imposes that the number of lags in each variable (equation) must be the same. When the estimation is performed in levels of the variables (unitroot=0), in addition to the specification with only a constant, alternative specifications with a linear trend and a quadratic trend are considered. For the VARs where the data has been differenced (unitroot=1), only the linear trend alternative specification is considered. Finally, the variablenlagsdefines how many lags will be allowed in the various VAR specifications. For example, ifnlags=5, and unitroot=0, then a total of 15 VARs would be estimated. Three VARs would be estimated for each possible number of lags, one to five. For each number of lags, the three specifications would be a constant, a constant and linear trend, and a constant, linear trend and quadratic trend.

After selecting the 'best' model using either the aic or bic model selection criterion (as defined byinfocrit), the estimated coefficients and the variance-covariance matrix of the error terms are used to calculate the correlations of the VAR forecast errors at various forecast horizons. The forecast horizons are obtained from the user inputforecastrange, which is a vector of numbers indicating the forecast horizons for which the correlations should be calculated.

Finally, should the user so choose (ciyes=1), then confidence intervals will be calculated for the estimated correlations using a bootstrapping technique (see Hamilton, Time-Series Analysis, pgs. 337-338). This technique creates simulated economies (the number of economies is defined bynumreplic) from the fitted residuals and the estimated VAR system and then re-calculates the statistics of interest. Confidence intervals can then be inferred from these results.

Method 2 (High-Pass Filter):

Given the user-defined variablestruncparamandforecastrange, and the data (stored in the file namedinfile), the program filters the data to take out the portion of the time-series associated with a periodicity greater than theforecastrangefor each value offorecastrange. The correlation of the two filtered time-series is then calculated (see den Haan, NBER working paper #5553, 1996 for a more detailed explanation of the filter).