Diffuse filter and smoother
- harmonize tolerance criteria for diffuse likelihood to diffuse smoother
- avoid overwriting global restrict var list in smoother
- fix numerical issues in
schur_statespace_transformation
Merge request reports
Activity
@rattoma I understand the that tolerance criteria for diffuse filter and diffuse smoother should be the same. But looking at the diffuse smoother routines the tolerance parameter
crit1
is set equal to 1e-8 (not 1e-6 as you wrote in commit 511ee537). Also why should we use a hard coded value? We could useoptions_.kalman_tol
(or add a new option if the default value ofkaman_tol
is too small as you suggest). Also, looking at the diffuse filter code (but this not in your commit), it is not clear to me why we should usecrit1
when testing the rank ofPinf
andkalman_tol
when testing the condition number ofFinf
.@stepan-a. Concerning the hardcoded
crit1
I would very much like to add a new option specific for diffuse step, with default 1.e-8. Concerning the tolerance forFinf
:- in the multivariate diffuse filter [which by the way is almost never used in practice, since usually we have a mixture of unit roots and stationary variables in observation equations], you are right that we should always use
crit1
, also for testingFinf
: I did a mistake there. - in the univariate filter, in turn, it makes sense to use
kalman_tol
forFinf
since an individual diagonal term can become small enough to need a tighter tolerance, especially for models with a lot of unit roots [i.e. the univariate diffuse algorithm while killing unit roots one by one can lead to small enough non-zero diagonal terms]. Viceversa, the much biggerPinf
matrix requires the coursercrit1
to avoid numerical noise affecting its rank calculations [I am talking about matrix sizes hundreds x hundreds: for small models this discussion is irrelevant]
By the way, I was the one introducing
crit1
in the smoother a long time ago, which made the diffuse steps work OK for so many years [in the smoother the noise issues are bigger than for the filter, due to the larger number of zero eigenvalues, I address this issue in commit 0336d5e7].- in the multivariate diffuse filter [which by the way is almost never used in practice, since usually we have a mixture of unit roots and stationary variables in observation equations], you are right that we should always use
@rattoma Ok, I understand now. I will change the tolerance parameter in the multivariate diffuse filter, and add an option. I am short of ideas for the name, would
kalman_smoother_tol
be a good name for you?I also noticed that the hard coded values for
crit1
are different in the multivariate and univariate diffuse filter... Is this difference intentional? Should we have two options (for instancekaman_smoother_tol.univariate
andkaman_smoother_tol.multivariate
)?@rattoma Ok, I do that.
Merged manually (fixed bug in 363c4a61 and added new option).