Computation of Composite Parameters


What is the difference between using the two options for computing a composite parameter betaP:

  1. in *.mod file # betaP = 1/(1+betta_rateP/100);
  2. in *_steadystate.m file
betaP = 1/(1+betta_rateP/100);
idx_betaP= strmatch(betaP',M_.param_names,'exact');
M_.params(idx_betaP) = betaP;

I think the two options are quivalent. Here, I on purpose made a simple example. But one could have a more complicated composite parameter expressed in terms of some steady state ratios targeted in calibration, or in terms of some other parameters that could be estimated by Bayesian estimation.

Thank you!

For practical purposes, it is mainly a matter of convenience. In both cases, you end up with a parameter computed as a composite of other parameters. However, there are slight differences. If you define an expression with # betaP, Dynare treats this as a local variable, but does not create a parameter betaP that would be stored in M_.params (you don’t define betaP in the params-block). The Dynare preprocessor upon running the model-file effectively substitutes the righthand side of this expression for every occurence of the lefthand side, thereby eliminating it altogether. Hence, this local variable is not available outside the model-block.

In contrast, if defined in the steady state file, betaP is treated as a regular parameter (which you thus have to declare in the params-block). Sometimes it is convenient to be able to directly assess the resulting parameter after Dynare has run. In this case, using the second version may be better.

Moreover, computing such a parameter in the steady state file is convenient, if you have to compute it in any case just to compute your steady state. This is because the local variable betaP created with # betaP cannot be accessed in the steady state file. You would have to compute it again if you want to use it in the steady state file.