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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Stéphane Adjemian
dynare
Commits
380fd370
Commit
380fd370
authored
13 years ago
by
MichelJuillard
Browse files
Options
Downloads
Patches
Plain Diff
fixing bug in ramsey policy when using initval instead of steady_state_model
parent
62b1ed79
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/dyn_ramsey_static.m
+5
-5
5 additions, 5 deletions
matlab/dyn_ramsey_static.m
with
5 additions
and
5 deletions
matlab/dyn_ramsey_static.m
+
5
−
5
View file @
380fd370
...
@@ -61,7 +61,7 @@ else
...
@@ -61,7 +61,7 @@ else
[
xx
,
info1
]
=
dynare_solve
(
nl_func
,
xx
,
0
);
[
xx
,
info1
]
=
dynare_solve
(
nl_func
,
xx
,
0
);
steady_state
=
nl_func
(
xx
);
steady_state
=
nl_func
(
xx
);
end
end
steady_state
=
nl_func
(
xx
);
[
junk
,
junk
,
steady_state
]
=
nl_func
(
xx
);
...
@@ -86,14 +86,14 @@ max_lag = M.maximum_lag;
...
@@ -86,14 +86,14 @@ max_lag = M.maximum_lag;
i_endo
=
[
1
:
endo_nbr
]
'
;
i_endo
=
[
1
:
endo_nbr
]
'
;
% indices of endogenous variable except instruments
% indices of endogenous variable except instruments
% i_inst = M.instruments;
% i_inst = M.instruments;
% lead_lag incidence matrix
for endogenous variables
% lead_lag incidence matrix
i_lag
=
M
.
lead_lag_incidence
;
i_lag
=
M
.
lead_lag_incidence
;
if
options_
.
steadystate_flag
if
options_
.
steadystate_flag
k_inst
=
[];
k_inst
=
[];
instruments
=
options_
.
instruments
;
instruments
=
options_
.
instruments
;
for
i
=
1
:
size
(
instruments
,
1
)
for
i
=
1
:
size
(
instruments
,
1
)
k_inst
=
[
k_inst
;
strmatch
(
options_
.
instruments
(
i
,:),
...
k_inst
=
[
k_inst
;
strmatch
(
instruments
(
i
,:),
...
M
.
endo_names
,
'exact'
)];
M
.
endo_names
,
'exact'
)];
end
end
oo
.
steady_state
(
k_inst
)
=
x
;
oo
.
steady_state
(
k_inst
)
=
x
;
...
@@ -134,7 +134,7 @@ xx = [x; zeros(M.endo_nbr - M.orig_eq_nbr,1)];
...
@@ -134,7 +134,7 @@ xx = [x; zeros(M.endo_nbr - M.orig_eq_nbr,1)];
% the auxiliary variables before the Lagrange multipliers are treated
% the auxiliary variables before the Lagrange multipliers are treated
% as ordinary endogenous variables
% as ordinary endogenous variables
n_var
=
M
.
orig_endo_nbr
+
min
(
find
([
M
.
aux_vars
.
type
]
==
6
))
-
1
;
n_var
=
M
.
orig_endo_nbr
+
min
(
find
([
M
.
aux_vars
.
type
]
==
6
))
-
1
;
aux_eq
=
[
1
:
n_var
orig_endo_nbr
+
orig_eq_nbr
+
1
:
size
(
fJ
,
1
)];
aux_eq
=
[
1
:
n_var
,
orig_endo_nbr
+
orig_eq_nbr
+
1
:
size
(
fJ
,
1
)];
A
=
fJ
(
aux_eq
,
n_var
+
1
:
end
);
A
=
fJ
(
aux_eq
,
n_var
+
1
:
end
);
y
=
res
(
aux_eq
);
y
=
res
(
aux_eq
);
mult
=
-
A
\
y
;
mult
=
-
A
\
y
;
...
@@ -149,7 +149,7 @@ end
...
@@ -149,7 +149,7 @@ end
if
options_
.
steadystate_flag
if
options_
.
steadystate_flag
resids
=
r1
;
resids
=
r1
;
else
else
resids
=
[
res
;
r1
];
resids
=
[
res
ids1
;
r1
];
end
end
rJ
=
[];
rJ
=
[];
steady_state
=
[
x
(
1
:
n_var
);
mult
];
steady_state
=
[
x
(
1
:
n_var
);
mult
];
\ No newline at end of file
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