1.1. Restrictions on parameters during estimation
Sometimes we need to set additional restrictions on parameters during estimation. For instance, in a regime switching model, one may need a normalization assumption in order to label the states. All kinds of functions of both estimated and non-estimated parameters are allowed as long as those functions are known to Matlab or on the Matlab path.
There is a way of setting these restriction in the model file of a DSGE model. However, setting these restrictions outside the model file as is done below should be preferred.
In this case, the restrictions are organized in a cell array
restrictions={
'f1(theta)>=f2(theta)'
...
'h1(theta)<=h2(theta)'
};
and passed along to the model object using option estim_nonlinear_restrictions. See the section on estimation for more detail.
Each restriction is turned into a value that is violated when it is
positive. <= and >= accept equality (to within eps), and <
and > do not: a point on the boundary of a strict inequality violates it,
by eps. The penalty of so small a violation is negligible for an
optimizer, which searches a closed set in any case, but the point is not
admissible for the checks that ask whether a restriction holds (a starting
value, a draw). Where equality should be allowed, write <= or >=.
1.1.1. Ordering constraints for the posterior samplers
A restriction that compares two estimated parameters directly, such as
'mu_regime_1<mu_regime_2' or 'a>=b', is also an ordering constraint:
pull_objective returns it in its constraints output, and the posterior
samplers enforce it by relabeling, swapping the two values whenever a draw
puts them in the wrong order. Relabeling is valid for exchangeable parameters
only, for instance one parameter across regimes: their priors and their bounds
must be the same. pull_objective refuses an ordering constraint between
parameters whose priors or bounds differ (error
rise:estimation:constraintsNotExchangeable). An inequality between other
parameters is written as a general restriction, for instance 'b-a>=0',
which is not an ordering constraint.