function [s,d]=hpfilter(y,w) % Hodrick-Prescott filter where: % w - smoothing parameter; w=1600 for quarterly data % y - the original series that has to be smoothed % s - the filtered series % d = y-s if size(y,1)