Post-Sample predictive test in State Space Model Again

Discussion of State Space and Dynamic Stochastic General Equilibrium Models
Jennylai
Posts: 35
Joined: Sun Feb 08, 2009 8:40 pm

Post-Sample predictive test in State Space Model Again

Unread post by Jennylai »

Dear Tom,

Last time I used the code below to calculate the post sample prediction errors:

smpl 2008:02 2008:10
*
* Then we put the dummy variable for out-of-sample back on track.
*
dec frml[rect] cof
frml cof = c~~%zeros(1,1)~~forcn{1}
*
dlm(y=FDI,a=a,c=cof,sv=sigmastar,sw=sw*sigmastar,x0=xstates(2008:01),sx0=vstates(2008:01),$
type=filter,vhat=vps,svhat=svps) 2008:02 2008:10
*
* calculate the out-of-sample one-step-ahead prediction error eohat ('o' stands for 'out-of-sample').
*
set svps1 = svps(t)(1,1)
set vps1 = vps(t)(1)
set eohat = vps1/sqrt(svps1)
print / eohat vps1 svps1

sstats 2008:2 2008:10 eohat**2>>denom1
sstats 2000:4 2005:11 eehat**2>>numer11
sstats 2006:1 2008:1 eehat**2>>numer12
compute numer1=numer11+numer12

compute denom = denom1/9
compute numer = numer1/93

compute fstat = denom/numer
cdf(title='post-sample predictive test') ftest fstat 9 93


But when I check back on the book by Harvey(1989) P147 and P271, it seems that I should calculate the post sample prediction error without the "y=FDI" information for the out-of-sample one-step-ahead prediction error calculation.

And I tried to delete 'y=FDI' from DLM, but it does not work. If I want to do just Kalman Filtering Predicting process (the first two equations of kalman filtering process listed on User's Guide version 7 Page 439 Chapter 12.2) , how should I proceed?

Thank you very much!
Post Reply