Page 1 of 1

Introducing Covariances in the Objective Function of OSR

PostPosted: Sat Oct 25, 2014 7:22 pm
by pddv
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

Re: Introducing Covariances in the Objective Function of OSR

PostPosted: Thu Oct 30, 2014 6:00 am
by jpfeifer
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

Re: Introducing Covariances in the Objective Function of OSR

PostPosted: Thu Oct 30, 2014 2:14 pm
by pddv
Thanks. I will take that into account.


Best,

Paulo Vieira