Thesis Model 3

Individuals variables are in lowercase (when it's needed I will add to the notation the subindex $j$ for firms' variables and $i$ for households' variables).

Households

There is a continuum of households of mass 1 aligned in the cartesian product $[0\; , \; 1] \times [0\; , \; 1]$.

Households are subject to an idiosyncratic employment shock, that follows a two state Markov's process $n_t\in\{n_e,n_u\}$ (employed, unemployed). Households supply labor inelastically. Therefore, aggregate stationary employment is determined by the probabilities of the Markov's process: \begin{equation*} Pr_N^*(e)=Pr(n'=n_e|n=n_u)\,/\,\big[Pr(n'=n_u|n=n_e)+Pr(n'=n_e|n=n_u)\big] \quad \quad Pr_N^*(u) = 1- Pr_N^*(e) \end{equation*} $$N = Pr_N^*(e) n_e + Pr_N^*(u) n_u $$

Households can invest capital $k$ in a single firm (randomnly chosen if indeference). A single firm can (and will) recieve capital investments from more than one houshold; but a single household cannot invest in more than one firms. Threfore, for example, if houshold $i$ invests $k_t^i$ in firm $j$, in the next period she can claim a portion of firm $j$ benefits proportional to her investment, i.e. $\Pi_{t+1} (k_t^i/k_t^j) - \delta k_t^i$. Where $k^j_t$ is the total investment recieved by firm $j$, and $\delta$ is the depreciation rate. Thus one can construct the capital return rate $r_{t+1} \equiv \Pi_{t+1}/k_t^j) - \delta$.

However, those benefits depend -among other variables- on the price shock. If firms can adjust prices the benfit will be $\hat{\Pi}$ ($\hat{r})$, else $\check{\Pi} ($\check{r}). This shock is i.i.d. among firms, i.e., chosing another firm will not change the investment risk.

Household can buy the final good not only to use it as capital, but to consume. Consumptions preferences are defined by a CRRA instantaneous utility function with RRA parameter $\gamma$, and by the intertemporal discount factor $\beta$.

Finally, households can borrow or lend to the rest of the world at a safe rate $R_f$ by purchasing positive or negative amounts of the safe asset $b$.

$$ c_t+k_t+b_t \leq n_t W_t + k_{t-1}(1+r_t) + b_{t-1}(1+R_f) $$\begin{equation*} c_t \geq 0 \end{equation*}\begin{equation*} k_t \geq 0 \end{equation*}\begin{equation*} b_t \geq b_{min} \end{equation*}

Firms

The aggregate good $Y$ is produced with a continuum of intermediate goods, the technology is defined by the CES $\rho$ and the TFP $A$.

Each firm production function is: $$ y_t=z_t k_{t-1}^\eta l_t $$

All firms choose their ideal price, but only a fraction of them can set prices. A firm sets prices with probability $\lambda$ at any given period. If she cannot set prices, its price will be the previous optimal price. $P_t^j=\hat{P}_t^j$ con probabilidad $\lambda$; o $P_t^j=\hat{P}_{t-1}^j$ con probabilidad $1-\lambda$.

Additionally, the firms are subject to a second idiosyncratic shock, this time a shock over their individual TFP, which is determined by the random variable $z_t$.

Before the shocks each firm choses her optimal price. Once the the shocks take place, $z_t$ and $P_t$ are defined, which will determine the demanded amount $y_t$ for each firm (note that it will vary between firms). Moreover, this will determine the labor demand $l_t$ for each firm. However, this will have no impact on the capital $k_{t-1}$ required to produce, since it has been already set in the previous period.

The optimal price in real terms is

\begin{equation} \label{p_rel_opt} \hat{p}_t = \frac{1}{\rho} \Big[ (1-\alpha_t) \frac{w_t}{\zeta k_{t-1}^\eta} + \alpha_t \frac{w_{t+1}}{\zeta k_{t}^\eta}(1+\pi_t) \Big] \end{equation}

Where $\zeta \equiv 1/E(1/z_t) \;\;\; \forall t$.

Rest of the world

The rest of the world borrow (or lend) the amount $b$ to a local household at a free risk rate $r_f$.

However they only lend if a collateral restriction is satisfied: $ b_{t} \geq b_{min} $

Central Bank

It sets the inflation rate $\pi$.

Equilibrium at Stationary State

At stationary state, aggregate variables as aggregate labour supply, real wage, and aggregate capital are constant and represented by $N$, $W$ and $K$.

Intermediate Goods Market

\begin{equation} \hat{p}=\big[ \lambda + (1+\lambda)(1+\pi^*)^{\sigma -1} \big]^\frac{1}{\sigma -1} \end{equation}\begin{equation} \alpha = \frac{(1-\lambda)\frac{(1+\pi^*)^{\sigma-1}}{1+R}}{\lambda+(1-\lambda)\frac{(1+\pi^*)^{\sigma-1}}{1+R}} \end{equation}

Labor Market

\begin{equation} \label{w_ee} w=\frac{ \hat{p}^{\frac{\tau+(1-\tau)\sigma}{\tau}} \rho \tau \zeta^{1/\tau} }{ Y^{\frac{1-\tau}{\tau}} \Big[ 1 - \alpha + \alpha (1+\pi)^{\frac{\tau+(1-\tau)\sigma}{\tau}} \Big] } K^{\eta/\tau} \end{equation}\begin{equation} Y = \frac{\zeta AN^\tau K^\eta\hat{p}^\sigma}{ \Big[ \lambda + (1-\lambda) \big(1+\pi\big)^{\sigma/\tau} \Big]^{\frac{\tau+(1-\tau)\sigma}{\tau}} } \end{equation}

Return on capital

\begin{equation} \label{r_ee_2} r = \left\{ \begin{array}{llll} \hat{r} = \frac{\hat{\Pi}(k,w,z_H) }{k} -\delta & \text{con probabilidad } \lambda \theta \\ \hat{r} = \frac{\hat{\Pi}(k,w,z_L) }{k} -\delta & \text{con probabilidad } \lambda (1-\theta) \\ \check{r}=\frac{\check{\Pi}(k,w,z_H) }{k} -\delta & \text{con probabilidad } 1-\lambda \theta \\ \check{r}=\frac{\check{\Pi}(k,w,z_L) }{k} -\delta & \text{con probabilidad } (1-\lambda) (1-\theta) \end{array} \right. \end{equation}

Where $\theta$ is the probability that $z_t=z_H$, and $z_H>z_L$.

Assets grid

There are lower bounds for the assets:

\begin{equation*} b \geq b_{min} \end{equation*}\begin{equation*} k \geq 0 \end{equation*}

But there is no clear maximum. Usually, when we are dealing with only one asset we choose the upper bound for the grid somewhat arbitrarily.

When dealing with two asset it would be useful to choose an arbitrary large upper bound for the sum of the assets, this is what Hintermaier & Koeniger (2010) did (maybe not explicitly).

\begin{equation*} k + b \leq x_{max} \end{equation*}

So we can picture the feasible set as a triangle in the $k'$ $b'$ plane (instead of a more intuitive square).

In fact, it would be useful to define $x\equiv k + b$ and replace $b$ for $x$, for the EGM method. This is the approach followed by Hintermaier & Koeniger (2010). Re-thinking the problem in terms of $k$ and $x$ (instead of $k$ $b$) will let us handle the occasionally binding constraint easier, and iterate over a single policy function.

Then, the $b$ restriction becomes: \begin{equation*} x-k \geq b_{min} \end{equation*}

Which means: \begin{equation*} k \leq x - b_{min} \end{equation*}

$b$ lower bound now is an upper bound for $k$.

Households problem at stationary state

The household problem at stationary state is:

\begin{equation*} \begin{aligned} V(k_{t-1},b_{t-1}|n_t,r_t) = \max_{k_t,b_t} & \Big\{ \frac{(c_t)^{1-\gamma} -1}{1-\gamma} + \beta E_t V(k_{t},b_{t}|n_{t+1},r_{t+1}) \Big\} \\ \text{sujeto a: } & n_t W + k_{t-1} \big(1+r_t\big) + b_{t-1} \big(1+R_f\big) \geq c_t + k_t + b_t \\ & k_t \geq 0 \\ & b_t \geq b_{min} \end{aligned} \end{equation*}

Then, the policy correspondence that solves this problem is:

\begin{equation} \label{g} \begin{aligned} g(k_{t-1},b_{t-1}|n_t,r_t) = \text{arg}\max_{k_t,b_t} & \Big\{ \frac{(c_t)^{1-\gamma} -1}{1-\gamma} + \beta E_t V(k_{t},b_{t}|n_{t+1},r_{t+1}) \Big\} \\ \text{sujeto a: } & n_t W + k_{t-1} \big(1+r_t\big) + b_{t-1} \big(1+R_f\big) \geq c_t + k_t + b_t \\ & k_t \geq 0 \\ & b_t \geq b_{min} \end{aligned} \end{equation}

To simplify notation we can say that: \begin{equation*} \label{pol} \begin{aligned} (k_{t},b_t) & = g(k_{t-1},b_{t-1}|r_t,n_t) \\ k_{t} & = g_k(k_{t-1},b_{t-1}|r_t,n_t) \\ b_{t} & = g_b(k_{t-1},b_{t-1}|r_t,n_t) \end{aligned} \end{equation*}

Importantly $g$ is characterized by the FOC of the household problem's those are:

$$ c_t^{-\gamma}-\eta^b_t = \beta (1+R_f) E_t[c_{t+1}^{-\gamma}] \\ c_t^{-\gamma}-\eta^k_t = \beta E_t[(1+r_{t+1})c_{t+1}^{-\gamma}] \\ \eta^k_t k_t \geq 0 \; \; \; \; \; k_t \geq 0 \\ \eta^b_t (b_t-b_{min}) \geq 0 \; \; \; \; \; b_t \geq b_{min} $$

Where $\eta^b$ is the Lagrange's multiplier for $b$'s lower bound, and $\eta^k$ is the Lagrange's multiplier for $k$'s one.

The basic steps in the computation of the stationary distribution consists of an outer and inner loop. In the outer loop, we compute the aggregate capital stock and, hence, the factor prices and unemployment compensation.

In the inner loop, we use the prices to compute the optimal policy function of the household using EGM. Then we compute the transition probability matrix having asset $a'$ at state $(\epsilon',\theta')$ at next period given that current period is $a$ $\epsilon, \theta$. Finally we find the stationary distribution for $a$ and the aggregate capital.

Therefore we start with a first guess for $K_0$. This could be the stationary value for the representative agent problem, for example.

Basic assumptions

Let $r_l \equiv r(\min{z})$ and $r_e \equiv E[r(z)]$, then two senseful assumptions are:

$$ r_e>R_f>r_l $$

(Following Hintermaier & Koeniger (2010) one should write $1+R_f>\mu_k[1+r_l]$ and $\mu_k$ could be different from 1, but I don't care for other cases different from $\mu_k=1$ in this model).

Assets grid

There are lower bounds for the assets:

\begin{equation*} b \geq b_{min} \end{equation*}\begin{equation*} k \geq 0 \end{equation*}

But there is no clear maximum. Usually, when we are dealing with only one asset we choose the upper bound for the grid somewhat arbitrarily.

When dealing with two asset it would be useful to choose an arbitrary large upper bound for the sum of the assets, this is what Hintermaier & Koeniger (2010) did (maybe not explicitly).

\begin{equation*} k + b \leq x_{max} \end{equation*}

So we can picture the feasible set as a triangle in the $k'$ $b'$ plane (instead of a more intuitive square).

In fact, it would be useful to define $x\equiv k + b$ and replace $b$ for $x$, for the EGM method. This is the approach followed by Hintermaier & Koeniger (2010). Re-thinking the problem in terms of $k$ and $x$ (instead of $k$ $b$) will let us handle the occasionally binding constraint easier, and iterate over a single policy function.

Then, the $b$ restriction becomes: \begin{equation*} x-k \geq b_{min} \end{equation*}

Which means: \begin{equation*} k \leq x - b_{min} \end{equation*}

$b$ lower bound now is an upper bound for $k$.

The Endogenous Grid Method

Original policy functions are

\begin{equation*} g_k(k_t,b_t,n_{t+1},z_{t+1}) = k_{t+1} \end{equation*}\begin{equation*} g_b(k_t,b_t,n_{t+1},z_{t+1}) = b_{t+1} \end{equation*}

Replacing $b$ with $x$, we have (redefining $g_k$): \begin{equation*} g_k(k_t,x_t,n_{t+1},z_{t+1}) = k_{t+1} \end{equation*} \begin{equation*} g_x(k_t,x_t,n_{t+1},z_{t+1}) = x_{t+1} \end{equation*}

Where $g_x$ is the sum of the previous $g_k$ and $g_b$

Let suppose the economy ends at period $T$ then the policy function at period $T$ for $x$ would be $0=g_k^T(k_{T-1},x_{T-1},n_T,z_T)$

The EGM method iterates backwards, that is in the first iteration it goes from $g_x^T$ to $g_x^{T-1}$. In the $m$-th iteration it goes from $g_x^{T-(m-1)}$ to $g_x^{T-m}$. Note that when $m \to \infty$ the resulting functions are the same and we get the policy function of some period that is infinitely away form the end period of the economy, that is $g_x$.

First step of EGM

The first step of the algorithm begins with the FOC-one and the budget constrain.

Since \begin{equation*} c'=C(k',x',n',z',x'')=x'+k'(r(z')-R_f) + n'W - x'' \end{equation*} Where $c'=c_{t+1}$, $k'=k_t$, $x'=x_t$, $n'=n_{t+1}$, $z'=z_{t+1}$ and $x''=x_{t+1}$.

Then using $g_x'$ we get: \begin{equation*} c'=C(k',x',n',z';g_x')=x'+k'(r(z')-R_f) + n'W - g_x'(k',x',n',z') \end{equation*}

