Page 1 of 1

Small open economy model

PostPosted: Wed Apr 04, 2012 9:31 am
by rteconomics
Hello,
I'm trying to run the attached code. It's a small open economy model with 2 frictions: capital adjustment costs and government reversal expenditure. I closed the model by specifying a foreign debt elastic interest rate.
When running the code, I get this error message: "numerical initial values incompatible with the following equations 22". It weird since I don't see why the initial values (calculated by hands) should be incompatible.

Could anyone please help me?
Many thanks!
RT

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 2:42 pm
by bkjecn
Your steady state values don't solve the model, however the problem is not in equation 22. I don't know why it is giving that error, but if you replace 'initval' with 'steady_state_model' (see the documentation here http://www.dynare.org/manual/index_20.h ... _005fmodel if you are interested), and you will see that the residuals of equations 6-8 are not zero. I would focus on those equations...

After making the change, the output from Dynare in Matlab is

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0.28083
Equation number 7 : 0.15556
Equation number 8 : 0.95483
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0
Equation number 13 : 0
Equation number 14 : 0
Equation number 15 : 0
Equation number 16 : 0
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : 0
Equation number 23 : 0


??? Error using ==> steady_ at 104
The steadystate values returned by newsalex_steadystate.m don't solve the static model!

Error in ==> steady at 54
steady_;

Error in ==> newsalex at 185
steady;

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

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 2:46 pm
by kyri82
You have some negative values at steady-state, is that normal? What is variable d? it is negative at steady-state.

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 3:37 pm
by rteconomics
Hi Kyri82, well I think (but I'm not sure) it is possible to have negative values since d is the net foreign position of the government. Am I wrong?

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 3:38 pm
by kyri82
Thats true but if you express your variables in logs then it cannot be so...

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 3:41 pm
by rteconomics
Hi bkjecn,
Thanks for your reply!!
Those equations are:

6) Production function: y=a*k^(alpha)*h^(1-alpha);
7) Marginal productivity of capital: rk=a*alpha*k^(alpha-1)*h^(1-alpha);
8) Marginal productivity of labor: w=a*(1-alpha)*k^(alpha)*h^(-alpha);

I think the issue is with a (the TFP process): a=rhoa*a(-1)+ea;
I specified the steady state value to zero and the steady state of equations 6, 7, and 8 as:

y=k^(alpha)*h^(1-alpha);
rk=alpha*k^(alpha-1)*h^(1-alpha);
w=(1-alpha)*k^(alpha)*h^(-alpha);

For some reason this is wrong but I can't see why...

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 3:43 pm
by rteconomics
Kyri82, you're right... but the model is not in logs (in the sense that it's not the log-linearized version) and that's why I'm not sure.

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 3:43 pm
by rteconomics
Kyri82, btw THANKS for your help!!

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 4:04 pm
by kyri82
If it is not in logs then it is fine. No problem and I hope you will sort it out!

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 5:12 pm
by bkjecn
If the steadystate value of 'a' is zero, then the steadystate value of equations 6-8 is zero. They are all multiplied by 'a'. I think right now your model implies a zero steady state for output.

Re: Small open economy model

PostPosted: Wed Apr 04, 2012 8:35 pm
by rteconomics
Hi,
Actually I tried also with a=1 in the steady state (which implies a positive value of y) but it doesn't work..

Re: Small open economy model

PostPosted: Thu Apr 05, 2012 3:06 pm
by flyingpig
bkjecn wrote:Your steady state values don't solve the model, however the problem is not in equation 22. I don't know why it is giving that error, but if you replace 'initval' with 'steady_state_model' (see the documentation here http://www.dynare.org/manual/index_20.h ... _005fmodel if you are interested), and you will see that the residuals of equations 6-8 are not zero. I would focus on those equations...

After making the change, the output from Dynare in Matlab is

Residuals of the static equations:

Equation number 1 : 0
Equation number 2 : 0
Equation number 3 : 0
Equation number 4 : 0
Equation number 5 : 0
Equation number 6 : 0.28083
Equation number 7 : 0.15556
Equation number 8 : 0.95483
Equation number 9 : 0
Equation number 10 : 0
Equation number 11 : 0
Equation number 12 : 0
Equation number 13 : 0
Equation number 14 : 0
Equation number 15 : 0
Equation number 16 : 0
Equation number 17 : 0
Equation number 18 : 0
Equation number 19 : 0
Equation number 20 : 0
Equation number 21 : 0
Equation number 22 : 0
Equation number 23 : 0


??? Error using ==> steady_ at 104
The steadystate values returned by newsalex_steadystate.m don't solve the static model!

Error in ==> steady at 54
steady_;

Error in ==> newsalex at 185
steady;

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



I also have a model which residuals are not all zeros. What does these residuals mean, please tell me!! Thank you!!!

Re: Small open economy model

PostPosted: Thu Apr 05, 2012 3:54 pm
by bkjecn
rteconomics: you have to change the model so that the steady state of 'a' actually is something other than zero. One way to do this would be to say that log(a) = rho * log(a(-1)) + e where 'e' is a shock. Then 'a' is always positive and the steady state is 1.

flyingpig: if you take all of your equations and write them so that they are of the form '0 = equation', the residual is the value of the right-hand side when you plug in the values you gave the model for steady-state values. These all have to be zero for the steady-state values to actually satisfy the equations of the model. If you have non-zero residuals, then you failed to solve for the steady-state values.

Re: Small open economy model

PostPosted: Thu Apr 05, 2012 7:19 pm
by rteconomics
bkjecn: thanks! Today I (actually my co-author) fixed it! THANKS again for everything!