WIP: matched_moments interface
As discussed in dynare#1724 (closed), I would like to have an interface for specifying the chosen moments used in a method of moments (GMM, SMM, IRF matching) estimation. I have given this a try in this Merge Request, but it is not perfect yet, and I need some help here. Right now with this merge request the following happens:
When a user specifies an matched_moments
block in a mod file, e.g.
matched_moments;
%contemporenous autocovariances
YGR , YGR;
YGR , INFL;
YGR , INT;
INFL, INFL;
INFL, INT;
INT , INT;
%some chosen autocovariances
YGR , INT(-1);
YGR , INFL(-2:-1);
YGR , INT(1);
end;
the preprocessor creates the following structure in the driver.m
:
matched_moments_ = {
'YGR', 'YGR', 0,
'YGR', 'INFL', 0,
'YGR', 'INT', 0,
'INFL', 'INFL', 0,
'INFL', 'INT', 0,
'INT', 'INT', 0,
'YGR', 'INT', -1,
'YGR', 'INFL', -2:-1,
'YGR', 'INT', 1,
};
So far so good, but actually, I would like to also declare first moments in the same block. For this I would need some help from e.g. @sebastien or @stepan-a . So, basically, I would like to have this:
matched_moments;
%first moments
YGR;
INFL;
INT;
%contemporenous autocovariances
YGR , YGR;
YGR , INFL;
YGR , INT;
INFL, INFL;
INFL, INT;
INT , INT;
%some chosen autocovariances
YGR , INT(-1);
YGR , INFL(-2:-1);
YGR , INT(1);
end;
which should create the following structure in the driver:
matched_moments_ = {
'YGR', [], [],
'INFL', [], [],
'INT', [], [],
'YGR', 'YGR', 0,
'YGR', 'INFL', 0,
'YGR', 'INT', 0,
'INFL', 'INFL', 0,
'INFL', 'INT', 0,
'INT', 'INT', 0,
'YGR', 'INT', -1,
'YGR', 'INFL', -2:-1,
'YGR', 'INT', 1,
};
Of course, I am open to other suggestions. For instance, in dynare#1724 (closed), @stepan-a proposes a different interface which is more general, but (IMHO) probably harder to implement.