Dealing with a two sector model

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.

Dealing with a two sector model

Postby jcaro » Wed May 30, 2007 3:16 pm

Hi

I've read the previous post on this subject and i still don't understand how to solve the problem when i put two sectors, i can calculate the steady state but i can't make simulations or get the policy fuctions. My model is very simple, a real, two sector model of endowment. I take the example1.mod and add another sector just like the first one and also introduce real wage to make an equilibrium on the two kinds of labour. If someone has solve this problem please give me a hint on what is the issue. Later i will post my code.

Thanks
Carlos
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Re:

Postby jcaro » Thu May 31, 2007 1:17 am

This is my model. I use only capital but the idea is to add labor too.

This is the error i get:

??? Subscript indices must either be real positive integers or logicals.

I hope someone could explain it to me.

Carlos
Attachments
model.mod
(646 Bytes) Downloaded 169 times
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Re:

Postby jcaro » Thu May 31, 2007 3:15 am

Hi;

I've solve the previous error but now i got one that i don't understand.

Blanchard Kahn conditions are not satisfied: indeterminacy

I hope someone could explain it to me. I think that my model is too simple to have a problem with my parameters.

Here is the model corrected, thanks again

Carlos
Attachments
model.mod
(606 Bytes) Downloaded 149 times
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby Assia » Thu May 31, 2007 9:22 am

Hi,

it's a pb relative to the timing of the capital variable, k(+1), that you have to write in Dynare at time t in order to make it predetermined in the sense that the capital stock is decided yesterday (take a look at the attached file).

Best.
Attachments
model.mod
(659 Bytes) Downloaded 196 times
Assia
 

Re

Postby jcaro » Fri Jun 01, 2007 4:16 am

Thanks for the tip, now i get it. However, now i put labor into the model and i think i have the same problem, how to put the variables in the right timing, but i have a diferent error, so i was hoping to get some help;

this is the error:

SOLVE: maxit has been reached
??? Error using ==> steady_
STEADY: convergence problems

i attached the new model.

Thanks

Carlos
Attachments
model.mod
(920 Bytes) Downloaded 157 times
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby Assia » Fri Jun 01, 2007 12:32 pm

Now the timing is correct but looking at your error message we can see the pb is associated with the calculation of the steady state (CV pbs).
You need to check the initial values of each variable in your model. See the mod-file I 'm attaching, the instruction "resid(1)" added before "steady" show you the residuals you obtain in comparison with the guess values. These residuals should be equal (close) to zero.

I hope this helps.

Best
Attachments
model.mod
(930 Bytes) Downloaded 159 times
Assia
 

re:

Postby jcaro » Fri Jun 01, 2007 7:05 pm

Thanks again Assia. I'm new with this and i didn't know that those options existed. I'm wandering if there is a rule to choose the initial values, because no matter how close i get to zero, i'm still getting the same error. I hope you can say something about it, because later i want to do EMM, so i need a model that is stable to the parameters.

Thanks again

Carlos.

PD: I post the model where i change the initial values.
Attachments
model.mod
(897 Bytes) Downloaded 168 times
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby Assia » Fri Jun 01, 2007 9:21 pm

I guessed you did assign starting values as a result of some calculations by hand. I mean the determination of the steady state needs them.
From the top of my hand I would suggest you to find the exact values. I personally choose this way which consists in writing down the analytical solution of each variable in s.s after the instruction "parameters" (or directly into initval) and initializing then the variables at their s.s (e.g C=CSS means the guess value for the consumption,C, is fixed at its s.s value, CSS).

For instance, considering the market condition and production equations, Y=C and Y=L, in s.s we obtain
YSS=LSS;
CSS=YSS;

In general in the literature, we fix the labor LSS=1/3, such that the following should be determined...
Assia
 

re:

Postby jcaro » Sat Jun 02, 2007 8:04 pm

Thanks again, i think i could figure it out.

Carlos
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby nishi » Wed Jun 06, 2007 3:21 pm

Dear jcaro,

I am getting the same error message as you did in May 31.

> May31,2007 you wrote:
> This is the error i get:

> ??? Subscript indices must either be real positive integers or logicals.

It seems that you have successfully overcame this error.
If you don't mind, could you tell me how you overcame this error
message? What was causing this error?

Thank you so much in advance,
Nishi
nishi
 
Posts: 8
Joined: Fri Jun 01, 2007 1:23 am
Location: Ottawa, ON

RE:

Postby jcaro » Wed Jun 06, 2007 4:34 pm

Dear Nishi;

In my case, i got that error because my FONC was time inconsistent. You have to check very carefully that in each equation, the variables are in the right time index, because if you put one of them wrong, then the index is probably a zero, i mean the index in the array or matrix, so the program is trying to find the element zero of that array, that obiously doesn't exists.

If you want you can submit your model to check, anyway, i think that is the problem. Remember that in the equation for the capital accumulation, all the variables have to be in (-1), except the capital for the next period.

Regards
Carlos
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby nishi » Wed Jun 06, 2007 5:41 pm

Dear Carlos,

Thank you very much for yoru detailed and prompt reply.
I will check for the timing in my code and hopefully I can get over this
error.

I really appreciate your kindness.

sincerely,
Nishi
nishi
 
Posts: 8
Joined: Fri Jun 01, 2007 1:23 am
Location: Ottawa, ON

re:

Postby jcaro » Thu Jun 07, 2007 1:52 am

Dear Nishi;

I'm curious, are you working in a two sector model?, i'm getting a lot of trouble trying to get it right, maybe you could help me...

Regards
Carlos
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am

Postby nishi » Thu Jun 07, 2007 8:33 pm

Dear Carlos,

I have taken a brief look at your code and have noticed that you are not log-linearizing the model. DYNARE can, in principle, solve nonlinear system, but I think it is always a good idea to start from the log-linearized system. Good thing about log-linearized system is that, by construction, the steady states of each 'hat' enodogenous variables will be zero.

Nishi
nishi
 
Posts: 8
Joined: Fri Jun 01, 2007 1:23 am
Location: Ottawa, ON

Re:

Postby jcaro » Fri Jun 08, 2007 12:47 am

Dear Nishi;

I appreciate the comment. My proyect change somehow so i'm back into paper trying to make everything coherent, however i hope we could still talk, is almost surreal change opinions with someone else who is in the same issues that myself, but so far away.

Regards
Carlos
jcaro
 
Posts: 10
Joined: Tue May 29, 2007 2:25 am


Return to Dynare help

Who is online

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