Warming up with the RBC Model

Consider an RBC model in which preferences are given by

t=0βtCt1γ1γ,\sum_{t=0}^\infty \beta^t \frac{C_t^{1-\gamma}}{1-\gamma},

production follows

Yt=ZtKt1αLˉ1α,Y_t = Z_t K_{t-1}^\alpha \bar L^{1-\alpha},

capital evolves according to

Kt=(1δ)Kt1+YtCt,K_t = (1-\delta)K_{t-1}+Y_t - C_t,

and productivity evolves according to

logZt=ρlogZt1+εt,\log Z_t = \rho \log Z_{t-1} + \varepsilon_{t},

where ε\varepsilon is an exogenous, mean-zero innovation to TFP. I have adopted a convention of dating the capital stock selected in period tt and used in production in t+1t+1 as KtK_t so that a variable dated tt is measurable with respect to date-tt information.

The model can be summarized by the following expectational difference equations

Ctγ=βRt+1Ct+1γRt=αZt(Kt1/Lˉ)α1+1δKt=(1δ)Kt1+YtCtYt=ZtKt1αLˉ1αlogZt=ρlogZt1+εt.\begin{aligned}C_t^{-\gamma} &= \beta R_{t+1} C_{t+1}^{-\gamma} \\ R_t &= \alpha Z_t \left( K_{t-1} / \bar L \right)^{\alpha-1} + 1 - \delta \\ K_t &= (1-\delta)K_{t-1}+Y_t - C_t \\ Y_t &= Z_t K_{t-1}^\alpha \bar L^{1-\alpha} \\ \log Z_t &= \rho \log Z_{t-1} + \varepsilon_{t}. \end{aligned}

We will fix Lˉ=1\bar L = 1. The steady state is then

Zˉ=1Rˉ=1/βKˉ=(Rˉ1+δα)1/(α1)Yˉ=KˉαCˉ=YˉδKˉ.\begin{aligned} \bar Z &= 1 \\ \bar R &= 1/ \beta \\ \bar K &= \left( \frac{\bar R-1+\delta}{\alpha} \right)^{1/(\alpha - 1)} \\ \bar Y &= \bar K^\alpha \\ \bar C &= \bar Y - \delta \bar K. \end{aligned}

where we use the convention that bars denote steady state values.

We are going to solve for a perfect foresight transition path: the economy is at steady state and expected to remain there when at t=0t=0 a realization of ε00\varepsilon_0 \neq 0 occurs. The economy assumes no further ε\varepsilon's will occur. This experiment sounds strange---why would the economy not expect these shocks even when they just saw one? It turns out that this experiment gives us the same impulse response to the ε\varepsilon shock as a first-order perturbation of a stochastic environment. The first-order perturbation solution features certainty equivalence, which means the agents behave as if future random variables are replaced by their mean values. In the case of ε\varepsilon, that means E0[εt]=0\mathbb E_0[\varepsilon_t] = 0 for all t>0t > 0.

Let Xt={Ct,Rt,Kt,Yt,Zt}X_t=\left\{C_t,R_t,K_t,Y_t,Z_t\right\} be the endogenous variables at date tt. The unknown is a sequence X{Xt}t=0TX \equiv \left\{X_t\right\}_{t=0}^T. In our computations, we will assume that after some large TT the economy has returned to steady state. We also assume the economy was in steady state before the shock occurs. Therefore we use the conventions xT+1=x1=xˉx_{T+1} = x_{-1} = \bar x for any variable xx. We will use EtE_t for endogenous variables, which in this case is Et=εtE_t = \varepsilon_t. EE without a subscript is the sequence E{Et}t=0T.E \equiv \{E_t\}_{t=0}^T. Finally, let Xˉ\bar X and Eˉ\bar E be the sequences in which all variables remain at their steady state values.

At a given date, the equations of the model can be written as

f(Xt1,Xt,Xt+1,Et)=0.f(X_{t-1},X_t,X_{t+1},E_t) = 0.

We can stack these equations for all dates to write

f(X,E)=0.f(X,E) = 0.

Our goal is to simply solve this equation for XX given a value of EE. We will consider two stategies. First, we can ``linearize'' the model. Let fX(Xˉ,Eˉ)f_X(\bar X, \bar E) and fE(Xˉ,Eˉ)f_E(\bar X, \bar E) be the Jacobians of ff with respect to XX and EE, respectively, both evaluated at steady state. We can then solve for a first-order approximation as

fX(Xˉ,Eˉ)(XXˉ)+fE(Xˉ,Eˉ)(EEˉ)=0X=Xˉ[fX(Xˉ,Eˉ)]1fE(Xˉ,Eˉ)(EEˉ).\begin{aligned} &f_X(\bar X,\bar E)(X - \bar X) + f_E(\bar X,\bar E)(E - \bar E) = 0 \\ &X = \bar X - \left[ f_X(\bar X,\bar E) \right]^{-1}f_E(\bar X,\bar E)(E - \bar E). \end{aligned}

Alternatively, we can seek a non-linear solution using Newton's method. Suppose we have a candidate solution in iteration jj denoted X(j)X^{(j)}, we then form a new solution X(j+1)X^{(j+1)} as

X(j+1)=X(j)[fX(X(j),E)]1f(X(j),E).X^{(j+1)} = X^{(j)} - \left[ f_X( X^{(j)}, E) \right]^{-1}f( X^{(j)}, E).

We iterate on this equation until f(X(j),E)f( X^{(j)}, E) is approximately zero.

Code

The RBC example is solved by the file RBC.jl, which makes use of ModelUtils.jl. We will be using ModelUtils.jl again later in this course so reading the documentation would be a good investment.

Next step

We will now turn to heterogeneous agent models starting with the endogenous grid method