Number of forward looking variables!

Hi all,
When I run my RBC model, dynare shows that there are 4 forward looking variables but I have just 2 of them! I do not know what is the problem!!

There are 4 eigenvalue(s) larger than 1 in modulus 
for 4 forward-looking variable(s)
 
The rank condition is verified.

I really appreciate it if someone can tell me why!
Thank you in advance.

post your mod file please.

Mohamad

Dear Mohamad,
Thank you for your reply.
This problem was solved. Unfortunately I can not run my model,but I send you the mod file. When I change some part of this model,I can run it, but, it does not show the effect of the shocks on c and t! Please give me some advice!

Var           a_o   a_T   y_oil   y_o  y_T   c  t  k_o  k_T  l_o  l_T   i_o  i_T  w_o  w_T  r_o  r_T  g  lam  b ; 
varexo        e_o   e_T   e_oil   e_g  e_b ;
parameters    betaa  rho_o  rho_T  rho_oil  rho_g   rho3  rho_b  alphaa   deltaa  tetaa  ethaa  n
              y_o_bar  y_T_bar  y_oil_bar  c_bar  t_bar  r_o_bar   r_T_bar  g_bar k_o_bar  k_T_bar  i_o_bar  i_T_bar ;  

betaa   = 0.99;
alphaa  = 0.34;
deltaa  = 0.02; 
ethaa   = 1.003;
tetaa   = 0.4;
rho_o   = 0.8;
rho_T   = 0.89;
rho_oil = 0.82;
rho_g   = 0.9 ;
rho3    = 0.15 ;
rho_b   = 0.9 ;
n       = 1.007;
y_oil_bar = 10.56 ;    
y_o_bar   = 11.88 ;    
y_T_bar   = 9.29;     
c_bar     = 11.4154 ;  
t_bar     = 8.68 ;     
k_o_bar   = 13.59 ;    
k_T_bar   = 11.54 ;    
r_o_bar   = 1.9 ;            
r_T_bar   = 1.9 ;           
i_o_bar   = 10.77 ;    
i_T_bar   = 8.92 ;     
g_bar     = 10.1344 ;  
model(linear);
lam = -c ;
b   = lam + t ;
lam/betaa = r_o_bar* ethaa *lam(+1)*r_o(+1) ;
r_o = r_T ;
k_T = 1/ethaa*((1-deltaa) * k_T(-1) + i_T_bar/k_T_bar* i_T) ;
k_o = 1/ethaa*((1-deltaa) * k_o(-1) + i_o_bar/k_o_bar* i_o) ;
b = rho_b * b(-1)+ e_b ;
w_o = lam + a_o + tetaa *(k_o - l_o) ;                                   
r_o = lam + a_o + (1-tetaa) *(l_o - k_o) ;                               
y_o = a_o + tetaa * k_o + (1-tetaa)* l_o ;
l_o = (1+n)* l_o(-1) ;
w_T = lam + a_T + alphaa *(k_T - l_T) ;                                   
r_T = lam + a_T + (1-alphaa) *(l_T - k_T) ;                              
y_T = a_T + alphaa* k_T +(1-alphaa)* l_T ;
l_T = (1+n)* l_T(-1) ;
y_o = 1/y_o_bar * (c_bar *c + t_bar*t + g_bar*g + i_o_bar *i_o + i_T_bar* i_T - y_oil_bar* y_oil - y_T_bar*y_T) ;
a_o = rho_o * a_o(-1) + e_o ;  
a_T = rho_T * a_T(-1)  + e_T ;  
y_oil =  rho_oil *y_oil(-1) + e_oil ;
g = rho_g * g(-1) + rho3 *y_oil(-1) + e_g ;
end;
steady;
check;
shocks;
var e_o   ;  stderr 0.11; 
var e_T   ;  stderr 0.062;
var e_oil ;  stderr 0.21;
var e_g   ;  stderr 0.08; 
var e_b   ;  stderr 0.13;
var e_oil , e_g = 0.0103;
end;
stoch_simul(order=1, irf=30, periods=0);

I really appreciate it if you can help me!
Zahra

Your timing for the capital stocks is inconsistent. The law of motion uses the correct stock at the end of period timing while the production function and the marginal products use the wrong beginning of period timing. Moreover, the equation

    l_T = (1+n)* l_T(-1) ;

will produce explosiveness in l_T. It seems you forgot to detrend the model.

Dear jpfeifer,
Thank you for your reply a lot.
I consider the l_T as a deterministic variable that has a deterministic growth rate(n) and do you mean that I should write it as: l_T = (1+n) l_T(-1)+ e ? Could you verify if this approach is correct or not?
Also, I use the equations in stationary form,by dividing variables by the growth rate. And What does this sentence mean: the equation l_T = (1+n)
l_T(-1) will produce explosiveness in l_T? Could you please advise me?
the IRFs do not show the effect of shocks on c and t! I appreciate it if you can tell me the reason.

