Commit f7cf75a2 authored by MichelJuillard's avatar MichelJuillard
Browse files

fixed problems with trying to make homotopy robust to problems in one run.

parent ad377c6e
......@@ -81,7 +81,8 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
end
else
% block or bytecode
[ys,check] = dynare_solve_block_or_bytecode(ys_init,exo_ss, params, options, M);
[ys,check] = dynare_solve_block_or_bytecode(ys_init,exo_ss, params, ...
options, M);
end
if check
......
......@@ -77,5 +77,12 @@ for i=1:step_nbr+1
oo_.exo_steady_state(values(ix,2)) = points(ix,i);
oo_.exo_det_steady_state(values(ixd,2)) = points(ixd,i);
oo_.steady_state = steady_(M_,options_,oo_);
[steady_state,M_.params,info] = steady_(M_,options_,oo_);
if info(1) == 0
% if homotopy step is not successful, current values of steady
% state are not modified
oo_.steady_state = steady_state;
else
break
end
end
......@@ -53,12 +53,16 @@ switch options_.homotopy_mode
homotopy3(options_.homotopy_values, options_.homotopy_steps);
end
[oo_.steady_state,M_.params,info] = steady_(M_,options_,oo_);
[steady_state,M_.params,info] = steady_(M_,options_,oo_);
if info(1) && options_.steady.stop_on_error
if info(1) == 0
oo_.steady_state = steady_state;
disp_steady_state(M_,oo_);
elseif options_.steady.stop_on_error
print_info(info,options_.noprint);
else
disp(['Warning: steady state could not be computed but steady.stop_on_error ' ...
'== 0, so I continue'])
end
disp_steady_state(M_,oo_);
M_.Sigma_e = Sigma_e;
......@@ -2502,7 +2502,7 @@ o_median : MEDIAN { driver.option_num("ms.median","1"); }
o_regimes : REGIMES { driver.option_num("ms.regimes","1"); };
o_regime : REGIME EQUAL INT_NUMBER { driver.option_num("ms.regime",$3); };
o_data_obs_nbr : DATA_OBS_NBR EQUAL INT_NUMBER { driver.option_num("ms.forecast_data_obs",$3); };
o_stop_on_error: STOP_ON_ERROR EQUAL INT_NUMBER { driver.option_num("steady.stop_on_eror",$3); };
o_stop_on_error: STOP_ON_ERROR EQUAL INT_NUMBER { driver.option_num("steady.stop_on_error",$3); };
o_discretionary_tol: DISCRETIONARY_TOL EQUAL non_negative_number { driver.option_num("discretionary_tol",$3); };
range : symbol ':' symbol
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment