homotopy_setup — declare initial and final values when using homotopy method
homotopy_setup
;
VARIABLE_NAME
, EXPRESSION
[, EXPRESSION
];... end
;
The idea of homotopy (also called divide-and-conquer by some authors) is to subdivide the problem of finding the steady state into smaller problems. It assumes that you know how to compute the steady state for a given set of parameters, and it helps you finding the steady state for another set of parameters, by incrementally moving from one to another set of parameters.
The purpose of the homotopy_setup block is to declare the final (and possibly also the initial) values for the parameters or exogenous that will be changed during the homotopy. In the first syntax where only one value is specified for a given parameter/exogenous, then this value is interpreted as the final value, and the initial value is taken from the preceeding initval block. In the second syntax where two values are specified for a given parameter/exogenous, the first is the initial one, the second is the final one.
A necessary condition for a successful homotopy is that Dynare must be able to solve the steady state for the initial parameters/exogenous without additional help (using the guess values given in the initval block).
If the homotopy fails, a possible solution is to increase the number of steps (given in homotopy_steps
option of steady).
In the following example, Dynare will first compute the steady state for the initial values (gam=0.5
and x=1
), and then subdivide the problem into 50 smaller problems to find the steady state for the final values (gam=2
and x=2
).
var c k; varexo x; parameters alph gam delt bet aa; alph=0.5; delt=0.02; aa=0.5; bet=0.05; model; c + k - aa*x*k(-1)^alph - (1-delt)*k(-1); c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam); end; initval; x = 1; k = ((delt+bet)/(aa*x*alph))^(1/(alph-1)); c = aa*x*k^alph-delt*k; end; homotopy_setup; gam, 0.5, 2; x, 2; end; steady(homotopy_mode = 1, homotopy_steps = 50);