Thanks in advance,
Zahra

Dear jpfeifer,
Thank you for your reply a lot.
I consider the l_T as a deterministic variable that has a deterministic growth rate(n) and do you mean that I should write it as: l_T = (1+n) l_T(-1)+ e ? Could you verify if this approach is correct or not?
Also, I use the equations in stationary form,by dividing variables by the growth rate. And What does this sentence mean: the equation l_T = (1+n)
l_T(-1) will produce explosiveness in l_T? Could you please advise me?
the IRFs do not show the effect of shocks on c and t! I appreciate it if you can tell me the reason.

Thanks in advance,
Zahra

The reason for not displaying results is that the Blanchard-Kahn conditions are not satisfied. Regarding the l_T equation: start at any value for l_T unequal to 0 and l_T will diverge to ± infinity. Even if you consider this as a deterministic trend, you still have to detrend all equations with this trend. Otherwise, there is no well-defined steady state around which to approximate.

Dear jpfeifer,
Thank you very much.
I have problem with detrending although I read the manual and userguid and benchmark_DSGE.pdf that is mentioned in the other posts!
let me explain everything that I did in one sentence:
(after changing the model a little bit)I derive the optimality conditions, stationarize the non-stationary variables and log-linearize the model, so this is my question:
When I do not have labor as trend as before, how can I detrend the variables( using the deflator=n, it says Unknown symbol: n. that make sense because I have no n in the model )!
could you please verify how can I do this? or could you suggest some other documents?

Dear All,
(for the above model) I derive the optimality conditions, stationarize the non-stationary variables and log-linearize the model, so this is my question.
The question is whether I should detrend the model again (while I stationarize the variables then I linear the model) or not? if no , then why dynare says that There are 5 eigenvalue(s) larger than 1 in modulus
for 2 forward-looking variable(s),
and if yes, the second question about detrending is :
when I use the command var(deflator=n) this error was shown: ERROR: Unknown symbol: n !!!
While in the above model there is l_T = (1+n)* l_T(-1) ! and it is mentioned in the model that n is a paremeter!
And when I use the # sign for introducing the detrend variables in model section, it shows this error: Model local variable lam cannot be given a lead or a lag.
so what can I do?
I very appreciate it if some one can help me!

You have to do it manually and enter the model in stationary form. For example, if capital grows at rate n, the law of motion for capital

is rewritten as

where the variables are now stationary variables. Dividing both sides by (1+n)^t leaves you with

where n is a parameter.

Dear jpfeifer,
Thank you very much indeed. It is a precious hint!
Just another question: would you please let me know if non-statinary model is the reason of this error: "Error: There are 5 eigenvalue(s) larger than 1 in modulus
for 4 forward-looking variable(s) "?
And I did some thing like that for calculating stationary variables manually : according the user guide, page 66 “when shocks are null, real variables grow with At (except for labor, Nt, which is stationary as there is no population growth)” I define that for example, y(t) = Y(t)/n^t , then linearize the model and enter it to the dynare (that is the model mentioned above)!
Now I am confused that if I made mistake or not! if yes, it means that I should calculate the growth rate for every variable manually separately and then I can stationarize every variable by this process,and then log- linearize the stationarize model. Am I right?
Thank you in advance,
Zahra

I am not sure I am following. Look at it this way:

is an explosive autoregressive process as the autocorrelation coefficient (1+n) is bigger than 1. This means that you made a mistake somewhere in your detrending.

The page you quote out of the user guide refers to observation equations in the context of estimation, not the normal model equations.

Dear jpfeifer,
Thank you a lot for your reply again,
yes you are right but I suppose that l_T has a deterministic trend, so it define like this: l_T = (1+n)*l_T(-1). If I stationarize the L_T like what you said in the previous post, I will have: l_T = l_T(-1), and after linearization I will have l_T=l_T(-1) again. Now this equation show that l_T grows at rate 0! Please correct me if I am wrong ! Should I use this equation: l_T = l_T(-1)?
Thank you in advance.

Go back to any intermediate macro textbook and look up how to transform the Solow model into intensive form. After detrending, there is no law of motion for labor in the model anymore.

Dear jpfeifer,
I really appreciate your patience in helping me figure this out.

Dear jpfeifer,
I change my model to omit the law of motion for labor from the model. Now dynare shows that there are 3 eigenvalues and 2 forward looking variables, and when I use the “model_diagnostics(M_,options_,oo_)” command, it does not show any thing! Does it mean that there are some co-linear variables in the model? If yes, how can I find that witch variables are co-linear? Could you please advise me?
Thank you a lot.
Here is my model:

var     y_o  y_T   i_o  i_T  c   a_o  a_T   t  w_o  w_T  w  l  r_o  r_T  l_o  l_T  b   k_o  k_T  g  y_oil;  
varexo  e_o  e_T  e_oil  e_g  e_b;
parameters  y_oil_bar  y_o_bar  y_T_bar  c_bar  i_o_bar  i_T_bar  l_o_bar  l_T_bar  l_bar  k_o_bar  k_T_bar
  r_o_bar  r_T_bar  w_o_bar  w_T_bar  w_bar  g_bar  betaa   rho_o  rho_T  rho_oil  rho_b  
 rho1  rho2  rho3  alphaa   deltaa   thetaa  ethaa  gamaa  rho_g ;
betaa   = 0.99;
alphaa  = 0.34;
deltaa  = 0.02; 
ethaa   = 1.003;
thetaa   = 0.4;
rho_o   = 0.8;
rho_T   = 0.89;
rho_oil = 0.82;
rho_g   = 0.9 ;
rho1    = 0.13 ;
rho2    = 0.13 ;
rho3    = 0.15 ;
rho_b   = 0.9 ;
gamaa   = 1.9 ;
y_oil_bar = 10.56 ;    
y_o_bar   = 11.88 ;   
y_T_bar   = 9.29 ;    
c_bar     = 11.4154 ;  
t_bar     = 8.68 ;  
k_o_bar   = 13.59 ;  
k_T_bar   = 11.54 ;    
r_o_bar   = 1.9 ;           
r_T_bar   = 1.9 ;           
i_o_bar   = 10.77 ;    
i_T_bar   = 8.92 ;     
g_bar     = 10.1344 ;
l_o_bar   = 25.9106 ;      
l_T_bar   = 23.2081 ;    
l_bar     = 49.1187 ;
w_o_bar   = 9.8854 ;       
w_T_bar   = 7.2679 ;        
w_bar     = 17.1533 ; 

model (linear);
c   = w ;
b   = t - c ;
c = betaa/ethaa * r_o_bar *c(+1)*r_o(+1) ;
r_o = r_T ;
k_T = 1/ethaa*((1-deltaa) * k_T(-1) + i_T_bar/k_T_bar* i_T) ;
k_o = 1/ethaa*((1-deltaa) * k_o(-1) + i_o_bar/k_o_bar* i_o) ;
b = rho_b * b(-1)+ e_b ;
l_bar*l = l_o_bar*l_o +l_T_bar*l_T ;
w_o = y_o - c -l_o ;
r_o = y_o - c -k_o ;
y_o = a_o + thetaa * k_o + (1-thetaa) * l_o ; 
w_T = y_T - c -l_T ;
r_T = y_T - c -k_T ;
y_T = a_T + alphaa * k_T + (1-alphaa) * l_T ;
y_oil = rho_oil * y_oil(-1) + e_oil ;
g   = rho_g * g(-1)   + rho3*y_oil(-1) + e_g ;
a_o = rho_o * a_o(-1) + rho1*y_oil(-1) + e_o ;                                                                
a_T = rho_T * a_T(-1) + rho2*y_oil(-1) + e_T ;                                                                  
y_T = t ;    
y_o = 1/y_o_bar*(c_bar*c + i_o_bar*i_o + i_T_bar*i_T - y_oil_bar*y_oil + g_bar*g);                                                                                                                                          
w_bar*w = w_o_bar*w_o + w_T_bar*w_T ;
end;

steady;
check;

shocks;
var e_o   ;  stderr 0.11; 
var e_T   ;  stderr 0.062;
var e_oil ;  stderr 0.21;
var e_g   ;  stderr 0.08; 
var e_b   ;  stderr 0.13;
 var e_T , e_oil = 0.000245;
 var e_o , e_oil = -0.000511;
var e_oil , e_g = 0.0103;
end;

stoch_simul(order=1, irf=30, periods=120 , graph_format = pdf);

No, if it does not show anything, there is most likely a timing error somewhere in your model. Usually, the best way to proceed is to strip down the model to the most basic version that is working and start rebuilding from there.

Thank you very much for your help.
And one another question, I think I found the problem, but there is no c and t in the IRF graphs again!
I would appreciate it if you could give me some advice.
thank you in advance.

If all variables except for a few show up in IRFs, it means that those variables are flat and do not move. If they are supposed to move, there still is a mistake in the model.

Thank you very much,
I will check it again.
Can a mistake in the model lead to this error that there are 3 eigenvalues and 2 forward looking variables?
thanks.