Hallo,
I want to use the DLM-function to perform the E-step in an EM-algorithm. In my M-step I need to compute E[f_t*f_t-1'] at one point (f_t is the vector of states). Is there an easy way to get Cov(f_t,f_t-1') from DLM?
Best regards, Jonas
Covariances from DLM
Re: Covariances from DLM
Since the state equation is f(t)=Af(t-1)+Fw(t) and f(t-1) and w(t) are uncorrelated by construction, Ef(t)f(t-1)'=AEf(t-1)f(t-1)'. If there are no unit or unstable roots in A, then Ef(t-1)f(t-1)' is just the ergodic variance for the state space model, which you can compute with %PSDINIT or %DLMINIT.