policy frontier

This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location where you will have to reset your password.
Forum rules
This forum is closed. You can read the posts but cannot write. We have migrated the forum to a new location (https://forum.dynare.org) where you will have to reset your password.

policy frontier

Postby yanking » Sun Dec 04, 2016 10:00 am

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
yanking
 
Posts: 10
Joined: Tue Feb 03, 2015 10:29 am

Re: policy frontier

Postby jpfeifer » Mon Dec 05, 2016 7:38 pm

Do you have a reference for what you are trying to achieve?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby yanking » Tue Dec 06, 2016 10:23 am

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.
yanking
 
Posts: 10
Joined: Tue Feb 03, 2015 10:29 am

Re: policy frontier

Postby yanking » Tue Dec 06, 2016 10:25 am

Sorry,Iacoviello, Matteo(2005),
yanking
 
Posts: 10
Joined: Tue Feb 03, 2015 10:29 am

Re: policy frontier

Postby jpfeifer » Wed Dec 07, 2016 5:49 pm

I see. Do you already have the mod-file for which you want to compute this?
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby jpfeifer » Sun Dec 18, 2016 12:33 pm

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)
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby zhanshuo » Tue Jan 31, 2017 4:19 pm

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.
zhanshuo
 
Posts: 44
Joined: Fri Nov 25, 2016 7:59 am

Re: policy frontier

Postby jpfeifer » Tue Jan 31, 2017 6:02 pm

In that case, you should be able to replace
Code: Select all
var_list_

with
Code: Select all
M_.endo_names
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby zhanshuo » Wed Feb 01, 2017 8:35 am

Thanks, dear Prof. Pfeifer , it finally works!
zhanshuo
 
Posts: 44
Joined: Fri Nov 25, 2016 7:59 am

Re: policy frontier

Postby john949 » Wed Apr 12, 2017 7:52 am

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.
john949
 
Posts: 6
Joined: Mon Apr 10, 2017 12:31 pm

Re: policy frontier

Postby jpfeifer » Wed Apr 12, 2017 7:55 am

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.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby john949 » Wed Apr 12, 2017 7:59 am

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?
john949
 
Posts: 6
Joined: Mon Apr 10, 2017 12:31 pm

Re: policy frontier

Postby jpfeifer » Wed Apr 12, 2017 8:28 am

Yes, because the resulting
Code: Select all
M_.osr.param_bounds

is not altered subsequently.
------------
Johannes Pfeifer
University of Cologne
https://sites.google.com/site/pfeiferecon/
jpfeifer
 
Posts: 6940
Joined: Sun Feb 21, 2010 4:02 pm
Location: Cologne, Germany

Re: policy frontier

Postby john949 » Wed Apr 12, 2017 8:30 am

Thank you.
john949
 
Posts: 6
Joined: Mon Apr 10, 2017 12:31 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 6 guests