kaushikrch / rucm

Implementation of Unobserved Components Models (UCM) in R
3 stars 3 forks source link

Controlling tolerance parameter in SSModel to control for degenerate models or numerical errors #6

Open RajarshiBhadra opened 8 years ago

RajarshiBhadra commented 8 years ago

Often ucm is accompanied with the warning message

In KFS(modelH, filtering = "state", smoothing = "state") : Model is degenerate, diffuse phase did not end.

OR

In KFS(modelH, filtering = "state", smoothing = "state") : Possible error in diffuse filtering: Number of nonzero elements in Finf is not equal to the number of diffuse states. Either model is degenerate or numerical errors occured. Check the model or try changing the tolerance parameter tol or P1/P1inf of the model

This can be controlled by the tol parameter in SSModel which by default is .Machine$double.eps^0.5

Users of rucm can be given independence to assign tolerance parameter values according to their data types so as to control for degenerate models or numerical errors in SSModel

timvink commented 6 years ago

Hee @RajarshiBhadra I added the tolerance parameter in https://github.com/kaushikrch/rucm/pull/11 (rucm 0.6.1, not published on CRAN yet). Does that solve this issue?