Unverified Commit 1045c442 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

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

Ref. !1882
parents 6b70846c 944bf2b6
......@@ -167,7 +167,7 @@ for shock_period = 1:n_shocks_periods
regime_start(end)-1,binding_indicator,...
data.exo_pos,data.shocks_sequence(shock_period,:),endo_init,update_flag);
[binding, relax, err]=feval([M_.fname,'.occbin_difference'],zdatalinear_,M_.params,dr_base.ys);
[binding, relax, err]=feval([M_.fname,'.occbin_difference'],zdatalinear_+repmat(dr_base.ys',size(zdatalinear_,1),1),M_.params,dr_base.ys);
% check if changes to the hypothesis of the duration for each
% regime
......
......@@ -145,7 +145,7 @@ for shock_period = 1:n_shocks_periods
while (regime_change_this_iteration && iter<max_iter && ~is_periodic)
iter = iter +1;
if any(binding_indicator(end,:)) && nperiods_0<opts_simul_.max_periods
binding_indicator = [binding_indicator; false(2,1)];
binding_indicator = [binding_indicator; false(1,2)];
nperiods_0 = nperiods_0 + 1;
disp_verbose(['nperiods has been endogenously increased up to ' int2str(nperiods_0) '.'],opts_simul_.debug)
end
......@@ -183,7 +183,7 @@ for shock_period = 1:n_shocks_periods
binding_indicator,...
data.exo_pos,data.shocks_sequence(shock_period,:),endo_init, update_flag);
[binding, relax, err]=feval([M_.fname,'.occbin_difference'],zdatalinear_,M_.params,dr.ys);
[binding, relax, err]=feval([M_.fname,'.occbin_difference'],zdatalinear_+repmat(dr.ys',size(zdatalinear_,1),1),M_.params,dr.ys);
binding_constraint_new=[binding.constraint_1;binding.constraint_2];
relaxed_constraint_new = [relax.constraint_1;relax.constraint_2];
......
......@@ -207,7 +207,7 @@ model;
end;
occbin_constraints;
name 'zlb'; bind inom+inombar <= inomlb; relax inom+inombar > inomlb;
name 'zlb'; bind inom <= inomlb; relax inom > inomlb;
end;
// ---------------- Steady state -----------------------------------------//
......
......@@ -209,7 +209,7 @@ model;
end;
occbin_constraints;
name 'zlb'; bind inom+inombar <= inomlb; relax inom+inombar > inomlb;
name 'zlb'; bind inom <= inomlb; relax inom > inomlb;
end;
// ---------------- Steady state -----------------------------------------//
......
......@@ -28,7 +28,7 @@ y_hat = log(y) - log(steady_state(y));
end;
occbin_constraints;
name 'borrcon'; bind lb<-STEADY_STATE(lb); relax b>M*y; error_bind abs(lb+STEADY_STATE(lb)); error_relax abs(b-M*y);
name 'borrcon'; bind lb<0; relax b>M*y; error_bind abs(lb); error_relax abs(b-M*y);
%name 'borrcon'; bind lb<-STEADY_STATE(lb); relax b>M*y;
end;
......
......@@ -29,7 +29,7 @@ y_hat = log(y) - log(steady_state(y));
end;
occbin_constraints;
name 'borrcon'; bind lb<-STEADY_STATE(lb); relax b>M*y; error_bind abs(lb+STEADY_STATE(lb)); error_relax abs(b-M*y);
name 'borrcon'; bind lb<0; relax b>M*y; error_bind abs(lb); error_relax abs(b-M*y);
end;
steady_state_model;
......
......@@ -53,8 +53,8 @@ a = RHOA*a(-1)+erra;
end;
occbin_constraints;
name 'IRR'; bind i<PHI-1; relax lambdak<0;
name 'INEG'; bind i<-0.000001;
name 'IRR'; bind i-steady_state(i)<log(PHI); relax lambdak<0;
name 'INEG'; bind i-steady_state(i)<-0.000001;
end;
@#include "dynrbc_common.inc"
......@@ -53,8 +53,8 @@ a = RHOA*a(-1)+erra;
end;
occbin_constraints;
name 'IRR'; bind i<PHI-1; relax lambdak<0; error_bind abs(i-(PHI-1)); error_relax abs(lambdak-0);
name 'INEG'; bind i<-0.000001; relax i>-0.000001; error_bind abs(i-0.000001); error_relax abs(i-0.000001);
name 'IRR'; bind i-steady_state(i)<log(PHI); relax lambdak<0; error_bind abs(i-steady_state(i)-log(PHI)); error_relax abs(lambdak-0);
name 'INEG'; bind i-steady_state(i)<-0.000001; relax i-steady_state(i)>-0.000001; error_bind abs(i-steady_state(i)-0.000001); error_relax abs(i-steady_state(i)-0.000001);
end;
@#include "dynrbc_common.inc"
......
Supports Markdown
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