* * CUSUM test from p 201 * open data consump.dat cal 1950 data(format=prn,org=columns) 1950:1 1993:1 * rls(csum=cusum,csquared=cusumsq,dfhist=dfs) c / rresids # constant y compute rresids(1951:1)= %na * * CUSUM test * stats(noprint) rresids 1952:1 * set cusum = cusum/sqrt(%variance) set upper5 2 44 = .948*sqrt(42)*(1+2.0*(t-2)/42) set lower5 2 44 = -upper5 graph 3 # cusum # upper5 # lower5 * * Post-sample predictive test. The cumulative sum of squares is in the series * cusumsq. While the numerator could also be written more simply as * rresids(1993:1)**2, we write it this way as it will generalize easily to more * than one step. * cdf(title="Post-Sample Predictive Test") ftest $ (cusumsq(1993:1)-cusumsq(1992:1))*(%ndf-1)/cusumsq(1992:1) 1 %ndf-1 * * Phillips-Harvey Modified Von Neumann ratio * diff rresids / drr compute mvnr=%normsqr(drr)*%ndf/(%normsqr(rresids)*(%ndf-1)) cdf(title="Modified Von Neumann Ratio Test for SC") normal .5*sqrt(%ndf)*(mvnr-2) * * Harvey-Collier functional misspecification test. This can be done by just * computing the sample statistics on the recursive residuals and examining the * t-stat and significance level provided therein. Note that the result in the * text is wrong - it was computed by dividing by the square root of T-k, rather * than multiplying by it. * stats rresids 1952:1 1993:1