Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dynare
dynare
Commits
1380b35a
Verified
Commit
1380b35a
authored
2 years ago
by
Marco Ratto
Committed by
Sébastien Villemot
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fix bug in ambiguity in the first regime stored, between 01 10 and 11.
(cherry picked from commit
906062cf
)
parent
d7a3db15
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/+occbin/mkdatap_anticipated_2constraints_dyn.m
+39
-3
39 additions, 3 deletions
matlab/+occbin/mkdatap_anticipated_2constraints_dyn.m
with
39 additions
and
3 deletions
matlab/+occbin/mkdatap_anticipated_2constraints_dyn.m
+
39
−
3
View file @
1380b35a
...
...
@@ -45,7 +45,7 @@ T = DM.decrulea;
CONST
=
zeros
(
n_vars
,
1
);
R
=
DM
.
decruleb
;
if
nargin
<
7
if
nargin
<
7
||
isempty
(
init
)
init
=
zeros
(
n_vars
,
1
);
end
...
...
@@ -90,10 +90,46 @@ if T_max > 0
dictionary
.
ss
(
1
)
.
R
=
temp
(:,
n_vars
+
1
:
n_vars
+
n_exo
);
dictionary
.
ss
(
1
)
.
C
=
temp
(:,
n_vars
+
n_exo
+
1
:
end
);
end
% we do not know what is the last binding regime between 10 01 and 11!\
ireg
(
T_max
)
=
1
;
icount
=
1
;
else
icount
=
length
(
dictionary
.
ss
);
% check if last binding regime was already stored
tmp
=
0
*
binding_indicator
;
tmp
(
1
:
end
-
T_max
+
1
,:)
=
binding_indicator
(
T_max
:
end
,:);
if
~
isoctave
&&
~
matlab_ver_less_than
(
'9.1'
)
% Automatic broadcasting was introduced in MATLAB R2016b
itmp
=
find
(
~
any
(
bsxfun
(
@
minus
,
dictionary
.
binding_indicator
(
1
:
length
(
tmp
)
*
2
,:),
tmp
(:))));
else
itmp
=
find
(
~
any
(
dictionary
.
binding_indicator
(
1
:
length
(
tmp
)
*
2
,:)
-
tmp
(:)));
end
if
~
isempty
(
itmp
)
ireg
(
T_max
)
=
itmp
;
else
icount
=
icount
+
1
;
ireg
(
T_max
)
=
icount
;
tmp
=
[
binding_indicator
(
T_max
,:);
zeros
(
size
(
binding_indicator
,
1
)
-
1
,
2
)];
dictionary
.
binding_indicator
(:,
icount
)
=
tmp
(:);
if
(
binding_indicator
(
T_max
,
1
)
&&
~
binding_indicator
(
T_max
,
2
))
temp
=
-
(
DM
.
Abarmat10
*
DM
.
decrulea
+
DM
.
Bbarmat10
)\[
DM
.
Cbarmat10
DM
.
Jbarmat10
DM
.
Dbarmat10
];
dictionary
.
ss
(
icount
)
.
T
=
temp
(:,
1
:
n_vars
);
dictionary
.
ss
(
icount
)
.
R
=
temp
(:,
n_vars
+
1
:
n_vars
+
n_exo
);
dictionary
.
ss
(
icount
)
.
C
=
temp
(:,
n_vars
+
n_exo
+
1
:
end
);
elseif
(
binding_indicator
(
T_max
,
1
)
&&
binding_indicator
(
T_max
,
2
))
temp
=
-
(
DM
.
Abarmat11
*
DM
.
decrulea
+
DM
.
Bbarmat11
)\[
DM
.
Cbarmat11
DM
.
Jbarmat11
DM
.
Dbarmat11
];
dictionary
.
ss
(
icount
)
.
T
=
temp
(:,
1
:
n_vars
);
dictionary
.
ss
(
icount
)
.
R
=
temp
(:,
n_vars
+
1
:
n_vars
+
n_exo
);
dictionary
.
ss
(
icount
)
.
C
=
temp
(:,
n_vars
+
n_exo
+
1
:
end
);
else
temp
=
-
(
DM
.
Abarmat01
*
DM
.
decrulea
+
DM
.
Bbarmat01
)\[
DM
.
Cbarmat01
DM
.
Jbarmat01
DM
.
Dbarmat01
];
dictionary
.
ss
(
icount
)
.
T
=
temp
(:,
1
:
n_vars
);
dictionary
.
ss
(
icount
)
.
R
=
temp
(:,
n_vars
+
1
:
n_vars
+
n_exo
);
dictionary
.
ss
(
icount
)
.
C
=
temp
(:,
n_vars
+
n_exo
+
1
:
end
);
end
end
end
ireg
(
T_max
)
=
1
;
icount
=
length
(
dictionary
.
ss
);
for
i
=
T_max
-
1
:
-
1
:
1
tmp
=
0
*
binding_indicator
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment