Lagging Forward Looking Variables

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.

Lagging Forward Looking Variables

Postby Konstantin Vasilev » Mon Jun 29, 2015 1:47 pm

Suppose I have rational expectations model of the form: x_{t+1} = F(n_{t-1})*x_t - G(n_{t-1})*x_{t-1}, where n_t = f(x_{t-1}, n_{t-1})

I want to lag the model so that it becomes entirely backward looking and get rid of the rational expectations, then solve it as deterministic. So that:

x_t = F()*x_{t-1} ... etc

However, If I lag every variable those in the vector n_t will appear only in lagged terms. To avoid this I simply redefine n_{t-1} = n_l and lag only the variables in x.

Prior the lagging the model works, but afterwards gives this error:
Code: Select all
Warning: Matrix is singular to working precision.
Error using eig
Input to EIG must not contain NaN or Inf.     


and some other errors that follow from the latter.

Do you know if what I am doing is possible and if I do it in the right way? Also how can I get a more descriptive error that leads me to the problem?
Konstantin Vasilev
 
Posts: 13
Joined: Tue Jul 23, 2013 10:46 am

Re: Lagging Forward Looking Variables

Postby jpfeifer » Wed Jul 01, 2015 5:58 am

Why are you doing this instead of just using the perfect foresight solver with the
Code: Select all
simul

command?
------------
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: Lagging Forward Looking Variables

Postby Konstantin Vasilev » Wed Jul 01, 2015 12:58 pm

I am using the deterministic solver from the beginning. Are you implying that with a deterministic model the non-lagged version with forward looking variables should give identical results as the lagged one?
Konstantin Vasilev
 
Posts: 13
Joined: Tue Jul 23, 2013 10:46 am

Re: Lagging Forward Looking Variables

Postby jpfeifer » Sun Jul 05, 2015 5:48 pm

Yes, because with perfect foresight, future values of variables are known at time t when the decisions are made. This is the correct way of modelling. In contrast, lagging everything by one period is wrong.
------------
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: Lagging Forward Looking Variables

Postby Konstantin Vasilev » Mon Jul 06, 2015 4:45 pm

jpfeifer wrote:Yes, because with perfect foresight, future values of variables are known at time t when the decisions are made. This is the correct way of modelling. In contrast, lagging everything by one period is wrong.


The thing is that I have done the same kind of lagging with a simpler deterministic model. The reason was that with the forward looking version the simulation was giving different results (relative to the lagged version) for the long run values for cases when the model does not converge. It seems to me that when there are forward variables dynare imposes convergence to the ss, while when the same model is lagged this does not occur. The user guide says something similar unless 'ednval' is specified. In my case this is not possible as I am interested in cases when the model does not converge at all (not just to another ss).

You may ask why do I do this at all. I am trying to use dynare for bifurcation analysis. That is, I simulate the long run behaviour for different parameter values and random displacements from the steady state. A similar thing is done by Branch and McGough (2010) which also lag their model.

It is true that for a simple deterministic model I can solve it in matlab without the need of dynare. But for larger models the way in which equations are entered in dynare provides great convenience.

At the end I guess my questions becomes: Can I use dynare to enter a model of this sort and simulate a not converging model without imposing convergence (I was trying to do this so far by transforming the fw RE to entirely backward looking system)?
Konstantin Vasilev
 
Posts: 13
Joined: Tue Jul 23, 2013 10:46 am

Re: Lagging Forward Looking Variables

Postby jpfeifer » Tue Jul 07, 2015 9:58 am

I am not sure I understand what you are doing. Solving a perfect foresight model involves solving a system of N*T equations in N*T unknowns. Because of leads and lags at the initial and terminal points, 0 and T, you also need initial and terminal conditions. What exactly are you now doing differently? It seems by somehow arbitrarily changing the timing you make some of the exogenous terminal conditions an endogenous variable to be solved for.
------------
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: Lagging Forward Looking Variables

Postby Konstantin Vasilev » Tue Jul 07, 2015 1:10 pm

jpfeifer wrote: Because of leads and lags at the initial and terminal points, 0 and T, you also need initial and terminal conditions... It seems by somehow arbitrarily changing the timing you make some of the exogenous terminal conditions an endogenous variable to be solved for.


Yes, an entirely backward looking dynamical system of the type: x_t = F(x_{t-1}) , does not need a terminal condition. Then starting from a given displacement from the ss for some parameter values the model will be converging to the ss, for others it may explode to infinity and lastly you may have neither of these but fluctuations around some attractors. This is easily solved in matlab for small models, given t-1 values you compute t values and move to next period without any terminal condition.

How and where in its algorithm does dynare impose this terminal condition? Could there be more clever way to carry out this lagging and get rid of the terminal condition?
Konstantin Vasilev
 
Posts: 13
Joined: Tue Jul 23, 2013 10:46 am

Re: Lagging Forward Looking Variables

Postby jpfeifer » Tue Jul 07, 2015 2:28 pm

If your system is purely backward-looking, the terminal values are never used and should not play any role.
But what still eludes me is your lagging. I don't get how you can transform a dynamic forward-looking problem into a purely backward-looking one. Say you have an Euler equation of the form
Code: Select all
1/c=beta*1/c(+1)

How do you get rid of the future consumption?
------------
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: Lagging Forward Looking Variables

Postby Konstantin Vasilev » Tue Jul 07, 2015 3:25 pm

You would get:
Code: Select all
1/c(-1)=beta*1/c


Of course this transformation is not equivalent due to the conditional expectations. But for a deterministic model does it matter? As I said this is done here: https://ideas.repec.org/a/eee/dyncon/v3 ... -1508.html

How are these terminal values used in dynare when you have +1 variables?
Konstantin Vasilev
 
Posts: 13
Joined: Tue Jul 23, 2013 10:46 am

Re: Lagging Forward Looking Variables

Postby jpfeifer » Tue Jul 07, 2015 3:58 pm

Yes, it matters, because typically your system takes the form of forward-looking, backward-looking and static equations:

Code: Select all
1/c=beta*1/c(+1)*r(+1)
c+i=y
k=(1-delta)*k(-1)+i

Consumption in the last period T will depend on consumption in period T+1, which itself is a function of capital at time T+1. But your system will not endogenously determine capital at time T+1. This is the reason you need to set a terminal condition for c. Lagging everything by one period will not help to solve this problem, because then consumption in T depends on capital at time T, but the system only endogenously determines capital at time T-1.
------------
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 7 guests