To simplify notation, let's define $h$: $$ h(k',x',n;g_x') = \beta E\{C(k',x',n',z';g_x')^{-\gamma}[r(z')-R_f]\,|\,n\} $$

$h$ depends only of: $k'$, $x'$ and $n$, since the expectation operator "replaces" $n'$ and $z'$ for $n$.

Then \begin{equation*} \eta_b-\eta_k = h(k',x',n;g_x') \end{equation*}

4 cases

If the restriction for $k'$ is not binding, that is $k'>0$, then $\eta_k=0$. If the restriction for $b'$ is not binding, that is $b'>b_{min}$ or using $x$: $k'<x'-b_{min}$, then $\eta_b=0$.

Thus, there are four cases where:

  1. $0<k'<x'-b_{min}$, then $\eta_k=\eta_b=0$
  2. $0<k'=x'-b_{min}$, then $\eta_k=0$
  3. $0=k'<x'-b_{min}$, then $\eta_b=0$
  4. $0=k'=x'-b_{min}$ ($\eta_k$ and $\eta_b$ are indeterminate).

Before hopping into each case, let me ask the following question: Given a policy function $g_x'$ and a pair $(x',n)$, what is the value of $k'$ that makes $h=0$? Let the answer be the implicit function $\tilde{\kappa}$, then: $$ \tilde{\kappa}(x',n;g_x')=\tilde{k'} \; \; \; \iff \; \; \; 0 = h(x',\tilde{k'},n;g_x') $$

