Save planner objective function with discretionary_policy
parent
154980ec8c
commit
cc3aeafd00
|
@ -35,6 +35,6 @@ if options_.noprint == 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
%oo_ = evaluate_planner_objective(oo_.dr,M_,oo_,options_);
|
oo_.planner_objective_value = evaluate_planner_objective(M_,options_,oo_);
|
||||||
|
|
||||||
options_ = oldoptions;
|
options_ = oldoptions;
|
|
@ -92,7 +92,6 @@ if ~isempty(M.endo_histval)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
yhat1 = yhat1(dr.order_var(nstatic+(1:nspred)),1)-dr.ys(dr.order_var(nstatic+(1:nspred)));
|
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,:)';
|
u = oo.exo_simul(1,:)';
|
||||||
|
|
||||||
[Wyyyhatyhat1, err] = A_times_B_kronecker_C(Wyy,yhat1,yhat1,options.threads.kronecker.A_times_B_kronecker_C);
|
[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 ...
|
planner_objective_value(1) = Wbar+Wy*yhat1+Wu*u+Wyuyhatu1 ...
|
||||||
+ 0.5*(Wyyyhatyhat1 + Wuuuu+Wss);
|
+ 0.5*(Wyyyhatyhat1 + Wuuuu+Wss);
|
||||||
if options.ramsey_policy
|
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);
|
[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);
|
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);
|
[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
|
if ~options.noprint
|
||||||
skipline()
|
skipline()
|
||||||
disp('Approximated value of planner objective function')
|
disp('Approximated value of planner objective function')
|
||||||
disp([' - with initial Lagrange multipliers set to 0: ' ...
|
if options.ramsey_policy
|
||||||
|
disp([' - with initial Lagrange multipliers set to 0: ' ...
|
||||||
num2str(planner_objective_value(2)) ])
|
num2str(planner_objective_value(2)) ])
|
||||||
disp([' - with initial Lagrange multipliers set to steady state: ' ...
|
disp([' - with initial Lagrange multipliers set to steady state: ' ...
|
||||||
num2str(planner_objective_value(1)) ])
|
num2str(planner_objective_value(1)) ])
|
||||||
|
elseif options.discretionary_policy
|
||||||
|
fprintf('with discretionary policy: %10.8f',planner_objective_value(1))
|
||||||
|
end
|
||||||
skipline()
|
skipline()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue