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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stéphane Adjemian
dynare
Commits
cc3aeafd
Commit
cc3aeafd
authored
Aug 26, 2015
by
Johannes Pfeifer
Browse files
Options
Downloads
Patches
Plain Diff
Save planner objective function with discretionary_policy
parent
154980ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/discretionary_policy.m
+1
-1
1 addition, 1 deletion
matlab/discretionary_policy.m
matlab/evaluate_planner_objective.m
+8
-4
8 additions, 4 deletions
matlab/evaluate_planner_objective.m
with
9 additions
and
5 deletions
matlab/discretionary_policy.m
+
1
−
1
View file @
cc3aeafd
...
...
@@ -35,6 +35,6 @@ if options_.noprint == 0
end
%
oo_ = evaluate_planner_objective(
oo_.dr,M_,oo
_,options_);
oo_
.
planner_objective_value
=
evaluate_planner_objective
(
M
_
,
options_
,
oo_
);
options_
=
oldoptions
;
\ No newline at end of file
This diff is collapsed.
Click to expand it.
matlab/evaluate_planner_objective.m
+
8
−
4
View file @
cc3aeafd
...
...
@@ -92,7 +92,6 @@ if ~isempty(M.endo_histval)
end
end
yhat1
=
yhat1
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)),
1
)
-
dr
.
ys
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)));
yhat2
=
yhat2
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)),
1
)
-
dr
.
ys
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)));
u
=
oo
.
exo_simul
(
1
,:)
'
;
[
Wyyyhatyhat1
,
err
]
=
A_times_B_kronecker_C
(
Wyy
,
yhat1
,
yhat1
,
options
.
threads
.
kronecker
.
A_times_B_kronecker_C
);
...
...
@@ -104,6 +103,7 @@ mexErrCheck('A_times_B_kronecker_C', err);
planner_objective_value
(
1
)
=
Wbar
+
Wy
*
yhat1
+
Wu
*
u
+
Wyuyhatu1
...
+
0.5
*
(
Wyyyhatyhat1
+
Wuuuu
+
Wss
);
if
options
.
ramsey_policy
yhat2
=
yhat2
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)),
1
)
-
dr
.
ys
(
dr
.
order_var
(
nstatic
+
(
1
:
nspred
)));
[
Wyyyhatyhat2
,
err
]
=
A_times_B_kronecker_C
(
Wyy
,
yhat2
,
yhat2
,
options
.
threads
.
kronecker
.
A_times_B_kronecker_C
);
mexErrCheck
(
'A_times_B_kronecker_C'
,
err
);
[
Wyuyhatu2
,
err
]
=
A_times_B_kronecker_C
(
Wyu
,
yhat2
,
u
,
options
.
threads
.
kronecker
.
A_times_B_kronecker_C
);
...
...
@@ -115,9 +115,13 @@ end
if
~
options
.
noprint
skipline
()
disp
(
'Approximated value of planner objective function'
)
if
options
.
ramsey_policy
disp
([
' - with initial Lagrange multipliers set to 0: '
...
num2str
(
planner_objective_value
(
2
))
])
disp
([
' - with initial Lagrange multipliers set to steady state: '
...
num2str
(
planner_objective_value
(
1
))
])
elseif
options
.
discretionary_policy
fprintf
(
'with discretionary policy: %10.8f'
,
planner_objective_value
(
1
))
end
skipline
()
end
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