Trickling_up
Documentation for Trickling_up. This documentation describes the purpose and mathematical foundations for each of the functions used to simulate the models (defined in /src/model_simulators.jl, /src/solver.jl and /src/simpson.jl).
Trickling_up.durationTrickling_up.simpsonTrickling_up.simpson_weightsTrickling_up.simulate_baselineTrickling_up.simulate_monetaryTrickling_up.simulate_reTrickling_up.solver
Trickling_up.duration — MethodCalculates the duration of total consumption using the "simpson" integration function.
Trickling_up.simpson — MethodImplements Simpson's rule in order to integrate over the paths, using the auxiliary weights function simpson_weights.
Trickling_up.simpson_weights — MethodAuxiliary function to implement Simpson's rule, in order to integrate over the paths of consumption, to obtain the duration of total consumption $\int tC_t / \int C_t$.
Trickling_up.simulate_baseline — MethodSimulates the baseline model. The model in the paper is designed to study the distribution of wealth between quantile groups over time. The function returns the paths of assets for each group and the path of aggregate consumption, across the simulation.
Arguments: a0 is a vector of the groups' excess savings' initial shares in GDP. m is a vector of each group's respective marginal propensity to consume. theta is a vector with the proportion of national income earned by each group. ts is the time-series for which the model is to be simulated. ge is a boolean which switches general equilibrium effects on or off, enabling analysis of partial and general equilibrium separately.
Trickling_up.simulate_monetary — MethodThis function extends the model to include a monetary policy response. a0, m, theta, and ts are as in simulatebaseline. phi is the coefficient on output in the monetary authorities policy function: the paper assumes that real rates are set according to $r_t=\phi Y_t$. sigma is households elasticity of intertemporal substitution.
Trickling_up.simulate_re — MethodThis function extends the baseline model to include rational expectations of future income. a0, m, theta, and ts are as before. The function returns the path of assets and consumption.
Trickling_up.solver — Method(Very) lightweight solver for linear rational expectations models in continuous time
Suppose our model is given by the linear ODE
\[ \begin{pmatrix}\dot{x}\\\dot{y}\end{pmatrix} = \begin{pmatrix}A_{xx} & A_{xy} \\ A_{yx} & A_{yy}\end{pmatrix} \begin{pmatrix}x\\y\end{pmatrix}\]
where $x$ is a predetermined `state' vector of length $N$, $y$ is vector of 'jump' variables, and the four blocks $A$ form a matrix $\mathbf{A}$. For there to be a unique solution for $y$ given the state $x$, there must be $N$ stable eigenvalues (i.e. with negative real part) of $\mathbf{A}$.
Let $\mathbf{A} = QUQ'$ be the Schur decomposition of $\mathbf{A}$, where Q is unitary and U is upper triangular. Assuming that this is decomposition is made such that the stable eigenvalues of U are at the top left, we can write:
\[ U=\begin{pmatrix}U_{ss}&U_{su}\\0&U_{uu}\end{pmatrix} \hspace{1cm} Q=\begin{pmatrix}Q_{xs} & Q_{xu} \\ Q_{ys} & Q_{yu}\end{pmatrix}\]
where the $N$-by-$N$ upper left block $U_ss$ maps the stable subspace to itself, the $N$-by-$N$ $Q_{xs}$ maps the stable subspace to $x$, etc.
Given any state $x$, we can obtain the rotated stable state by solving $s = Q_{xs}^{-1}*x$. Then $\dot{s} = U_{ss}*s$, and $\dot{x} = Q_{xs}*\dot{s} = Q_{xs}*U_{ss}*Q_{xs}^{-1}$. The jump variables $y$ can be obtained from $s$ by $y = Q_{yx}*s = Q_{yx}*Q_{xs}^{-1}*x$.
Summing up, our model will have law of motion
\[\dot{x} = B*x \hspace{1cm} y = F*x\]
where $B = Q_{xs}*U_{ss}*Q_{xs}^{-1}$ and $F = Q_{yx}*Q_{xs}^{-1}$.