-------------------------------------------------------------------------------
help for hprescott8
-------------------------------------------------------------------------------

Apply Hodrick-Prescott filter to time series

hprescott8 varlist [if exp] [in range] , stub(newvar) [ smooth(#) ]

hprescott8 is for use in Stata 8.2. Users of more recent versions of Stata should use hprescott, which makes use of Mata.

hprescott8 is for use with time-series data. You must tsset your data before using hprescott8; see help tsset. hprescott8 supports the by prefix, which may be used to operate on each time series in a panel.

varlist may contain time-series operators; see help varlist.

Description

hprescott8 applies the Hodrick-Prescott (1997) filter to one or more time series in varlist which must be under the aegis of tsset. If a panel calendar is in effect, the filter can be applied if a single panel is specified using if or in qualifiers, or with the by prefix. The default smoothing weight of 1600 is applied; this was specified by H-P as appropriate for quarterly macroeconomic data. The filtered series and smoothed series are placed in new variables, specified with the stub() option. The smoothed variables are identified by "_t" in their names. hprescott8 does not allow gaps within the observations of a time series.

Options

stub(abbrev), which must be provided, specifies the "stub" from which new variable names will be created. Variables created by stub must be new variables. If the varlist contains time-series operators, the dots in their names are replaced by underscores so that the resulting new variables' names are legal. smooth(#) specifies the smoothing parameter to be applied. The default is 1600. Ravn and Uhlig (2002) have shown that the smoothing parameter should vary by the fourth power of the frequency observation ratios, so that for annual data a smoothing parameter of 6.25 is recommended, while for monthly data a smoothing parameter of 129,600 is recommended.

Examples

. webuse lutkepohl, clear . hprescott8 investment, stub(HP)

. hprescott8 D.investment D.income D.consumption if tin(1970q1,1979q4), stub(H)

Author

Christopher F. Baum, Boston College, USA baum@bc.edu

References

Hodrick, R. and Prescott, E. (1997). Post-war U.S. business cycles: An empirical investigation. Journal of Money, Credit and Banking, 29(1), 1-16.

Edward C. Prescott, undated. "FORTRAN code for the Hodrick-Prescott filter," QM&RBC Codes 3, Quantitative Macroeconomics & Real Business Cycles at http://ideas.repec.org

Ravn, Morten O. and Harald Uhlig (2002). On adjusting the Hodrick-Prescott filter for the frequency of observations. Review of Economics and Statistics 84(2), 371-376.

Acknowledgements

This routine was translated from FORTRAN code written by Edward C. Prescott, available from http://ideas.repec.org/c/dge/qmrbcd/3.html Thanks to Massimo Giovannini for assistance in validating its results.

Also see

On-line: bking (if installed), tsset