Introducing Covariances in the Objective Function of OSR

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.

Introducing Covariances in the Objective Function of OSR

Postby pddv » Sat Oct 25, 2014 7:22 pm

Dear Dynare Community,

I am working with optimal simple monetary and fiscal rules using the osr command. My objective function is a loss function and usually after running osr I compute the asymptotic loss and compare it with the osr objective function value. Although it is possible to introduce covariances in the osr objective function, I notice that when do it the asymptotic loss does not match the osr objective function value.

Example:

Suppose my objective function is: alpha*(y^2) + omega*(pi^2)

osr code:
optim_weights;
y alpha;
pi omega;
end;

In this case, the osr objective function value is the same as the asymptotic loss: alpha*variance(y) + omega*variance(pi)



However, if my objective function is: alpha*(y^2) + omega*(pi^2) + 2*chi*y*pi

osr code:
optim_weights;
y alpha;
pi omega;
y,pi chi;
end;

In this case, the osr objective function value is not the same as the asymptotic loss: alpha*variance(y) + omega*variance(pi) + 2*chi*covariance(y,pi)


Any help?

I thank in advance your reply.



Best,

Paulo
pddv
 
Posts: 5
Joined: Wed Oct 15, 2014 9:43 pm

Re: Introducing Covariances in the Objective Function of OSR

Postby jpfeifer » Thu Oct 30, 2014 6:00 am

There are two things at work.

First, you make a conceptual mistake. You minimize E(xWx) and in optim_weights the entries of W are determined. When setting
Code: Select all
optim_weights;
y,pi chi;
end;

you only set one covariance term as the matrix W does not need to be symmetric. Thus, there is no 2* in front of the covariance matrix. For the 2* to be justified, you would need
Code: Select all
optim_weights;
y,pi chi;
pi,y chi;
end;


Second, there is a bug in Dynare, see https://github.com/DynareTeam/dynare/pull/767. A fix is attached
Attachments
osr1.m
(3.34 KiB) Downloaded 180 times
osr_obj.m
(2.53 KiB) Downloaded 170 times
get_variance_of_endogenous_variables.m
(1.73 KiB) Downloaded 169 times
------------
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: Introducing Covariances in the Objective Function of OSR

Postby pddv » Thu Oct 30, 2014 2:14 pm

Thanks. I will take that into account.


Best,

Paulo Vieira
pddv
 
Posts: 5
Joined: Wed Oct 15, 2014 9:43 pm


Return to Dynare help

Who is online

Users browsing this forum: No registered users and 7 guests

cron