ramsey_policy: correcting the computation of the value of the

objective function; adding details about the period objective function
in the manual.
time-shift
Michel Juillard 2013-12-13 10:44:29 +01:00
parent 77fdd3bfda
commit 58c40fdca9
2 changed files with 10 additions and 31 deletions

View File

@ -6095,7 +6095,10 @@ This command declares the policy maker objective, for use with
You need to give the one-period objective, not the discounted lifetime
objective. The discount factor is given by the @code{planner_discount}
option of @code{ramsey_policy} and @code{discretionary_policy}.
option of @code{ramsey_policy} and @code{discretionary_policy}. The
objective function can only contain current endogenous variables and no
exogenous ones. This limitation is easily circumvented by defining an
appropriate auxiliary variable in the model.
With @code{ramsey_policy}, you are not limited to quadratic
objectives: you can give any arbitrary nonlinear expression.

View File

@ -42,27 +42,12 @@ else
end
ipred = find(lead_lag_incidence(M.maximum_lag,:))';
order_var = dr.order_var;
LQ = true;
Gy = dr.ghx(nstatic+(1:nspred),:);
Gu = dr.ghu(nstatic+(1:nspred),:);
gy(dr.order_var,:) = dr.ghx;
gu(dr.order_var,:) = dr.ghu;
if options.ramsey_policy && options.order == 1 && ~options.linear
options.order = 2;
options.qz_criterium = 1+1e-6;
[dr,info] = stochastic_solvers(oo.dr,0,M,options,oo);
Gyy = dr.ghxx(nstatic+(1:nspred),:);
Guu = dr.ghuu(nstatic+(1:nspred),:);
Gyu = dr.ghxu(nstatic+(1:nspred),:);
Gss = dr.ghs2(nstatic+(1:nspred),:);
gyy(dr.order_var,:) = dr.ghxx;
guu(dr.order_var,:) = dr.ghuu;
gyu(dr.order_var,:) = dr.ghxu;
gss(dr.order_var,:) = dr.ghs2;
LQ = false;
end
ys = oo.dr.ys;
@ -83,24 +68,15 @@ mexErrCheck('A_times_B_kronecker_C', err);
Wbar =U/(1-beta);
Wy = Uy*gy/(eye(nspred)-beta*Gy);
Wu = Uy*gu+beta*Wy*Gu;
if LQ
Wyy = Uyygygy/(eye(nspred*nspred)-beta*kron(Gy,Gy));
else
Wyy = (Uy*gyy+Uyygygy+beta*Wy*Gyy)/(eye(nspred*nspred)-beta*kron(Gy,Gy));
end
Wyy = Uyygygy/(eye(nspred*nspred)-beta*kron(Gy,Gy));
[Wyygugu, err] = A_times_B_kronecker_C(Wyy,Gu,Gu,options.threads.kronecker.A_times_B_kronecker_C);
mexErrCheck('A_times_B_kronecker_C', err);
[Wyygygu,err] = A_times_B_kronecker_C(Wyy,Gy,Gu,options.threads.kronecker.A_times_B_kronecker_C);
mexErrCheck('A_times_B_kronecker_C', err);
if LQ
Wuu = Uyygugu+beta*Wyygugu;
Wyu = Uyygygu+beta*Wyygygu;
Wss = beta*Wuu*M.Sigma_e(:)/(1-beta);
else
Wuu = Uy*guu+Uyygugu+beta*(Wy*Guu+Wyygugu);
Wyu = Uy*gyu+Uyygygu+beta*(Wy*Gyu+Wyygygu);
Wss = (Uy*gss+beta*(Wuu*M.Sigma_e(:)+Wy*Gss))/(1-beta);
end
Wuu = Uyygugu+beta*Wyygugu;
Wyu = Uyygygu+beta*Wyygygu;
Wss = beta*Wuu*M.Sigma_e(:)/(1-beta);
% initialize yhat1 at the steady state
yhat1 = oo.steady_state;
if options.ramsey_policy