Case 1: inner solution

If $\tilde{k'}$ is in the feasible interval, that is $0 \leq \tilde{\kappa}(x',n;g_x') \leq x'-b_{min}$, then $\tilde{k'}$ is a solution for the FOC 1, and $\eta_b=\eta_k=0$.

If it doesn't, this means there is not feasible $k'$ that holds the FOC 1 without binding with a restriction. That is $\forall k'\in[0;x'-b_{min}]\,:\;\; 0\neq h(x',k',n;g_x')$. This implies, due to continuity, that given a pair $(x',n)$ there cannot coexist a feasible $k'$, say $k'_>$ that makes $h(x',k'_>,n;g_x')>0$ and another feasible $k'$, say $k'_<$ that makes $h(x',k'_<,n;g_x')<0$. Because if the latter were true, continuity would impose that there would be a intermediate feasible $k'$ such as $\hat{k'}=\alpha k'_> + (1-\alpha) k'_<$ that makes $h(x',\hat{k'},n;g_x')=0$.

Simple put, if $\tilde{k'}$ is not in the feasible interval for a given pair $(x',n)$, then for every feasible $k'$ all images of $h(x',k',n;g_x')$ are either positive or negative. That is, $\forall k'\in[0;x'-b_{min}]\,:\; 0>h(x,k',n;g_x') \; \; \lor \; \;\forall k'\in[0;x'-b_{min}]\,:\; 0<h(x,k',n;g_x') $.

Assume $x-b_{min}>0$, then $k'$ cannot be simultaneously $k'=x-b_{min}$ and $k'=0$. That is, if one restriction is binding $\eta_i\geq0$, the other is not $\eta_j=0$.

Case 2: corner solution - maximum

If, for a given pair $(x',n)$, we have that $x-b_{min}>0$ and $h(x',k',n;g_x')>0$ for all feasible values of $k'$; then, $\eta_b-\eta_k>0$, then $\eta_b>0$, then $k'=x-b_{min}$ and $\eta_k=0$.

Case 3: corner solution - minimum

If, for a given pair $(x',n)$, we have that $x-b_{min}>0$ and $h(x',k',n;g_x')<0$ for all feasible values of $k'$; then, $\eta_b-\eta_k<0$, then $\eta_k>0$, then $k'=0$ and $\eta_b=0$.

Case 4: double binding

Finally, if $x-b_{min}=0$, this means $x-b_{min}=k'=0$ and both Lagrange's multipliers can be positive $\eta_b\geq0$ and $\eta_k\geq0$. Although we do know the value of $k'$, we do not know the value for $\eta_b$, which is required for the next step.

What does $\eta_b\geq0$ mean? It means that $c^{-\gamma} \geq \beta (1+R_f) E[c'^{-\gamma}]$. That is, $\eta_b$ measures the deviation from the typical Euler equation. Since we know that $x'=b_{min}$ and $k'=0$, we can easily calculate $c'$ and $\beta (1+R_f)E[c'^{-\gamma}]$. Then, the above inequation becomes $c \leq bound^{-\frac{1}{\gamma}} $. Which means, the household would love to have a higher $c$ and make the marginal utility of present consumption lower, but she cannot afford it, she is poor. How much is she going to spend in consumption when she cannot afford the optimal level? When she is poor, she will consume as much as she can and saves as little as she can (i.e., $x'=b_{min}$). If she has \$5, she will spend \\$5. If she has \$10, she will spend \\$10. There is not a unique solution for $c$, nor for $x$. In other words she could have been poor or very poor. That is, there are many values of $k$ and $x$ that would make the household poor enough to decide not to save, i.e., $x'=b_{min}$.

We will use the first three cases to get a first $g_x$ and then we will adjust it by incorporating the consequences of the fourth case.

Then, we retrieved the optimal portfolio diversification, i.e., if we know a household's employment state $n$ and how much she wants to save ($x'$), we can calculate how she will diversify it, i.e., $k'$ and $b'$. This is what the following equation tells us. $$ \kappa(x',n;g_x')=\text{med}\big\{0\,;\,\tilde{\kappa}(x',n;g_x')\,;\,x'-b_{min}\big\} $$

Also it is possible to retrieve $\eta_b$, recall that if $x'>b_{min}$ there cannot be simultaneously $\eta_k=0$ and $\eta_b=0$ (and none of them can ever be negative). Therefore: $$ \kappa_b(x',n;g_x')=\text{max}\big\{0\,;\,h(x',\kappa(x',n;g_x'),n;g_x')\big\} $$

Note that in the case where $x'=b_{min}$, $\kappa_b$ indicates $\eta_b$ lower bound. That is $\eta_b\geq \kappa_b(b_{min},n;g_x')$.

Second step of the EGM

We internalize the optimal portfolio diversification, so we no longer need to track two assets, if we know one asset we know the other asset.

First, define $\hat{g}_x'$ by combining $g$ and $\kappa$ as: $$ \hat{g}_x'(x',n,n',r';g_x')=g_x'(x',\kappa(x',n;g_x'),n',r') $$

Recall the first FOC equation: \begin{equation*} c^{-\gamma}-\eta_b = \beta (1+R_f) E[c'^{-\gamma}\,|\,n] \end{equation*}

To get $c$ we need $c'$ and $\eta_b$.

We already know $\eta_b$ for almost all cases, and we can calculate $c'$ as:

\begin{equation*} c'=g_c(x',n,n',r';g_x')= x'(1+R_f)+\kappa(x',n;g_x')(r'-R_f) + n'W - \hat{g}_x'(x',n,n',r';g_x') \end{equation*}

Then we can find $C^*(x',n;g_x')$ as: $$ C^*(x',n;g_x') = \Big\{\beta (1+R_f) E[C(x',n,n',z';g_x')^{-\gamma}\,|\,n] + \kappa_b(x',n;g_x')\Big\}^{-1/\gamma} $$

When $x'>b_{min}$, then we know $\eta_b = \kappa_b(x',n;g_x')$, so $c = C^*(x',n;g_x')$. However, if $x'=b_min$, then $\eta_b \geq \kappa_b(x',n;g_x')$, so $c \leq C^*(x',n;g_x')$.

If a household in the previous period consumed as much as she could and saved as little as she could, i.e., $x'=b_{min}$, it means that her previous consumption was low, she would have loved to consume more by taking more debt, but incomplete markets didn't allow it. Then, there are several values of previous-period consumption that make $x'=b_{min}$.

In summary: $$ c = C^*(x',n;g_x') \; \; \; \text{if} \; x'>b_{min} \\ c \leq C^*(x',n;g_x') \; \; \; \text{if} \; x'=b_{min} $$

Finally, using $C^*(x',n;g_x')$ and the budget constrain, we can implicitly define the previous policy function.

\begin{equation*} x(1+R_f) + k[r(z)-R_f] + W n -x' = C^*(x',n;g_x') \; \; \; \text{if} \; x'>b_{min} \\ x(1+R_f) + k[r(z)-R_f] + W n -x' \leq C^*(x',n;g_x') \; \; \; \text{if} \; x'=b_{min} \end{equation*}$$ x(1+R_f) + k[r(z)-R_f] + W n - g_x(k,x,n,z;g_x') = C^*\big(g_x(k,x,n,z;g_x'),n;g_x'\big) \; \; \; \text{if} \; g_x(k,x,n,z;g_x')>b_{min} \\ x(1+R_f) + k[r(z)-R_f] + W n - g_x(k,x,n,z;g_x') \leq C^*\big(g_x(k,x,n,z;g_x'),n;g_x'\big) \; \; \; \text{if} \; g_x(k,x,n,z;g_x')=b_{min} $$

