Merge branch 'evaluate_planner' into 'master'
evaluate_planner_objective.m: correctly rely on lag/lead structure for perfect foresight See merge request Dynare/dynare!1890trust-region-mex
commit
b34be496c5
|
@ -91,17 +91,17 @@ planner_objective_value = zeros(2,1);
|
|||
if options_.ramsey_policy
|
||||
if oo_.gui.ran_perfect_foresight
|
||||
T = size(oo_.endo_simul,2);
|
||||
[U_term] = feval([M_.fname '.objective.static'],oo_.endo_simul(:,T),oo_.exo_simul(T,:), M_.params);
|
||||
[U_term] = feval([M_.fname '.objective.static'],oo_.endo_simul(:,T-M_.maximum_lead),oo_.exo_simul(T-M_.maximum_lead,:), M_.params);
|
||||
EW = U_term/(1-beta);
|
||||
W = EW;
|
||||
for t=T:-1:2
|
||||
for t=T-M_.maximum_lead:-1:1+M_.maximum_lag
|
||||
[U] = feval([M_.fname '.objective.static'],oo_.endo_simul(:,t),oo_.exo_simul(t,:), M_.params);
|
||||
W = U + beta*W;
|
||||
end
|
||||
planner_objective_value(1) = EW;
|
||||
planner_objective_value(2) = W;
|
||||
else
|
||||
ys = oo_.dr.ys;
|
||||
ys = oo_.dr.ys;
|
||||
if options_.order == 1 || M_.hessian_eq_zero
|
||||
[U] = feval([M_.fname '.objective.static'],ys,zeros(1,exo_nbr), M_.params);
|
||||
planner_objective_value(1) = U/(1-beta);
|
||||
|
@ -229,9 +229,6 @@ elseif options_.discretionary_policy
|
|||
Wbar = U/(1-beta);
|
||||
Wy = Uy*gy/(eye(nspred)-beta*Gy);
|
||||
|
||||
if isempty(options_.qz_criterium)
|
||||
options_.qz_criterium = 1+1e-6;
|
||||
end
|
||||
%solve Lyapunuv equation Wyy=gy'*Uyy*gy+beta*Gy'Wyy*Gy
|
||||
Wyy = reshape(lyapunov_symm(sqrt(beta)*Gy',reshape(Uyygygy,nspred,nspred),options_.lyapunov_fixed_point_tol,options_.qz_criterium,options_.lyapunov_complex_threshold, 3, options_.debug),1,nspred*nspred);
|
||||
Wyygugu = A_times_B_kronecker_C(Wyy,Gu,Gu);
|
||||
|
|
|
@ -23,7 +23,7 @@ r=1;
|
|||
end;
|
||||
|
||||
histval;
|
||||
r(0)=1;
|
||||
a(0)=-1;
|
||||
end;
|
||||
|
||||
steady_state_model;
|
||||
|
@ -42,4 +42,5 @@ end;
|
|||
options_.dr_display_tol=0;
|
||||
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
|
||||
ramsey_model(planner_discount=0.99,instruments=(r));
|
||||
stoch_simul(order=1,periods=500);
|
||||
stoch_simul(order=1);
|
||||
evaluate_planner_objective;
|
Loading…
Reference in New Issue