open economy and steady problems

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.

open economy and steady problems

Postby marcel » Fri Feb 11, 2011 5:31 pm

Hello everyone,

Im trying to replicate the gali's book open economy model and i'm having trouble with simulating it.

the problem must be with the exchange rate equation because when i get it off it works well.
The error that is show is:

??? Error using ==> mrdivide
Matrix dimensions must agree.

Error in ==> lnsrch1 at 64
alamin = tolx/test ;

Error in ==> solve1 at 127
[x,f,fvec,check]=lnsrch1(xold,fold,g,p,stpmax,func,j1,j2,varargin{:});

Error in ==> dynare_solve at 112
[x,info]=solve1(func,x,j1(r(i):r(i+1)-1),j2(r(i):r(i+1)-1),jacobian_flag,
bad_cond_flag, varargin{:});

Error in ==> steady_ at 124
[oo_.steady_state,check] = dynare_solve([M_.fname '_static'],...

Error in ==> steady at 52
steady_;

Error in ==> galicap7 at 200
steady;

Error in ==> dynare at 132
evalin('base',fname) ;


can someone give any tips?

the mod file is attached.

Thanks
Attachments
galicap7.mod
(3.95 KiB) Downloaded 140 times
marcel
 
Posts: 6
Joined: Wed Feb 09, 2011 9:59 pm

Re: open economy and steady problems

Postby jpfeifer » Fri Feb 11, 2011 6:16 pm

Due to the parameter rho in equations 1 and 3 your model is not loglinear. Hence, computing the steady state fails.
------------
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: open economy and steady problems

Postby marcel » Fri Feb 11, 2011 6:57 pm

Thanks a lot for your answer.

could you explain me why is it a problem?
the stationary condition is satisfied with this calibration, and also I used this form for the parameter rho for closed economy and it works well... (the book uses the approximation rho=-log(beta) but is shows the same error anyway).
marcel
 
Posts: 6
Joined: Wed Feb 09, 2011 9:59 pm

Re: open economy and steady problems

Postby jpfeifer » Fri Feb 11, 2011 7:28 pm

I would guess your linearization is wrong. If you linearized your model about the steady state, everything is now in (log) deviations from steady state. Hence, all endogenous variables have steady state 0. Using 0 as the steady state solves all your equations except for 1 and 3. When you look at these equations and set all variables to 0, what remains is an equation that says
Code: Select all
0 = rho

In general, if you linearize a model, all constant terms should drop out. Hence, there should be no rho.
------------
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: open economy and steady problems

Postby marcel » Fri Feb 11, 2011 8:23 pm

The log linearization is looks fine because rho~=-ln(beta) and beta is multiplying on FOC.
rho represents the natural interest rate when no shocks, so it shouldn't be zero..
The equation 1 and 3 in my mod file are the equations (40) and (39), could you please take a look?

Also when I set rho = 0, i get NaN in the moments of the exchange rate, maybe it can be related...
Attachments
ch7Gali.pdf
(357.95 KiB) Downloaded 199 times
marcel
 
Posts: 6
Joined: Wed Feb 09, 2011 9:59 pm

Re: open economy and steady problems

Postby jpfeifer » Sat Feb 12, 2011 7:33 am

Ok, I get it. The problem is that Gali has all variables in deviations from their steady state, except for rn and i, whose steady state is rho (which is a strange way that confuses Dynare). To solve your problem, initialize rn and i before the steady command by putting:
Code: Select all
initval;
rn=rho;
i=rho;
end;
------------
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: open economy and steady problems

Postby marcel » Tue Feb 15, 2011 8:56 pm

Thanks a lot! now it is working fine.

Just a question that i dont know how to proceed when i have a unit root in one of my equations (nominal exchange rate equation)?
When i get NaN in moments, does the dynamic of my model works properly?
marcel
 
Posts: 6
Joined: Wed Feb 09, 2011 9:59 pm

Re: open economy and steady problems

Postby jpfeifer » Wed Feb 16, 2011 5:22 pm

Usually, the answer is yes. IRFs can of course be permanent (but nevertheless correct), if a unit root is present.
------------
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: No registered users and 7 guests