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,10 +91,10 @@ planner_objective_value = zeros(2,1);
|
||||||
if options_.ramsey_policy
|
if options_.ramsey_policy
|
||||||
if oo_.gui.ran_perfect_foresight
|
if oo_.gui.ran_perfect_foresight
|
||||||
T = size(oo_.endo_simul,2);
|
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);
|
EW = U_term/(1-beta);
|
||||||
W = EW;
|
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);
|
[U] = feval([M_.fname '.objective.static'],oo_.endo_simul(:,t),oo_.exo_simul(t,:), M_.params);
|
||||||
W = U + beta*W;
|
W = U + beta*W;
|
||||||
end
|
end
|
||||||
|
@ -229,9 +229,6 @@ elseif options_.discretionary_policy
|
||||||
Wbar = U/(1-beta);
|
Wbar = U/(1-beta);
|
||||||
Wy = Uy*gy/(eye(nspred)-beta*Gy);
|
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
|
%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);
|
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);
|
Wyygugu = A_times_B_kronecker_C(Wyy,Gu,Gu);
|
||||||
|
|
|
@ -23,7 +23,7 @@ r=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
histval;
|
histval;
|
||||||
r(0)=1;
|
a(0)=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
steady_state_model;
|
steady_state_model;
|
||||||
|
@ -42,4 +42,5 @@ end;
|
||||||
options_.dr_display_tol=0;
|
options_.dr_display_tol=0;
|
||||||
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
|
planner_objective(ln(c)-phi*((n^(1+gamma))/(1+gamma)));
|
||||||
ramsey_model(planner_discount=0.99,instruments=(r));
|
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