Kalman filter conceptual question

I'm using the function dlmGibbsDIG (Gibbs sampler) in the dlmpackage from R to estimate the unknown variances. The output are the unknown variances together with the (saved) sampled states.

Then the dlmFilter function performing the kalman filter only need as arguments the observations and the specified model (with the averaged variances gived by the output of dlmGibbsDIG) but I'm confused about the role of the thetas (states) simulated by the Gibbs sampler above.

• I'm not sure exactly what you're after. The states are often (but not always) unknown parameters of interest in your problem. – Glen_b Jun 9 '14 at 21:11
• @Glen_b this is the case since I'm using a regression DLM but for me it's not straightforward that we only pass the estimated variances for the kalman filter. – nopeva Jun 10 '14 at 7:21
• I'm sorry, it's still not clear to me what the difficulty is. – Glen_b Jun 10 '14 at 8:13
• @Glen_b well I was asking basically if the thetas in the output of the Gibbs sampler are of any use. – nopeva Jun 10 '14 at 8:18
• @AP13 whether they are of use is up to you. I have given you what they are, i.e. $p(x|\theta_i)$ which you obtain by running the Kalman filter at every iteration of the MCMC chain. The rest is up to you, unless you have a further question – gregory_britten Jun 11 '14 at 18:34

1 Answer

Every time you sample the prior $p(\theta_i)$ you then run the Kalman filter and obtain $p(x|\theta_i)$ - i.e. the distribution of the $\textit{states}$, conditional on the current value of $\theta$.