# Taylor Curve calculation

Dear all,

I am trying to replicate a Taylor Curve, which illustrates a trade-off between Output gap variance and Inflation variance. I found it in this article by M. Rubio (2020), but I couldn’t find any available replication code, and I struggle to replicate it by myself.

Would anyone be so kind as to point me in the right direction?

Thank you very much in advance!

JH

Did you see

Thank you for such prompt response professor. I followed the guide you provided there and my model is now functional, but the results don’t make a lot of sense. For my TR, I get the following optimal values:

I am also trying to plot the TC, but the graph doesn’t seem to be ok either:

This is the mod file I use:
mod_TC.mod (11.7 KB)

Your last weight is problematic. In Dynare 6, use
mod_TC.mod (11.8 KB)

``````% make loop silent
options_.nofunctions=1;
options_.nocorr=1;
options_.noprint=1;
options_.irf=0;
options_.silent_optimizer=1;
options_.analytic_derivation=true;

options_.osr.opt_algo=1;

% find position of variables in variable_weights
ygap_pos=strmatch('ygap',M_.endo_names,'exact');
pi_pos=strmatch('pi',M_.endo_names,'exact');

% find position of variables in var_list_
ygap_pos_var_list_=strmatch('ygap',var_list_,'exact');
pi_pos_var_list_=strmatch('pi',var_list_,'exact');

weight_grid=0:0.05:0.99;
n_grid_points=length(weight_grid);
var_ygap=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(ygap_pos,ygap_pos) = (1-weight_grid(grid_iter));
[info, oo_] = osr.run(M_, options_, oo_, var_list_, M_.osr.param_names, M_.osr.variable_indices,M_.osr.variable_weights);
if info(1)==0
var_ygap(grid_iter)=oo_.var(ygap_pos_var_list_,ygap_pos_var_list_);
var_pi(grid_iter)=oo_.var(pi_pos_var_list_,pi_pos_var_list_);
end
end
figure
plot(var_ygap,var_pi)
``````

Thank you, professor!