Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Johannes Pfeifer
dynare
Commits
1045c442
Unverified
Commit
1045c442
authored
Jul 21, 2021
by
Sébastien Villemot
Browse files
Merge branch 'occbin_mean' of git.dynare.org:JohannesPfeifer/dynare
Ref. !1882
parents
6b70846c
944bf2b6
Changes
8
Hide whitespace changes
Inline
Side-by-side
matlab/+occbin/solve_one_constraint.m
View file @
1045c442
...
...
@@ -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
...
...
matlab/+occbin/solve_two_constraints.m
View file @
1045c442
...
...
@@ -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
];
...
...
tests/occbin/filter/NKM.mod
View file @
1045c442
...
...
@@ -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 -----------------------------------------//
...
...
tests/occbin/filter/NKM_0_std_shocks.mod
View file @
1045c442
...
...
@@ -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 -----------------------------------------//
...
...
tests/occbin/model_borrcon/borrcon.mod
View file @
1045c442
...
...
@@ -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;
...
...
tests/occbin/model_borrcon/borrcon_0_std_shocks.mod
View file @
1045c442
...
...
@@ -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;
...
...
tests/occbin/model_irrcap_twoconstraints/dynrbc.mod
View file @
1045c442
...
...
@@ -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"
tests/occbin/model_irrcap_twoconstraints/dynrbc_0_std_shocks.mod
View file @
1045c442
...
...
@@ -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"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment