Now let's extend our model to general equilibrium of a production economy as in Aiyagari (1994). Instead of being endowed with income, let's say the consumer is endowed with random amounts of labor (efficiency units) that are sold at wage per efficiency unit. So now the household budget constraint is
where now we interpret is the labor endowment.
Production takes place within a representative firm according to the production function
During production, the capital depreciates by amount . The first order conditions of the firm's problem are
The aggregate supply of capital comes from the savings of the households so we have
where is the distribution of household over the state space. Similarly, the aggregate supply of labor is given by
will be determined by the ergodic distribution of the process for and can be calculated separately from the rest of the model.
In specifying the model, the last step is to explain where the distribution comes from. In a stationary equilibrium, the distribution of wealth is the one that recreates itself when households follow the equilibrium savings rule and are subjected to the income shocks drawn from . Mathematically, given a distribution function , define such that
for any set of asset holdings . A stationary distribution is one where .
In practice we find the stationary distribution by simulating a population of households and the standard algorithm for computing such an equilibrium is as follows
To simulate a population of households we could use one of several approaches. For the work that comes later it will be useful to use a particular version of non-stochastic simulation. The broad idea is to approximate with histograms corresponding to the continuous distributions of associated with each of the values of . To do so we can use the same grid of points that we used in the endogenous grid method. Then let for be a vector of length that gives the mass of households on the histogram nodes for each value of . These vectors then represent .
A small challenge with this approach is that the policy rule will not necessarily select values on the grid. Therefore we need a method of allocating households to grid points near their intended level of savings. To do so we use the guiding principle that the algorithm should preserve the aggregate level of savings. Suppose a unit mass of households have states such that the decision rule selects a level of savings where then we will allocate a share of this mass to and a share of the mass to such that . This logic is summarized in the figure below.
Let without subscript represent the vectors stacked on top of one another. Then we can create a transition matrix, , that updates the distribution according to . We create column by column. For each pair of current state variables corresponding to an element in we fill in elements of corresponding to the two adjacent savings levels that the decision rule maps into according to the previous paragraph crossed with the probabilities of the possible realizations of next period's labor productivity.
The stationary distribution of wealth is then the ergodic distribution of the Markov chain , which is given by the Eigenvector of associated with the unit Eigenvalue normalized to sum to one.
To construct the matrix , we can work with one pair of states at a time corresponding to a column of . These states result in saving . We then find the that solves assuming that . This yields
We then create an vector that has in location entry and in location . We then stack this vector times multiplying each by the exogenous transition probabilities .
See Aiyagari.jl
for an implementation of these methods. The codes produce the supply and demand diagram below. As the interest rate rises, households save more and the supply of capital increases. On the other side of the market, firms demand less capital as the interest rate rises.
Here, we have assumed that the economy remains in a stationary equilibrium. Next, we consider how the economy reacts to a temporary change in productivity. We do this by solving for a perfect-foresight transition path.