# How To Program Finite General Equilibrium Models

I am wondering the best way to find a numerical solution to a finite general equilibrium model with Matlab. The model is a basic neoclassical growth model with equilibrium equations:

$c_t+k_{t+1}=k_t(1-\delta)+k_t^{\alpha}$(budget constraint)

$c_t^{-\gamma}=\beta c_{t+1}^{-\gamma}(1-\delta+\alpha k_{t+1}^{1-\alpha})$(Euler equation)

This is on a 500 time step time horizon. I tried to solve this using fsolve, but the program does not like the negative exponents in the expression. Is there another way in Matlab to program these? Also there are boundary conditions, let's just say they are $k_1=1$ and $k_{500}=0$.

• You can always cheat and linearize around a balanced growth path... (Well, in this case, you can actually linearize around a steady state, since there's no technology growth.) – Ege Erdil Feb 10 '18 at 11:09
• Is that ok when dealing with a finite time horizon? I actually just took logs and then did a first order Taylor series expansion of the log of the kt+1 term in the Euler equation, is that essentially what you are talking about? – MathStudent Feb 10 '18 at 16:33
• Yes, that's what I am talking about. It's okay when dealing with a finite time horizon - you will just get answers (as in, processes for $c_t$ and $k_t$) which are correct to first order approximation. Your $k_{500} = 0$ condition just serves as a transversality condition to pin down a unique equilibrium path - this doesn't change in the linearized version of the model. – Ege Erdil Feb 10 '18 at 16:36
• Just to make sure I follow this, you want to find $\{\alpha, \beta, \delta, \gamma\}$ s.t. $k_{500} = 0$ and both $k_{t+1}-k_t \to 0$, $c_{t+1} - c_t\to 0$ for $t > 500$? – caverac Feb 11 '18 at 12:18
• No, it is simply a 500 time step problem with those two transition equations and the boundary condition $k_{500}=0$ and $k_1=1$. The $\{\alpha,\beta,\delta,\gamma\}$ is given to me, I just did not put it in the problem. – MathStudent Feb 11 '18 at 18:38