coding expectation of a product

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.

coding expectation of a product

Postby pg28 » Wed Mar 06, 2013 12:30 am

hi

I want to code in Dynare an equation that can be simplified to something as:
aE[X(t+1)]=bE[X(t+1)*Y(t+1)]
where E[X(t+1)*Y(t+1)] is the expectation of a product of two random variables

Any hint on how can I code this in Dynare?

if I define the variable Z=X*Y and I write:
aX(+1)=bZ(+1)
then Dynare seems to understand:
aE(X(t+1))=bE[X(t+1)]*E[Y(t+1)] , that is, a=bE[Y(t+1)]
but this is not what I want to write.

Many thanks for the help
pg28
 
Posts: 4
Joined: Wed Mar 06, 2013 12:19 am

Re: coding expectation of a product

Postby jpfeifer » Wed Mar 06, 2013 1:50 pm

If you use order=1, this is exactly what you should get. In a linearized version, certainty equivalence holds and the covariances drop out. The trick with the auxiliary variable is usually the correct way for higher order approximations. If it does not work, please post the mod-file.
------------
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: coding expectation of a product

Postby pg28 » Thu Mar 07, 2013 3:18 pm

many thanks for the reply. Just to clarify:

in previous posts I read Dynare automatically adds an E_t in front of all equations.
Thus, if I define the variable Z=X*Y, when I write z(+1), then Dynare understands E[X(t+1)*Y(t+1)], not E[X(t+1)]*E[Y(t+1)]. Is this correct?
And a different issue is that up to the 1st order the covariances/variances terms disappear

Thanks again
pg28
 
Posts: 4
Joined: Wed Mar 06, 2013 12:19 am

Re: coding expectation of a product

Postby jpfeifer » Thu Mar 07, 2013 3:24 pm

------------
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


Return to Dynare help

Who is online

Users browsing this forum: Google [Bot] and 5 guests