You are on page 1of 1

xlsread('GDP')

RGDP=log(ans)
t=(1:264)'
plot(t, RGDP)
title('US Quarterly Real GDP')
axis([0 264 0 10])
int=ones(264,1)
X=[int t]
B=regress(RGDP,X)
B2=
residuals=RGDP-X*B
plot(t, residuals)
title('Residual plot US Quarterly Real GDP')
axis([0 264 -0.4 0.4])
Ylag=residuals([1:263],1)
Y=residuals([2:264],1)
i=ones(263,1)
Ylagint=[i Ylag]
phi=regress(Y,Ylagint)
hpfilter(RGDP,1600)
plot(t,RGDP)
title('HPfilter detrend')
axis([0 264 5 10])

You might also like