boosted Hodrick-Prescott filter
[hpy,res]=boosted_HP(namex,lambda,test_type,max_iter,sig_p)
* namex = either
. a time series, or
. a real (n x 1) vector, or
. a string equal to the name of a time series or a (n x 1) real vector between quotes
* lambda = the smoothing parameter
* test_type = the methodology used to make the series stationary ('adf' or 'bic')
* max_iter = Maximum number of iterations
* sig_p = the p-level of the adf test (0.01, 0.05 or 0.1)
* hpy= the smoothed filtered series of the same type than y (if y is not a string) or evstr(y) (if y is a string)
* res = a results tlist with:
- res('meth') = 'boosted HP'
- res('y') = the values of the input series
- res('name y') = the name of the input series
- res('crit') = the criterion used to end the iterations ('adf' of 'bic')
- res('filtered y') = a vector, the values of the estimated trend
- res('p level') = the p-value used to test the stationarity of the data ('adf' case)
- res('adf t-stat') = the vector of successive t-stat of the adf ('adf' case)
- res('adf crit') = the critical value of the adf t-stat at the entered p-value ('adf' case)
- res('bic values') = the vector of successive bic criterion values
// reproduces the upper panel of figure 7 in Phillips and Shi global GROCERDIR laod(GROCERDIR+'\data\ire_gdp.dat') // perform the boosted hp filter with adf option [hpy2]=boosted_HP(IRE_GDP,100,'adf',1000,0.05) // perform the boosted hp filter with bic option [hpy3]=boosted_HP(IRE_GDP,100,'bic',1000) | ![]() | ![]() |