In order to find the steady state of an RBC model in Matlab, we need to solve a set of nonlinear equations. Specifically, we need to find the values of the endogenous variables that satisfy the model's dynamic equations and the market clearing conditions.
A common approach to solve this kind of problems is to use the built-in Matlab function fsolve
, which implements a numerical solver for nonlinear equations. The general steps to find the steady state are as follows:
Define the RBC model's dynamic equations and market clearing conditions as a function that takes the endogenous variables as input.
Use fsolve
to find the values of the endogenous variables that satisfy the function output. The initial guess for the endogenous variables can be set to any reasonable value.
Here's an example of how this process can be implemented:
main.m596 chars26 lines
In this example, the RBC model consists of a production function, an Euler equation, and the market clearing conditions for capital and labor. The variables to solve for are capital (k
), consumption (c
), the interest rate (r
), and the wage rate (w
). The parameters of the model are set to some arbitrary values.
The rbc_ss
function defines the equations of the model as a system of four nonlinear equations that must be satisfied at the steady state. fsolve
is called with the @rbc_ss
argument, indicating that it should solve for the zeros of the rbc_ss
function. The initial guess for the steady state values is set with the x0
variable.
The solution is returned as the x_ss
vector, which contains the steady state values for k
, c
, r
, and w
.
gistlibby LogSnag