Let define: \begin{equation*} v_1(x',n';g_x') \equiv C^*(x',n;g_x') + x' - W n \end{equation*}

\begin{equation*} v_2(x,k,z) \equiv x(1+R_f) + k[r(z)-R_f] \end{equation*}

Then $g_x$ is in $v_1\big(x',n;g_x'\big)=v_2(x,k,z)$. Let $y=v_1(x',n;g_x')$ then define $x'=v_3(y,n)$, therefore $x'=v_3(v_2(x,k,z),n)$

Incorporating the corner solution cases (consume as much as one can and save as little as possible) we get $g_x(k,x,n,z;g_x')=\text{max}\{b_{min}\,;\, v_3(v_2(x,k,z;g_x'),n)\}$.

We need to come up with an initial guess for the value function. One natural guess is to use the values for the value function that are implied by a household behavior where he/she simply consumes their current income forever.

Distributions

Following Young 2010 we can get the stationary distribution associated with the policy function. Since EGM was done with $x$ instead of $b$, it is easier to continue this way, and change to $b$ once the stationary distribution is retrieved.

First, notice that the stationary conditional joint distribution for $(x,k)$ could be simplify if we take into account the relationship between $x_t$ and $k_t$ given the employment state $n_t$. Thus, it is simpler to get the stationary distribution of $x$ conditional on the employment state $f(x|n)$. Let discretized it as 2 histograms grouped in a single vector $d$ of dimension $2N_X\times1$, where $N_X$ is the number of grid points in the total asset grid $X$ and 2 are the number of employment states.

\begin{equation*}d=\begin{bmatrix} \; F(x_1|e) \\ \Delta F(x_2|e) \\ \Delta F(x_3|e) \\ \vdots \\ \Delta F(x_{N-2}|e) \\ \Delta F(x_{N-1}|e) \\ 1-F(x_{N-1}|e) \\ \; F(x_1|u) \\ \Delta F(x_2|u) \\ \Delta F(x_3|u) \\ \vdots \\ \Delta F(x_{N-2}|u) \\ \Delta F(x_{N-1}|u) \\ 1-F(x_{N-1}|u) \end{bmatrix}\end{equation*}

Where $F(x_m|n)=\int_0^{x_m} f(x_m|n)\, dx$ and $\Delta F(x_m|n) = F(x_m|n)-F(x_{m-1}|n)$.

There is no need to condition on $r$, because it $r'$ is not correlated with its past ($r$), thus $f(x|n,r)=f(x|n)$.

Given the discretized conditional distribution $d$ and the policy function $\hat{g}_x$ we can construct a transition matrix $T$ such that $d'=Td$. Where $T_{i,j}$ indicates how much of the mass located at $j$, that is $d_j$, should be transferred to position $i$ in the next distribution $d'$.

