Skip to content
Snippets Groups Projects
Verified Commit b8a9dae6 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Merge branch 'mode_check' of git.dynare.org:JohannesPfeifer/dynare

Ref. !1915
parents f6004376 459fce92
No related branches found
No related tags found
1 merge request!1915mode_check.m: fix logical condition that may otherwise lead to 0 size of interval
...@@ -105,7 +105,7 @@ for plt = 1:nbplt ...@@ -105,7 +105,7 @@ for plt = 1:nbplt
kk = (plt-1)*nstar+k; kk = (plt-1)*nstar+k;
[name,texname] = get_the_name(kk,TeX,Model,EstimatedParameters,DynareOptions); [name,texname] = get_the_name(kk,TeX,Model,EstimatedParameters,DynareOptions);
xx = x; xx = x;
if x(kk)~=0 || ~isinf(BoundsInfo.lb(kk)) || ~isinf(BoundsInfo.lb(kk)) if x(kk)~=0 && ~isinf(BoundsInfo.lb(kk)) && ~isinf(BoundsInfo.ub(kk))
l1 = max(BoundsInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound l1 = max(BoundsInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound
l2 = min(BoundsInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound l2 = min(BoundsInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound
else else
...@@ -124,10 +124,10 @@ for plt = 1:nbplt ...@@ -124,10 +124,10 @@ for plt = 1:nbplt
end end
binding_lower_bound=0; binding_lower_bound=0;
binding_upper_bound=0; binding_upper_bound=0;
if isequal(x(kk),BoundsInfo.lb(kk)) if abs(x(kk)-BoundsInfo.lb(kk))<1e-8
binding_lower_bound=1; binding_lower_bound=1;
bound_value=BoundsInfo.lb(kk); bound_value=BoundsInfo.lb(kk);
elseif isequal(x(kk),BoundsInfo.ub(kk)) elseif abs(x(kk)-BoundsInfo.ub(kk))<1e-8
binding_upper_bound=1; binding_upper_bound=1;
bound_value=BoundsInfo.ub(kk); bound_value=BoundsInfo.ub(kk);
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment