*
* Calculation of one-step-ahead predictions for the variance (bottom
* panel in figure 3). This weights the variance calculations in the
* branches by the predictions of the probabilities of the branches at t
* given t-1.
*
function OneStepVariance time
type real OneStepVariance
type integer time
*
compute OneStepVariance=0.0
do i=1,nexpand
compute h=1.0
do k=1,q
compute h=h+a(k)*uu(time-k)/gv(%MSLagState(i,k))
end do k
compute h=h+d0*%if(u(time-1)<0.0,uu(time-1)/gv(%MSLagState(i,1)),0.0)
compute OneStepVariance=OneStepVariance+h*gv(%MSLagState(i,0))*pt_t1(time)(i)
end do i
end
*
set sigmahat gstart gend = sqrt(OneStepVariance(t))
set lower = -2.0*sigmahat
set upper = +2.0*sigmahat
*
spgraph(vfields=2,footer="Figure 3 (Top and Bottom Panels)")
graph(hlabel="Return")
# y
graph(hlabel="SWARCH-L(3,2)") 2
# upper
# lower / 1
spgraph(done)Return to Structural Breaks and Switching Models
Users browsing this forum: No registered users and 1 guest