------------------------------------------------------------------------------- help forbutterworthSSC distribution 03 July 2006 -------------------------------------------------------------------------------

Apply Butterworth square-wave highpass filter to time series

butterworthvarlist[ifexp] [inrange],freq(#)stub(abbrev)[order(#)]

You must

tssetyour data before usingbutterworth; see helptsset. 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 thebyprefix.

varlistmay contain time-series operators; see helpvarlist.

butterworthfilters one or more time series using the Butterworth square-wave highpass filter described in Pollock (2000). Thefreq()argument specifies the minimum period of oscillation of the desired component of the time series, where 2 <freq< infinity. Theorder()of the filter may also be chosen; if not specified, it defaults to 2.

Optionsfreq(#)specifies the minimum period of oscillation, in periods per cycle, to be retained in the time series, and must be given. It must be greater than 2 (the reciprocal of the Nyquist frequency). Higher-frequency components of the series will be returned in the filtered series.

stub(abbrev), which must be provided, specifies the "stub" from which new variable names will be created. Variables created bystubmust be new variables. If thevarlistcontains time-series operators, the dots in their names are replaced by underscores so that the resulting new variables' names are legal.

order(#)specifies the order of the filter. If not specified, it defaults to 2.

Examples. webuse lutkepohl,clear

. butterworth investment, freq(6) phi stub(F)

. butterworth investment income consumption, freq(12) stub(filt)

. butterworth D.investment, freq(4) order(3) stub(fl)

. use http://fmwww.bc.edu/ec-p/data/hayashi/sheston91.dta,clear

. drop if country>4

. tsset

. by country: butterworth rgdppc, freq(3) stub(SBY)

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

Martha Lopez, Boston College, USA lopezmo@bc.edu

ReferencesD.S.G. Pollock, Trend estimation and de-trending via rational square-wave filters, Journal of Econometrics, 2000, 99, 317-334. Pawel Kowal (2005). MATLAB implementation of commonly used filters, http://ideas.repec.org/c/wpa/wuwppr/0507001.html

AcknowledgementsThe Mata code of this routine was translated from MATLAB code made available by Pawel Kowal (2005).

Also seeOn-line: hprescott (if installed), bking (if installed), cfitzrw (if installed), tsset