Gretl Manual: Gnu Regression, Econometrics and Time-series Library | ||
---|---|---|
Prev | Chapter 5. Special functions in genr | Next |
One sort of specialized function in genr is the time-series filter. Two such filters are currently available, the Hodrick–Prescott filter and the Baxter–King bandpass filter. These are accessed using hpfilt() and bkfilt() respectively: in each case the function takes one argument, the name of the variable to be processed.
To be written.
Consider the spectral representation of a time series yt:
if we wanted to extract only that component of yt that lies between the frequenciesIn practice, the filter is normally used with monthly or quarterly data to extract the "business cycle" component, namely the component between 6 and 36 quarters. Usual choices for k are 8 or 12 (maybe higher for monthly series).
The default values for the frequency bounds are 8 and 32, and the default value for the approximation order, k, is 8. You can adjust these values using the set command. The keyword for setting the frequency limits is bkbp_limits and the keyword for k is bkbp_k. Thus for example if you were using monthly data and wanted to adjust the frequency bounds to 18 and 96, and k to 24, you could do
set bkbp_limits 18 96 set bkbp_k 24
These values would then remain in force for calls to the bkfilt function until changed by a further use of set.