Ascertain that only correct steady states for linear models are accepted
Without the check, incorrect steady states were accepted. This happened for example if the model was not linear in the first place and solving a wrongly presumed linear equation system did not work.time-shift
parent
8bc946c148
commit
a5e60834ca
|
@ -207,9 +207,16 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
|
||||||
disp(['STEADY: numerical initial values or parameters incompatible with the following' ...
|
disp(['STEADY: numerical initial values or parameters incompatible with the following' ...
|
||||||
' equations'])
|
' equations'])
|
||||||
disp(ii')
|
disp(ii')
|
||||||
disp('Check whether your model in truly linear')
|
disp('Check whether your model is truly linear. Put "resid(1);" before "steady;" to see the problematic equations.\n')
|
||||||
elseif isempty(ii) && max(abs(fvec)) > 1e-12
|
elseif isempty(ii) && max(abs(fvec)) > 1e-12
|
||||||
ys = ys_init-jacob\fvec;
|
ys = ys_init-jacob\fvec;
|
||||||
|
resid = evaluate_static_model(ys,exo_ss,params,M,options);
|
||||||
|
if max(abs(resid)) > 1e-6
|
||||||
|
check=1;
|
||||||
|
fprintf('STEADY: No steady state for your model could be found\n')
|
||||||
|
fprintf('STEADY: Check whether your model is truly linear. Put "resid(1);" before "steady;" to see the problematic equations.\n')
|
||||||
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
ys = ys_init;
|
ys = ys_init;
|
||||||
end
|
end
|
||||||
|
@ -225,7 +232,7 @@ function [ys,params,info] = evaluate_steady_state(ys_init,M,options,oo,steadysta
|
||||||
fprintf('STEADY: Derivative of Equation %d with respect to Variable %s (initial value of %s: %g) \n',infrow(ii),deblank(M.endo_names(orig_var_index,:)),deblank(M.endo_names(orig_var_index,:)),ys_init(infcol(ii)))
|
fprintf('STEADY: Derivative of Equation %d with respect to Variable %s (initial value of %s: %g) \n',infrow(ii),deblank(M.endo_names(orig_var_index,:)),deblank(M.endo_names(orig_var_index,:)),ys_init(infcol(ii)))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
disp('STEADY: Check whether your model in truly linear\n')
|
fprintf('Check whether your model is truly linear. Put "resid(1);" before "steady;" to see the problematic equations.\n')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -75,9 +75,15 @@ if ~noprint
|
||||||
case 19
|
case 19
|
||||||
error('The steadystate file did not compute the steady state')
|
error('The steadystate file did not compute the steady state')
|
||||||
case 20
|
case 20
|
||||||
error(['Impossible to find the steady state. Either the model' ...
|
if DynareOptions.linear
|
||||||
' doesn''t have a steady state, there are an infinity of steady states, ' ...
|
error(['Impossible to find the steady state. Either the model' ...
|
||||||
' or the guess values are too far from the solution'])
|
' doesn''t have a steady state or there are an infinity of steady states.' ...
|
||||||
|
' Check whether your model is truly linear or whether there is a mistake in linearization.'])
|
||||||
|
else
|
||||||
|
error(['Impossible to find the steady state. Either the model' ...
|
||||||
|
' doesn''t have a steady state, there are an infinity of steady states,' ...
|
||||||
|
' or the guess values are too far from the solution'])
|
||||||
|
end
|
||||||
case 21
|
case 21
|
||||||
error('The steady state is complex')
|
error('The steady state is complex')
|
||||||
case 22
|
case 22
|
||||||
|
|
Loading…
Reference in New Issue