First, we apply the policy function $\hat{g}_x$ for every $r'$ and for every $n'$ to position $j$, where $j\in\{1,2,...2N_X\}$ represents a pair $(x,n)$. We get four values for $x'$. That is for every pair $(x,n)$ there are 4 ideal next position for transition:

\begin{equation*}\hat{g}_x(x,n)=\begin{pmatrix} \hat{g}_x(x,n,e,r_h) & \text{with probability: } \, Pr(n'=e|n) Pr(r'=r_h) \\ \hat{g}_x(x,n,e,r_l) & \text{with probability: } \, Pr(n'=e|n) Pr(r'=r_l) \\ \hat{g}_x(x,n,e,r_h) & \text{with probability: } \, Pr(n'=u|n) Pr(r'=r_h) \\ \hat{g}_x(x,n,u,r_l) & \text{with probability: } \, Pr(n'=u|n) Pr(r'=r_l) \end{pmatrix}\end{equation*}

Values for $\hat{g}_x(x,n,n',r')$ may not be on the grid. For example, if the grid for $x$ is $[-2,\;-1,\;0,\;1,\;2,\;3,\;4,\;...]$ and the policy function $\hat{g}_x$ of a household returns a value of $2.25$... Where should we allocate the mass of this household? Let say that this household has mass $m$, therefore the intuitive approach is to allocate $0.75m$ to the grid point $2$ and $0.25m$ to the grid point $3$. This is the core of Young's method (2010).

That means that (almost) every $x'=\hat{g}_x(x,n,n',r')$ is allocated in two points. Suppose $x'$ is between grid points $i$ and $i+1$, that is $x_i<x'<x_{i+1}$. Then part of the mass that we would like assigned to $x'$ must be relocated to $x_i$, and the other part to $x_{i+1}$. Specifically, a proportion $\omega$ will be assigned to $x_i$ and $(1-\omega)$ to $x_{i+1}$. Where $\omega = (x_{i+1}-x')/(x_{i+1}-x_i)$.

But not only we have to look at the destination for $x'$, we also have to take into consideration the future employment state $n'$. For a given $T_{i,\, j}$, the index $j$ indicates the original $(x,n)$ and $i$ the destination $(x',n')$. If $j \leq X_p$ then $n=e$, otherwise $n=u$, the same goes for $i$, if $i \leq X_p$ then $n'=e$, otherwise $n'=u$.

Following the above explanation, we construct $T$. I used a very similar implementation of Julien Pascal's code.

Since $T$ is a discrete transition matrix of a Markov chain, we can compute the stationary distribution $d^*$, given by the Eigen-vector of $T$ associated with the unit Eigen-value normalized to sum to one.

To calculate next-period's the aggregate consumption $C'$, we will leverage on $c'=g_c(x',n,n',r';g_x')$ and $f(x',n)$.

$$ C'=\int_{b_{min}}^\infty \sum_{n} \sum_{n'} \sum_{r'} \; g_c(x',n,n',r';g_x') \; f(x',n) \; Pr(r') \; Pr(n'|n) \; \text{d}x' $$

Once we have the stationary distribution we should check if the guessed valued for $K_0$ corresponds with the resulting value for $K_0'$ acording to the distribution.

Before calculating the stationary value of $K$, we will calculate aggregate consumption.

Finding Aggregate Capital

We do it with the Brent Method implemented by Omptim Package

El capital según la regla de oro

En el modelo de Solow Swan, la regla de oro es la que maximiza el consumo. Pra crear este benchmark en el contexto del modelo, puedo enfocarme en maximizar el ingreso menos la inversión, ignorando el rol de los bonos.

\begin{equation*} \max_K \Big\{ Y - \delta K \Big\} \end{equation*}

Lo cual puede ser resuelto analíticamente como

\begin{equation*} K_{oro} = \Big\{ \frac{\delta[\lambda + (1-\lambda)(1+\pi^*)^\sigma]}{\eta N \hat{p}^\sigma} \Big\} ^{\frac{1}{\eta-1}} \end{equation*}

K de hogares neutrales al riesgo

Es el nivel de capital $K_R$ tal que $E(r)=R_f$

El ratio Beneficios/Salarios

Corriendo el Modelo

Loading Results

Buscando el ratio K/Y

Resultados del modelo (Iteración)

Plots