# Small open economy models

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.

Many thanks!
RT
newsalex.mod (2.15 KB)

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 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

Error in ==> steady at 54

Error in ==> newsalex at 185

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

You have some negative values at steady-state, is that normal? What is variable d? it is negative at steady-state.

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?

Thats true but if you express your variables in logs then it cannot be so…

Hi bkjecn,
Those equations are:

1. Production function: y=a*k^(alpha)*h^(1-alpha);
2. Marginal productivity of capital: rk=aalphak^(alpha-1)h^(1-alpha);
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…

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.

Kyri82, btw THANKS for your help!!

If it is not in logs then it is fine. No problem and I hope you will sort it out!

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.

Hi,
Actually I tried also with a=1 in the steady state (which implies a positive value of y) but it doesn’t work…

[quote=“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 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

Error in ==> steady at 54

Error in ==> newsalex at 185

Error in ==> dynare at 120
evalin(‘base’,fname) ;[/quote]

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

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.

bkjecn: thanks! Today I (actually my co-author) fixed it! THANKS again for everything!

Hi rteconomics!
I’m having the same problem as you. Can you tell me how you solved it?
Thank you！