VAR Forecast Error Method and High-Pass Filter MethodNOTE: Other programs on this website should not need to be edited and should be executed as is.High-Pass Filter Method
- infile-File name where data is stored (character string)
- methodology-Indicator variable that selects which method will be used
- forecastrange-Range of forecast horizons/periodicities for which you wish to calculate results
VAR Forecast Error Method
- truncparam-Truncation parameter for the high-pass filter method
- nlags-Maximum number of lags to use in selecting the best VAR
- infocrit-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 VARs
- ciyes-Boolean (0 or 1) indicating whether confidence intervals should be calculated for the estimated correlation
- numreplic-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 named infile ), 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 variable unitroot has 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 variable nlags defines how many lags will be allowed in the various VAR specifications. For example, if nlags=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 by infocrit), 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 input forecastrange, 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 by numreplic) 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 variables truncparam and forecastrange, and the data (stored in the file named infile), the program filters the data to take out the portion of the time-series associated with a periodicity greater than the forecastrange for each value of forecastrange. 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).