I am using DLM to fit a state space model. The covariance matrix of states (W) is given by:
a 0 a 0
0 0 0 0
a 0 a 0
0 0 0 0
where a is a parameter to be estimated. Even though the matrix is positive semidefinite, sometimes DLM gives me an error that W is not a valid variance matrix. As far as I can tell, the reason is that one of R's computed eigenvalues is very slightly negative (something like -5E-17). Is there a way to work around this?
Thanks!
Rebecca