matirx forms in Dynare

As Dynare 4 is now the main version, this forum is now closed. Please, post
on the Dynare Help forum
Forum rules
As Dynare 4 is the current Dynare version, there forum is now close. Post new question in the Dynare Help Forum.

matirx forms in Dynare

Postby alexnomad » Thu Feb 26, 2009 12:44 pm

Hello.I want to make Besyian estimation on some very non-linear system. Is it possible to express in Dynare product of parameters and variables in matrix/vector form. For example I want to estimate parameters a1,a2 but I want to write in Dynare [a1 a2]*[x y]' and not a1*x+a2*y where x y are variables. This is a very easy case but It could be that we can not express one equation in simple form because it could include very complicated non-linear expressions which one can not write down analytically equation by equation. So we can write only in matrix products. For example A*inv(B)*C*z where z is a vector of variables but A,B.C are matrices of parameters. Here it is impossible to write in analytical form as equation by equation.
Thank you very much in advance.
alexnomad
 
Posts: 6
Joined: Fri Feb 20, 2009 8:46 pm

Re: matirx forms in Dynare

Postby StephaneAdjemian » Wed Mar 18, 2009 9:49 pm

Hi, It's possible to deal with matrices but not in the mod file.

In your example, if A is a row matrix, A*inv(B)*C*z is again a linear combination of endogenous variables (if A is not a row vector then A*inv(B)*C*z is a collection of linear combinations). I Assume these matrices are non linear functions of parameters you want to estimate, so we have A(theta), B(theta) and C(theta) where theta is a vector of (deep) parameters. If A is a row vector then v = A*inv(B)*C is also a row vector with, say, n elements v1, v2, ..., vn. Declare v1, ..., vn has parameters in the mod file (as the elements of theta). Given theta you can build the matrices and compute v = A*inv(B)*C in the steady state file. You just have to put these values in the vector M_.params (the place where Dynare stores the values of the parameters). Finally in the model block of the mod file you have an equation with something like v1*z1+v2*z2+...+vn*zn.

Hope it helps.
Best, Stéphane.
Stéphane Adjemian
Université du Maine, GAINS and DynareTeam
https://stepan.adjemian.eu
StephaneAdjemian
 
Posts: 429
Joined: Wed Jan 05, 2005 4:24 pm
Location: Paris, France.


Return to Dynare version 4

Who is online

Users browsing this forum: No registered users and 1 guest