Skip to content
Prev 82934 / 398513 Next

Kalman Filter Forecast using 'SSPIR'

I will herein outline the basics of Kalman forecasting.  I have never 
used sspir, and I can't find all the hooks now to produce a forecast. 
Perhaps with this outline, you will be able to figure it out yourself, 
possibly by reading the code for some of the sspir functions.

	  The demo(vandriver) produces an "Extended" "SS" object "vd".  When I 
try to print that model, it begins by reporting the following:

The state space model is given by

Y_t     = F_t^T %*% theta_t     + v_t, v_t ~ N(0,V_t)
theta_t = G_t   %*% theta_{t-1} + w_t, w_t ~ N(0,W_t)

for t=1,...,192

	  Kalman filtering can be described as Bayesian sequential updating, 
where the prior for the state for observation Y[t] is theta[t] ~ 
N(theta[t|t-1], Sig.theta[t|t-1]).  Observation Y[t] is combined with 
this prior to produce the posterior N(theta[t|t], Sig.theta[t|t]).  From 
this point, the forecasted distribution for theta[t+1] is 
N(theta[t+1|t], Sig.theta[t+1|t]), where

      theta[t+1|t] = G_t %*% theta[t|t]
and
      Sig.theta[t+1|t] = (G_t) %*% Sig.theta[t|t] %*% t(G_t) + W_t.

	  You can repeat this step any number of times to get N(theta[t+j|t], 
Sig.theta[t+j|t] for any j.  With this, the forecast for Y[t+j] in the 
normal linear framework is N(F[t+j]^T %*% theta[t+j|t], Sig.y[t+j|t]) where

      Sig.y[t+j|t] = t(F[t+j]) %*% Sig.theta[t+j|t] %*% F[t+j] + V[t+j]

	  This outline seems consistent with all the references on Kalman / 
state space with which I'm familiar, though the notation may be a little 
different.  For more details including references, you can consult the 
"Foundations of Monitoring" material at "www.prodsyse.com".

	  If you would still like help from this listserve, please submit 
another post -- preferably after reading the posting guide! 
"www.R-project.org/posting-guide.html".  Anecdotal evidence suggests 
that posts more consistent with that guide tend to get quicker, more 
useful replies.

	  hope this helps.
	  spencer graves

--
Sumanta Basak wrote: