%!TEX root = ../OGUSAdoc.tex

In this chapter, we define the stationary nonsteady-state equilibrium of the \ogindia model. Chapters \ref{Chap_Demog} through \ref{Chap_MarkClr} derive the equations that characterize the equilibrium of the model. We also need the steady-state solution from Chapter \ref{Chap_SSeqlb} to solve for the nonsteady-state equilibrium transition path. As with the steady-state equilibrium, we must use the stationarized version of the characterizing equations from Chapter \ref{Chap_Stnrz}.


\section{Stationary Nonsteady-State Equilibrium Definition}\label{SecEqlbNSSdef}

  We define a stationary nonsteady-state equilibrium as the following.

  \vspace{5mm}
  \hrule
  \vspace{-1mm}
  \begin{definition}[\textbf{Stationary Nonsteady-state functional equilibrium}]\label{DefNSSEql}
    A non autarkic nonsteady-state functional equilibrium in the \ogindia model is defined as stationary allocation functions of the state $\bigl\{n_{j,s,t} = \phi_s\bigl(\bm{\hat{\Gamma}}_t\bigr)\bigr\}_{s=E+1}^{E+S}$ and $\bigl\{\hat{b}_{j,s+1,t+1}=\psi_{s}\bigl(\bm{\hat{\Gamma}}_t\bigr)\bigr\}_{s=E+1}^{E+S}$ for all $j$ and $t$ and stationary price functions $\hat{w}(\bm{\hat{\Gamma}}_t)$ and $r(\bm{\hat{\Gamma}}_t)$ for all $t$ such that:
    \begin{enumerate}
      \item households have symmetric beliefs $\Omega(\cdot)$ about the evolution of the distribution of savings as characterized in \eqref{EqBeliefs}, and those beliefs about the future distribution of savings equal the realized outcome (rational expectations),
      \begin{equation*}
        \bm{\hat{\Gamma}}_{t+u} = \bm{\hat{\Gamma}}^e_{t+u} = \Omega^u\left(\bm{\hat{\Gamma}}_t\right) \quad\forall t,\quad u\geq 1
      \end{equation*}
      \item households optimize according to \eqref{EqStnrzHHeul_n}, \eqref{EqStnrzHHeul_b}, and \eqref{EqStnrzHHeul_b},
      \item firms optimize according to \eqref{EqStnrzFOC_L} and \eqref{EqFirmFOC_K},
      \item Government activity behaves according to \eqref{EqStnrzGovBC} and \eqref{EqStnrzClosureRule}, and
      \item markets clear according to \eqref{EqStnrzMarkClrLab}, \eqref{EqStnrzMarkClrCap}, and \eqref{EqStnrzMarkClrBQ}.
    \end{enumerate}
  \end{definition}
  \vspace{-2mm}
  \hrule
  \vspace{5mm}


\section{Stationary Nonsteady-state Solution Method}\label{SecEqlbNSSsoln}

  \renewcommand\theenumi{\arabic{enumi}}
  \renewcommand\theenumii{\alph{enumii}}
  \renewcommand\theenumiii{\roman{enumiii}}

  This section describes the solution method for the stationary nonsteady-state equilibrium described in Definition \ref{DefNSSEql}. We use the time path iteration (TPI) method. This method was originally outlined in a series of papers between 1981 and 1985\footnote{See \citet{AuerbachEtAl:1981,AuerbachEtAl:1983}, \citet{AuerbachKotlikoff:1983a,AuerbachKotlikoff:1983b,AuerbachKotlikoff:1983c}, and \citet{AuerbachKotlikoff:1985}.} and in the seminal book \citet[ch. 4]{AuerbachKotlikoff:1987} for the perfect foresight case and in \citet[Appendix II]{NishiyamaSmetters:2007} and \citet[Sec. 3.1]{EvansPhillips:2014} for the stochastic case. The intuition for the TPI solution method is that the economy is infinitely lived, even though the agents that make up the economy are not. Rather than recursively solving for equilibrium policy functions by iterating on individual value functions, one must recursively solve for the policy functions by iterating on the entire transition path of the endogenous objects in the economy (see \citet[ch. 17]{StokeyLucas1989}).

  The key assumption is that the economy will reach the steady-state equilibrium $\bm{\bar{\Gamma}}$ described in Definition \ref{DefSSEql} in a finite number of periods $T<\infty$ regardless of the initial state $\bm{\hat{\Gamma}}_1$. The first step in solving for the nonsteady-state equilibrium transition path is to solve for the steady-state using the method described in Section \ref{SecEqlbSSsoln}. After solving for the steady-state, one must then find a fixed point over the entire path of endogenous objects.  We do this by first making an initial guess at these objects in a the general equilibrium ``outer loop'' step, analogous to the outer loop described in the steady-state solution method. The time path iteration method then uses functional iteration to converge on a fixed point for the path of these objects.  The paths of aggregate variables that must be guessed in this outer loop are $\{\bm{r}^i,\bm{\hat{w}}^i,\bm{\hat{BQ}}^i, \bm{\hat{TR}}^i\}$, where $\bm{r}^i = \left\{r_1^i,r_2^i,...r_T^i\right\}$, $\bm{\hat{BQ}}^i = \left\{\hat{BQ}_1^i,\hat{BQ}_2^i,...\hat{BQ}_T^i\right\}$, and $\bm{\hat{TR}}^i = \left\{\hat{TR}_1^i,\hat{TR}_2^i,...\hat{TR}_T^i\right\}$. The only requirement on these transition paths is that the initial total bequests $\hat{BQ}_1^i$ conform to the initial state of the economy $\bm{\hat{\Gamma}}_1$, and that the economy has reached the steady-state by period $t=T$ $\{r_T^i, \hat{BQ}_T^i, \hat{TR}_T^i\} = \{\bar{r}, \bar{w}, \overline{BQ}, \overline{TR}\}$.

  The ``inner loop'' of the nonsteady-state transition path solution method is to solve for the full set of lifetime savings decisions $\bar{b}_{j,s+1,t+1}$ and labor supply decisions $\bar{n}_{j,s,t}$ for every household alive between periods $t=1$ and $t=T$.  To solve for the $2JS$ equations and unknowns for each household's lifetime decisions we use a multivariate root finder.

  We outline the stationary non-steady state solution algorithm in the following steps.

  \begin{enumerate}
    \item Compute the steady-state solution $\{\bar{n}_{j,s},\bar{b}_{j,s}\}_{s=E+1}^{E+S}$ corresponding to Definition \ref{DefSSEql}.

    \item Given initial state of the economy $\bm{\hat{\Gamma}}_1$ and steady-state solutions $\{\bar{n}_{j,s},\bar{b}_{j,s+1}\}_{s=E+1}^{E+S}$, guess transition paths of outer loop macroeconomic variables $\{\bm{r}^i,\bm{\hat{BQ}}^i, \bm{\hat{TR}}^i\}$ such that $\hat{BQ}_1^i$ is consistent with $\bm{\hat{\Gamma}}_1$ and $\{r_t^i, \hat{BQ}_t^i, \hat{TR}_t^i\} = \{\bar{r}, \overline{BQ}, \overline{TR}\}$ for all $t\geq T$.

    \item Given initial condition $\bm{\hat{\Gamma}}_1$, guesses for the aggregate time paths $\{\bm{r}^i,\bm{\hat{BQ}}^i, \bm{\hat{TR}}^i\}$, we solve for the inner loop lifetime decisions of every household that will be alive across the time path $\{n_{j,s,t},\hat{b}_{j,s+1,t+1}\}_{s=E+1}^{E+S}$ for all $j$ and $1\leq t\leq T$.
    \begin{enumerate}
      \item Given time path guesses $\{\bm{r}^i,\bm{\hat{BQ}}^i, \bm{\hat{TR}}^i\}$, we can compute the path of wages, $\bm{w}^i$ and then solve for each household's lifetime decisions $\{n_{j,s,t},\hat{b}_{j,s+1,t+1}\}_{s=E+1}^{E+S}$ for all $j$, $E+1\leq s \leq E+S$, and $1\leq t\leq T_2+S-1$.
      \begin{enumerate}
        \item The household problem can be solved with a multivariate root finder solving the $2S$ equations and unknowns at once for all $j$ and $1\leq t\leq T+S-1$. The root finder uses $2S$ household Euler equations \eqref{EqStnrzHHeul_n}, \eqref{EqStnrzHHeul_b}, and \eqref{EqStnrzHHeul_bS} to solve for each household's $2S$ lifetime decisions.
        \item After solving the first iteration of time path iteration, subsequent initial values for the $J$, $2S$ root finding problems are based on the solution in the prior iteration. This speeds up computation further and makes the initial guess for the highly nonlinear system of equations start closer to the solution value.
      \end{enumerate}
    \end{enumerate}
    \item Given partial equilibrium household nonsteady-state solutions $\{n_{j,s,t},\hat{b}_{j,s+1,t+1}\}_{s=E+1}^{E+S}$ for all $j$ and $1\leq t\leq T$ based on macroeconomic variable time path guesses $\{\bm{r}^i,\bm{\hat{BQ}}^i, \bm{\hat{TR}}^i\}$, compute new values for these aggregates implied by the households' solutions, $\{\bm{r}^{i'},\bm{\hat{BQ}}^{i'}, \bm{\hat{TR}}^{i'}\}$.
    \begin{enumerate}
          \item We solve for the updated interest rate as follows:
    		\begin{enumerate}
    			\item Use the guess at the path of total transfers, $\hat{TR}_{t}^{i}$ and the transfer spending rule given in Equation \eqref{EqUnbalGBCtfer} to find the implied path of GDP: $\hat{Y}_{t}^{i} = \frac{\hat{TR}_{t}^{i}}{\alpha_{tr}}$.
    			\item Using the path of GDP and the household savings and labor supply decisions, $\{n_{j,s,t},\hat{b}_{j,s+1,t+1}\}_{s=E+1}^{E+S}$, compute the path of stationarizaed total tax revenue, $\hat{Revenue}_{t}^{i}$.
    			\item Using the long-run debt-to-GDP ratio, the path of GDP, the path of total tax revenue, and Equation \eqref{EqUnbalGBCclosure_Gt}, find the path of stationarized government debt, $\hat{D}_{t}^{i}$.
    			\item Use the capital market clearing condition from Equation \eqref{EqStnrzMarkClrCap} and $D_{t}^{i}$ to find aggregate capital in each period,

    			\begin{equation*}
    				\hat{K}_{t}^{i}=\frac{1}{1 + g_{n,t}}\sum_{s=E+2}^{E+S+1}\sum_{j=1}^{J}\Bigl(\omega_{s-1,t-1}\lambda_j \hat{b}_{j,s,t} + i_s\omega_{s,t}\lambda_j \hat{b}_{j,s,t}\Bigr) - D_{t}^{i}
    			\end{equation*}

    		\item Use the labor market clearing condition from Equation \eqref{EqStnrzMarkClrLab} to find the path of aggregate labor supply:

    			\begin{equation*}
    				\hat{L}_{t}^{i}=\sum_{s=E+1}^{E+S}\sum_{j=1}^{J} \omega_{s,t}\lambda_j e_{j,s}n_{j,s,t}
    			\end{equation*}

    		\item Use the firm's production function from Equation \eqref{EqStnrzCESprodfun} to compute an updated value of $\hat{Y}_{t}$ given the values for the factors of production:

    		\begin{equation*}
    			\hat{Y}_{t}^{i'} = Z_{t}\biggl[(\gamma)^\frac{1}{\ve}(\hat{K}_{t}^{i})^\frac{\ve-1}{\ve} + (1-\gamma)^\frac{1}{\ve}(\hat{L}_{t}^{i})^\frac{\ve-1}{\ve}\biggr]^\frac{\ve}{\ve-1}
    		\end{equation*}

    		\item Use the firm's first order condition for its choice of capital to find the updated path of interest rates,

    		\begin{equation*}
    			r_{t}^{i'} = (1 - \tau_{t}^{corp})(Z_{t})^\frac{\ve-1}{\ve}\left[\gamma\frac{\hat{Y}_{t}^{i'}}{\hat{K}_{t}^{i}}\right]^\frac{1}{\ve} - \delta + \tau_{t}^{corp}\delta_{t}^\tau
    		\end{equation*}

    	\end{enumerate}

    	\item The stationarized law of motion for total bequests \eqref{EqStnrzMarkClrBQ} provides the expression in which household savings decisions $\{b_{j,s+1,t+1}\}_{s=E+1}^{E+S}$ imply a value for aggregate bequests, $BQ_{t}^{\,i'}$. When computing aggregate bequests, we use the updated path of interest rates found above.
    		\begin{equation*}
    			\hat{BQ}_{t}^{\,i'} = \left(\frac{1+r_{t}^{i'}}{1 + g_{n,t}}\right)\left(\sum_{s=E+2}^{E+S+1}\sum_{j=1}^J\rho_{s-1}\lambda_j\omega_{s-1,t-1}\hat{b}_{j,s,t}\right)
    		\end{equation*}

    	\item In equation \eqref{EqStnrzTfer}, we defined total household transfers as a fixed percentage of GDP ($\hat{TR}_t=\alpha_{tr}\hat{Y}_t$).  To find the updated value for transfers, we find the amount of transfers implied by the most updated value of GDP, $\hat{TR}_{t}^{i'}=\alpha_{tr}\hat{Y}_{t}^{i'}$.



	\end{enumerate}
	\item The updated values for the outer loop variables are then used to compute the percentage differences between the initial and implied values:
		\begin{enumerate}
			\item $error_r = max\left\{\frac{r_{t}^{i'} - r_{t}^i}{r_{t}^i}\right\}_{t=0}^{T}$
			\item $error_{bq} =  max\left\{\frac{\hat{BQ}_{t}^{\,i'} - \hat{BQ}_{t}^{\,i}}{\hat{BQ}_{t}^{\,i}}\right\}_{t=0}^{T}$
			\item $error_{tr} = \left\{\frac{\hat{TR}_{t}^{\,i'} - \hat{TR}_{t}^{\,i}}{\hat{TR}_{t}^{\,i}}\right\}_{t=0}^{T}$
		\end{enumerate}
	\item If the maximum absolute error among the three outer loop error terms is greater than some small positive tolerance $toler_{tpi,out}$,
		\begin{equation*}
			\max\big|\left(error_r,error_{bq},error_{tr},error_f\right)\bigr| > toler_{tpi,out}
		\end{equation*}
	then update the guesses for the outer loop variables as a convex combination governed by $\xi_{tpi}\in(0,1]$ of the respective initial guesses and the new implied values and repeat steps (3) through (5).
	\begin{equation*}
		\begin{split}
			\left[\bm{r}^{i+1},\bm{\hat{BQ}}^{\,i+1},\bm{\hat{TR}}^{\,i+1}\right] &= \xi_{tpi}\left[\bm{r}^{i'},\bm{\hat{BQ}}^{\,i'},\bm{\hat{TR}}^{\,i'}\right] + \\
			&\qquad(1-\xi_{tpi})\left[\bm{r}^{i},\bm{\hat{BQ}}^{\,i},\bm{\hat{TR}}^{\,i}\right]
		\end{split}
	\end{equation*}
	\item If the maximum absolute error among the five outer loop error terms is less-than-or-equal-to some small positive tolerance $toler_{tpi,out}$ in each period along the transition path,
		\begin{equation*}
			\max\big|\left(error_r,error_{bq},error_{tr},error_f\right)\bigr| \leq toler_{tpi,out}
		\end{equation*}
	then the non-steady-state equilibrium has been found.
		\begin{enumerate}
			\item Make sure that the resource constraint (goods market clearing) \eqref{EqStnrzMarkClrGoods} is satisfied in each period along the time path. It is redundant, but this is a good check as to whether everything worked correctly.
			\item Make sure that the government budget constraint \eqref{EqStnrzGovBC} binds.
			\item Make sure that all the $(T+S)\times2JS$ household Euler equations are solved to a satisfactory tolerance.
		\end{enumerate}
  \end{enumerate}

  \renewcommand\theenumi{\roman{enumi}}


\section{Baseline Nonsteady-state Results}\label{SecNSSeqlbResults}

  asdf
