Page 1 of 1
policy frontier
Posted:
Sun Dec 04, 2016 10:00 am
by yanking
Dear all,
I am trying to draw a policy frontier (or Taylor curve) by assuming loss function as "lambda * var(inflation) + (1-lambda) * var(y)".
But I don't knwo how can I get it?
Can anyone offer me an complete example for refering!
Any helps will be really appreciated.
Best,
yanking
Re: policy frontier
Posted:
Mon Dec 05, 2016 7:38 pm
by jpfeifer
Do you have a reference for what you are trying to achieve?
Re: policy frontier
Posted:
Tue Dec 06, 2016 10:23 am
by yanking
Dear Professor jpfeifer,thanks for your reply!
Such as
viewtopic.php?f=1&t=6766&p=19563&hilit=policy+frontier#p19563,This is a problem that appeared long ago in this forom,but hasn't been solved till now.Another example is Iacoviello, Matteo(2007),"House Prices, Borrowing Constraints, and Monetary Policy in the Business Cycle",But he computed his policy frontier completely with matlab program.
What I need is how to solve this problem with dynare platform conbineded with simple matlab codes.
Re: policy frontier
Posted:
Tue Dec 06, 2016 10:25 am
by yanking
Sorry,Iacoviello, Matteo(2005),
Re: policy frontier
Posted:
Wed Dec 07, 2016 5:49 pm
by jpfeifer
I see. Do you already have the mod-file for which you want to compute this?
Re: policy frontier
Posted:
Sun Dec 18, 2016 12:33 pm
by jpfeifer
Starting with the unstable version of 12/18/2016 (Dynare 4.5), the following code should work for your mod-file
- Code: Select all
% make loop silent
options_.nofunctions=1;
options_.nocorr=1;
options_.noprint=1;
options_.irf=0;
options_.silent_optimizer=1;
options_.osr.opt_algo=9;
% find position of variables in variable_weights
y_pos=strmatch('y_hat',M_.endo_names,'exact');
pi_pos=strmatch('pi_hat',M_.endo_names,'exact');
% find position of variables in var_list_
y_pos_var_list_=strmatch('y_hat',var_list_,'exact');
pi_pos_var_list_=strmatch('pi_hat',var_list_,'exact');
weight_grid=0:0.01:1;
n_grid_points=length(weight_grid);
var_y=NaN(n_grid_points,1);
var_pi=NaN(n_grid_points,1);
for grid_iter=1:n_grid_points
M_.osr.variable_weights(pi_pos,pi_pos) = weight_grid(grid_iter);
M_.osr.variable_weights(y_pos,y_pos) = (1-weight_grid(grid_iter));
oo_.osr = osr(var_list_,M_.osr.param_names,M_.osr.variable_indices,M_.osr.variable_weights);
if oo_.osr.error_indicator==0
var_y(grid_iter)=oo_.var(y_pos_var_list_,y_pos_var_list_);
var_pi(grid_iter)=oo_.var(pi_pos_var_list_,pi_pos_var_list_);
end
end
figure
plot(var_y,var_pi)
Re: policy frontier
Posted:
Tue Jan 31, 2017 4:19 pm
by zhanshuo
Hi, Prof Pfeifer, I add your above code to my mod file and it does not work, since the var_list_ is empty.
So shall I write names of all variables into var_list_?
Thanks.
Re: policy frontier
Posted:
Tue Jan 31, 2017 6:02 pm
by jpfeifer
In that case, you should be able to replace
- Code: Select all
var_list_
with
- Code: Select all
M_.endo_names
Re: policy frontier
Posted:
Wed Feb 01, 2017 8:35 am
by zhanshuo
Thanks, dear Prof. Pfeifer , it finally works!
Re: policy frontier
Posted:
Wed Apr 12, 2017 7:52 am
by john949
Prof. Pfeifer,
Could you please clarify whether the above code you provided re-computes the Optimal Simple Rule every time the weight in the grid is changed, or whether it merely computes the unconditional variances of inflation and output gap implied by the Optimal Simple Rule calculated using the OSR routine for a particular value of "lambda" (say, 0.5) chosen prior to running the code you provided?
Thank you very much.
Re: policy frontier
Posted:
Wed Apr 12, 2017 7:55 am
by jpfeifer
Hi,
in the above code within the loop
- Code: Select all
M_.osr.variable_weights(pi_pos,pi_pos) = weight_grid(grid_iter);
M_.osr.variable_weights(y_pos,y_pos) = (1-weight_grid(grid_iter));
oo_.osr = osr(var_list_,M_.osr.param_names,M_.osr.variable_indices,M_.osr.variable_weights);
resets the weights and then recomputes the OSR for these particular weights.
Re: policy frontier
Posted:
Wed Apr 12, 2017 7:59 am
by john949
Prof. Pfeifer, thank you very much for such a prompt reply.
And just to confirm, if one runs
- Code: Select all
optim_weights;
pi_hat 0.5;
y_hat 0.5;
end;
osr_params phiR phipi phiY;
osr_params_bounds;
phiR, 0, 0.99;
phipi, 1, 100;
phiY, 0, 100;
end;
osr(opt_algo=9);
prior to the code you provided, would the above-stated parameter bounds be respected in the re-computation of the OSR within the loop as the weight in the loss function is varied?
Re: policy frontier
Posted:
Wed Apr 12, 2017 8:28 am
by jpfeifer
Yes, because the resulting
- Code: Select all
M_.osr.param_bounds
is not altered subsequently.
Re: policy frontier
Posted:
Wed Apr 12, 2017 8:30 am
by john949
Thank you.