Add interface to set zero_moments_tolerance
Useful in identification
and method_of_moments
to set the tolerance which replaces very small numbers by hard zeros in unconditional second moments. Merge request for that will follow after this is merged in the preprocessor.
Merge request reports
Activity
changed milestone to %5.x
added macroprocessor label
Actually there is a
cutoff
option to themodel
block which serves a similar purpose: it is used to determine the threshold under which a numerically small derivative is considered as a real zero (and thus that the corresponding variable does not enter the equation in the block decomposition).I wonder whether we should reuse that name, even though it would be in a slightly different context?
Edited by Sébastien VillemotI don't really mind, but
cutoff
is declared a<DYNARE_BLOCK>cutoff {return token::CUTOFF;}
, whereas the proposedzero_moments_tolerance
is a<DYNARE_STATEMENT>zero_moments_tolerance {return token::ZERO_MOMENTS_TOLERANCE;}
. Also, indisp_moments.m
we already usezero_moments_tolerance
, which does exactly the same to what I want to do inpruned_state_space.m
. So I would rather stick withzero_moments_tolerance
if that is okay with you?Edited by Willi MutschlerThe block vs statement thing is easy to solve technically. And the already existing
zero_moments_tolerance
is not user-visible (it is not part of the.mod
language).But I agree that the name you propose is more explicit than
cutoff
. And that both options do not serve exactly the same purpose. So I'll merge this.mentioned in commit 50782694