I am trying to use DLM package in R to estimate a state space repersentation of the term structure model, where observation and state equation are as follows

$y(t )= F* x_t +e_t$
$x_t- \mu = G* (x_{t-1}-\mu) +n_t$

where $e_t$ and $n_t$ are Gaussian. Only modification with standard DLM representation in the R is the term $\mu$ (mean of the state variable) (which is also unknown) in the state equation. I am not sure how to use DLM package to estimate such models.

I would be extremely grateful for the any help in this regard.


It seems to me that your state equation can be writen as $$\pmatrix{x_t \\ \mu_t} = \pmatrix{G & I-G \\ 0 & I}\pmatrix{x_{t-1} \\\mu_{t-1}} + \pmatrix{n_t \\ 0}.$$ The extra element in the state vector will track after some iterations of the Kalman filter the fixed mean $\mu$.

  • $\begingroup$ thanks a lot Tusell ...I got the idea...but I think modification should be $ \pmatrix{G & I-G \\ 0 & I}$ .... $\endgroup$ – Sudarshan Jan 8 '18 at 14:49
  • $\begingroup$ Quite right, my bad. I will edit the answer. $\endgroup$ – F. Tusell Jan 8 '18 at 15:12
  • $\begingroup$ Would it be possible for you to help me on this one as well ....stats.stackexchange.com/questions/322667/… $\endgroup$ – Sudarshan Jan 13 '18 at 5:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.