Applying the Explicit Aggregation Algorithm toHeterogeneous Agent Models in Continuous Time∗
Masakazu Emoto†Takeki Sunakawa‡

September 2020

Abstract

This paper applies the explicit aggregation (XPA) algorithm to the standard heterogeneous agent model with aggregate uncertainty in continuous time. We find that
the XPA algorithm is faster in solving the model than the Krusell–Smith algorithm,
because the XPA algorithm does not rely on simulations to solve the model. The XPA
algorithm is more accurate than the perturbation method when aggregate uncertainty
is large.

Keywords: Continuous Time, Heterogeneous Agent Models, Explicit Aggregation Algorithm.
JEL codes: C63; D52∗

We thank Takashi Kamihigashi and Tamotsu Nakamura for comments and suggestions. The programming codeused in the paper is available at https://github.com/Masakazu-Emoto/XPA-in-Continuous-Time.
†
Graduate School of Economics, Kobe University, 2-1 Rokko-dai, Nada, Kobe, 657-8501; Email:masakazu.emoto@gmail.com‡
Graduate School of Economics, Hitotsubashi University; Email: takeki.sunakawa@gmail.com.

1

1

Introduction

There is more interest in heterogeneous agent macro models than ever before. Recent studies
such as Achdou et al. (2017) and Ahn et al. (2018) apply newly developed numerical methods
to solve heterogeneous agent models in continuous time. In particular, Ahn et al. (2018) study
heterogeneous agent models with aggregate uncertainty in continuous time and are able to solve
the model quickly. However, there are some challenges to their approach. First, their method solves
the model using a linear approximation and thus does not capture nonlinear effects of aggregate
uncertainty. Second, because of the linearization, the accuracy of solving the model is significantly
compromised when aggregate uncertainty is large and/or the model itself is highly nonlinear.
We present an alternative numerical method to address the issues mentioned above. We introduce the explicit aggregation (XPA) algorithm of den Haan and Rendahl (2010) into the standard
heterogeneous agent model with aggregate shocks of Krusell and Smith (1998) in continuous time.
Then we compare the XPA algorithm in terms of accuracy and efficiency with the Krusell–Smith(KS) algorithm using simulations and the Reiter–Ahn (REITER) algorithm using perturbations
around the deterministic steady state.1
We find that, compared with the KS algorithm, the XPA algorithm is faster than and as accurate
as the KS algorithm in solving the standard Krusell–Smith model. Compared with the REITER
algorithm, the XPA algorithm can solve the model nearly as quickly as the REITER algorithm
does, and is more accurate than the REITER algorithm, especially when aggregate uncertainty islarge.
Our study is closely related to at least two areas of research. One is the literature on the XPA
algorithm. den Haan and Rendahl (2010) is the first paper to apply this method to the standard
heterogeneous agent model in Krusell and Smith (1998). Sunakawa (2020) applies their approach
to some other heterogeneous agent models such as Khan and Thomas (2003, 2008) and Krueger
et al. (2016) in discrete time. To the best of our knowledge, the present paper is the first to
apply the XPA algorithm to the standard heterogeneous agent model with aggregate uncertainty
in continuous time.
1

Although we focus on these algorithms, some other useful algorithms are also found in den Haan et al. (2010).

2

The other is the research on methods to solve heterogeneous agent models with aggregate
shocks in continuous time. The pioneering research in this area is Ahn et al. (2018). They adapt
the perturbation method originally developed by Reiter (2009) to heterogeneous agent models withaggregate shocks in continuous time.2 Fernández-Villaverde et al. (2019) propose a neural-network
algorithm to solve heterogeneous agent models with aggregate shocks in continuous time. Ouralgorithm, unlike Fernández-Villaverde et al. (2019) and the standard KS algorithm, solves themodel without using simulations. Furthermore, whereas the REITER algorithm solves the modelusing a linear approximation, our algorithm solves the model nonlinearly so as to capture nonlinear
effects of aggregate uncertainty.3 Furthermore, as we will discuss later, the accuracy of solving
the model is much higher than what is reported in Ahn et al. (2018), especially when aggregate
uncertainty is large. Our results also hold for different degrees of persistence of the aggregate shock.
The paper consists of the following sections. In Section 2, we apply the XPA algorithm, as wellas the KS and REITER algorithms, to the Krusell and Smith (1998) model in continuous time.
In Section 3, we compare the results of the three algorithms, XPA, KS, and REITER, in terms ofaccuracy and efficiency. Finally, Section 4 concludes.

2

Algorithms

We apply the XPA algorithm first developed by den Haan and Rendahl (2010) to the Krusell
and Smith (1998) model in continuous time as studied by Ahn et al. (2018). We choose the
Krusell–Smith model as it is known as one of the most popular heterogeneous agent models withaggregate uncertainty. Applying the XPA algorithm to other models is also straightforward asshown in Sunakawa (2020). In the model, there are a representative firm, and a government, andheterogeneous households whose asset holdings and productivity are different from each other. As
the model is well known, we defer the details of the model to the Appendix A.
2

Reiter (2010a); Ahn et al. (2018) further develop a method to reduce the dimension of the state space byprojecting the distribution onto principal components. Bayer and Luetticke (2020) and Childers (2018) also suggest
novel approaches using linearization.
3
Reiter’s (2010b) backward induction method can also be applied to solve heterogeneous agent models nonlinearly.
The method is applied to the stochastic overlapping generations model with aggregate uncertainty of Khan (2017);
Kim (2018). Okahata (2018) demonstrates that the method can also be merged with the continuous-time methods
in Ahn et al. (2018).

3

The XPA algorithm assumes approximate aggregation (Young, 2005) as the KS algorithm assumes so that the wealth distribution is approximated by the mean. In contrast with the KS
algorithm, the XPA algorithm calculates the forecasting rules without simulations.
Both the XPA and KS algorithms require two types of calculations, the inner loop and the outerloop. The inner loop calculation is common between the XPA and KS algorithms.4 In continuous
time models, the finite difference method is used to solve the Hamilton–Jacobi–Bellman (HJB)
equation as in Achdou et al. (2017). Given the forecasting rule K̇ = Γ(K, Z), we solve the HJB
equationρv(a, z, K, Z) = max u(c) + va (a, z, K, Z)ȧc

+ λz (v(a, z 0 , K, Z) − v(a, z, K, Z)) + vK (a, z, K, Z)K̇+ vz (a, z, K, Z)(−µZ) +σ2vzz (a, z, K, Z)
2(1)

for the policy function of household savings, s(a, z, K, Z).
In the outer loop, the policy function s(a, z, K, Z) obtained in the inner loop is used to obtainthe forecasting rule for the next period’s aggregate capital as follows

K̇ = Γ(K, Z)
XZ=
s(a, z; K, Z)g(a, z)da.

(2)

a

z

The XPA and KS algorithms are different in how they represent Equation (2). In the XPA
algorithm, the forecasting rule is

ΓXPA (K, Z) =X
{s(K(z), z, K, Z) + ξ(z)}φ(z),zwhere K(z) is capital conditioned on labor productivity, z, φ(z) =4Rg(a, z)da is the proportion of

Fernández-Villaverde et al. (2019) describes the KS algorithm in continuous time in detail. In particular, theysolve the standard Krusell–Smith model in continuous time using the KS algorithm.

4

households with z, and ξ(z) is for correcting the biases due to Jensen’s inequality. These objects
can be calculated immediately when we compute the steady state. That is, to obtain the forecasting
rule, we just need to evaluate the policy function at a = K(z). The value of K(z) may not be on
the grid of a, so we use linear interpolation. In Appendix B, we explain the details of the XPA
algorithm following den Haan and Rendahl (2010) and Sunakawa (2020).
In the KS algorithm, we simulate the model to obtain the total factor productivity (TFP)
sequence Zt and the mean of the wealth distribution Kt at each point in time. Then the forecasting
rule is obtained by estimating the following forecasting rule using the simulated sequence of {Kt , Zt }.

ΓKS (K, Z) = β0 + β1 ln K + β2 ln Z,
where (β0 , β1 , β2 ) are coefficients estimated by ordinary least squares.
The REITER algorithm also differs from the XPA and KS algorithms in that the approximate
aggregation does not hold. Instead, the REITER algorithm linearizes the model around the deterministic steady state and uses the system of linearized equations to solve for the dynamics of theeconomy in the event of aggregate shocks. See Ahn et al. (2018) for more details.

3

Numerical results

We compare the numerical results from three algorithms; XPA algorithm, KS algorithm, and
REITER algorithm. First, we illustrate the property of the forecasting rules obtained by XPA and
KS. Then, we demonstrate the simulation results for XPA, KS, and REITER. After that, we discuss
the computation time for each algorithm and the accuracy using the Den haan Error proposed byden Haan (2010).5
Benchmark parameters
We use the parameters in Table 1 in the benchmark case, following those used in Ahn et al. (2018).
Later, we change the volatility and persistence parameters of the TFP to examine its effect on the5

We use the code used in Fernández-Villaverde et al. (2019) for KS and the code used in Ahn et al. (2018) for
REITER. Both of the codes are modified to use the same set of parameters simply for the purpose of comparison.

5accuracy of solving the model between different algorithms.
Table 1: Parameter values
Parameters
γ : Relative Risk Aversion
ρ : Rate of Time Preference
α : Capital Shareδ : Rate of Capital Depreciation
τ : Tax Rate of Labor Incomeb : Rate of Compensationµ : Persistence of TFP
σ : Volatility of TFP
z : Idiosyncratic of Labor Productivity
λ : Probability of Labor Productivity

3.1

Benchmark Value
1.0
0.01
0.36
0.025
0.011
0.15
0.25
0.07
zu = 0, ze = 1
λe = 0.50, λu = 0.03

Forecasting rules

In Figure 1, we show the forecasting rule K̇(K, Z) in KS and XPA. As is clear from the figure, there
is no significant difference in the forecasting rules obtained by each algorithm. Each forecasting ruleis characterized by a decreasing function with respect to capital K and an increasing function withrespect to TFP Z. Furthermore, the slope of the forecasting rule with regard to K is flatter than
the 45-degree line as is the case in the standard neoclassical growth model. Thus, with respect tocapital, if there is more (less) capital in the current period than in the steady state, K̇ is negative(positive) and households will expect the future capital stock to decrease (increase). Furthermore,
if TFP is high (low), K̇ is positive (negative) and households expect their capital stock to increase(decrease).

3.2

Simulation paths

Next, we compare the capital paths obtained from the simulation results in KS, XPA, and REITER.
In the left panel of Figure 2, we show the results of the simulation path derived from the full model(i.e., the forecasting rule and household HJB equation) for 10000 periods in KS, XPA, and REITER.
The blue line in the figure shows the capital path by XPA, the red line shows the capital path by
KS, and the black line indicates the path by REITER. It is clear from the figure that the capital

6

Figure 1: Forecasting rules

paths obtained from each algorithm are very similar, except for REITER when capital is low.
XPA and KS solve the model nonlinearly, whereas REITER solves the model by linear approximation. As the law of motion for aggregate capital is concave, the error between the simulation
results of the nonlinear methods (XPA and KS) and the linear method (REITER) is small whencapital is high. However, when capital is low, the error between the simulation results of the nonlinear and linear methods is large. Thus, in the right panel of Figure 2, we show that the simulation
path of REITER diverges from those of XPA and KS as the value of capital decreases.

3.3

Efficiency

Table 2 summarizes the time that it takes to solve the model with each algorithm. Comparing
the results of XPA and KS, we can see that XPA solves the model much faster than KS because
it does not use simulations. Comparing the computation times of XPA and REITER, we can seethat REITER is slightly faster than XPA. However, the difference between the two is not that large(XPA: 2.4 seconds vs. REITER: 0.5 seconds).66Note that we use MATLAB and no parallelization, so the gap might be smaller when we use a faster language
and/or parallelization.

7

Figure 2: Simulation paths

Table 2: Computation time
Algorithm
XPA (Our method)
Krusell-Smith
REITER (Ahn et al., 2018)

Computation time
2.478 sec
122.101 sec
0.501 sec

Notes: Computations are done on a laptop with Intel Core i7-9750H and 16GB RAM using MATLAB R2019a.

3.4

Accuracy

The accuracy of solving the model is discussed using the Den haan errors proposed by den Haan
(2010). If the Den haan errors are large in one algorithm, the model solution using this method
is not accurate because households are acting based on an erroneous forecasting rule. In thisstudy, we simulate 10000 time periods with each algorithm and use the results from {Kt∗ }t∈[0,T ]and {K̃t }t∈[0,T ] to measure the Den haan errors
AXεM≡ 100 · max | ln K̃t − ln Kt∗ |,DH
t∈[0,T ]P
EANεM≡ 100 ·
DH∗t∈[0,T ] | ln K̃t − ln Kt |T
8.

Table 3 and Figure 3 summarize the Den haan errors for each algorithm. It is clear from thetable that when aggregate uncertainty is small, i.e., when σ is low, there is not much difference inthe Den haan errors for each algorithm. However, when aggregate uncertainty is large, i.e., whenσ is large, the Den haan errors for REITER are considerably larger than those for XPA and KS.
Therefore, it is clear that XPA is able to compute the model more accurately than REITER whenaggregate uncertainty is large. Furthermore, in the benchmark case, the Den Haan errors of XPA
are smaller than those of KS when the volatility of TFP is σ = 5.0%.7
Table 3: Den Haan errors
Agg Shock σ

0.01%

0.1%

0.7%

1.0%

5.0%

AX
εM
DH XP A

0.000%

0.009%

0.071%

0.101%

0.571%EANεM
DH XP A
AX
εM
DH KS
EAN
εM
DH KS
AX
εM
DH REIT ER
EANεMDH REIT ER

0.000%

0.002%

0.016%

0.024%

0.136%

0.000%

0.004%

0.035%

0.058%

0.945%

0.000%

0.003%

0.023%

0.037%

0.690%

0.000%

0.001%

0.044%

0.093%

4.193%

0.000%

0.001%

0.038%

0.078%

3.477%

Notes: For each value of σ, we adjust the values of the grid so that the maximum and minimum
values of the capital stock obtained in the simulation are within the range of the grid of the capitalstock.
7
We also confirm that our results hold when the persistence of TFP, 1 − η, is lowered so that η = 0.5 or η = 0.75.
See Appendix C.

9Figure 3: Comparison of Den Haan errors

4

Conclusion

In this paper, we apply the explicit aggregation (XPA) algorithm proposed by den Haan andRendahl (2010) to the standard heterogeneous agent model with aggregate uncertainty (Krusell
and Smith, 1998) in continuous time.
We find that, compared with the popular REITER algorithm for solving the heterogeneous
agent model with aggregate uncertainty in continuous time, the XPA algorithm is able to solve themodel almost as fast as the REITER algorithm, and more accurately than this algorithm in thecase when aggregate uncertainty is large.
In our future research, we will apply our algorithm to the heterogeneous agent New Keynesianmodel (e.g., Bayer et al., 2019; Gornemann et al., 2016; Kaplan et al., 2018) in continuous timewith a zero lower bound (ZLB) on nominal interest rates as the XPA algorithm can deal withuncertainty stemming from future exogenous shocks and ZLB (Nakata, 2017). Furthermore, Terry

10

(2017) shows that the model can be solved more accurately by using a projection method likeour method, rather than a perturbation method, when there is a dependency between aggregate
uncertainty and idiosyncratic risk. Our algorithm can be applied when this is the case. In theseapplications, our algorithm will be even more interesting and useful than other algorithms.

References
Achdou, Y., J. Han, J.-M. L. Lasry, P.-L. L. Lions, and B. Moll (2017): “Income and
Wealth Distribution in Macroeconomics: A Continuous-Time Approach,” NBER Working Papers
23732, National Bureau of Economic Research, Inc.
Ahn, S., G. Kaplan, B. Moll, , T. Winberry, and C. Wolf (2018): “When Inequality
Matters for Macro and Macro Matters for Inequality,” NBER Macroeconomics Annual, 1–75.
Bayer, C. and R. Luetticke (2020): “Solving heterogeneous agent models in discrete time withmany idiosyncratic states by perturbation methods,” Quantitative Economics, forthcoming.
Bayer, C., R. Luetticke, L. Pham-Dao, and V. Tjaden (2019): “Precautionary Savings,
Illiquid Assets, and the Aggregate Consequences of Shocks to Household Income Risk,” Econometrica, 87, 255–290.
Childers, D. (2018): “Solution of Rational Expectations Models with Function Valued States,”
Working paper.
den Haan, W. J. (2010): “Comparison of Solutions to the Incomplete Markets Model with
Aggregate Uncertainty,” Journal of Economic Dynamics and Control, 34, 4–27.
den Haan, W. J., K. L. Judd, and M. Juillard (2010): “Computational suite of models withheterogeneous agents: Incomplete markets and aggregate uncertainty,” Journal of Economic
Dynamics and Control, 34, 1–3.
den Haan, W. J. and P. Rendahl (2010): “Solving the Incomplete Markets Model with Ag-

11gregate Uncertainty Using Explicit Aggregation,” Journal of Economic Dynamics and Control,
34, 69–78.
Fernández-Villaverde, J., S. Hurtado, and G. Nuño (2019): “Financial Frictions and theWealth Distribution,” NBER Working Papers 26302, National Bureau of Economic Research,
Inc.
Gornemann, N. M., K. Kuester, and M. Nakajima (2016): “Doves for the Rich, Hawks for
the Poor? Distributional Consequences of Monetary Policy,” Board of Governors of the Federal
Reserve System International Finance Discussion Papers 1167.
Kaplan, G., B. Moll, and G. L. Violante (2018): “Monetary Policy According to HANK,”
American Economic Review, 108, 697–743.
Khan, A. (2017): “Large Recessions in an Overlapping Generations with Unemployment,” 2017
Meeting Papers 1559, Society for Economic Dynamics.
Khan, A. and J. K. Thomas (2003): “Nonconvex Factor Adjustments in Equilibrium Business
Cycle Models: Do Nonlinearities Matter?” Journal of Monetary Economics, 50, 331–360.
——— (2008): “Idiosyncratic Shocks and the Role of Nonconvexities in Plant and Aggregate
Investment Dynamics,” Econometrica, 76, 395–436.
Kim, H. (2018): “Inequality, Portfolio Choice, and the Business Cycle,” Working Paper.
Krueger, D., K. Mitman, and F. Perri (2016): “Macroeconomics and Household Heterogeneity,” in Handbook of Macroeconomics, ed. by J. B. Taylor and H. Uhlig, Elsevier, vol. 2,
843–921.
Krusell, P. and A. A. J. Smith (1998): “Income and Wealth Heterogeneity in the Macroeconomy,” Journal of Political Economy, 106, 867–896.
Nakata, T. (2017): “Uncertainty at the Zero Lower Bound,” American Economic Journal:
Macroeconomics, 9, 186–221.

12

Okahata, N. (2018): “An Alternative Solution Method for Continuous-Time Heterogeneous Agent
Models with Aggregate Shocks,” Mimeo.
Reiter, M. (2009): “Solving heterogeneous-agent models by projection and perturbation,” Journalof Economic Dynamics and Control, 33, 649–665.
——— (2010a):“Approximate and Almost-Exact Aggregation in Dynamic Stochastic

Heterogeneous-Agent Models,” Economics Series 258, Institute for Advanced Studies.
——— (2010b): “Solving the incomplete markets model with aggregate uncertainty by backward
induction,” Journal of Economic Dynamics and Control, 34, 28–35.
Sunakawa, T. (2020): “Applying the Explicit Aggregation Algorithm to Heterogeneous Macro
Models,” Computational Economics, 55, 845–874.
Terry, S. J. (2017): “Alternative Methods for Solving Heterogeneous Firm Models,” Journal of
Money, Credit and Banking, 49, 1081–1111.
Young, E. R. (2005): “Approximate Aggregation,” Mimeo, University of Virginia.

13

Appendix (not for publication)A

The Krusell–Smith model in continuous time

A.1

Environments

Households
Households face idiosyncratic uncertainty regarding labor productivity and the borrowing constraint
at ≥ 0. There are two states of labor productivity for each household, ze and zu , which follow the
Poisson process with arrival rates λe and λu . ze shows that the household is employed and zu
indicates that the household is unemployed.
If the household is employed, she/he receives labor income after taxation (1 − τ )wt . Whenthe household is unemployed, she/he receives unemployment insurance bwt financed by the labor
income tax.
Each household chooses their consumption in each period to maximize their expected life-time
utility by taking the wage rate wt and the interest rate rt as given.
"Zv = max E0

e
0

s.t.

∞

1−θ
−ρt ct

1−θ

#
dt ,

dat = (rt at + (1 − τ )zt wt + (1 − zt )bwt − ct )dt, at ≥ 0,zt ∈ {ze , zu }, ze = 1, zu = 0.

The instantaneous utility function is of constant-relative-risk-aversion form, ρ is the rate of time
preference, and θ is the degree of relative risk aversion.

Firm
The representative firm produces the final good Yt using capital Kt and labor Lt . The production
function is Cobb–Douglas form

Yt = eZt Ktα Nt1−α ,14where α is the capital share. Zt is the logarithm of total factor productivity (TFP) following theOrnstein–Uhlenbeck process

dZt = η(Z̄ − Zt )dt + σdWt ,Z̄ = 0,where dWt follows a Wiener process. η is the persistence of TFP and σ is the volatility of the TFP.
This process is similar to an AR(1) process in discrete time.
The wage rate and the interest rate are obtained from the first-order conditions for the profit
maximization problem as follows:

wt = (1 − α)eZt Ktα Nt−α , rt = αeZt Ktα−1 Nt1−α − δ,

where δ is the depreciated rate of capital.

Government
The government imposes a tax on labor income to finance unemployment compensation. The
government’s budget is balanced as below

τ wµe = bwµu .

That is, the government’s tax revenue from labor income is equal to the government’s expenditure
to finance unemployment insurance. µe = φ(ze ) is the share of employment and µu = φ(zu ) is theshare of unemployment in the economy.

A.2

Stationary equilibrium without aggregate uncertainty

We define the steady state without aggregate uncertainty by setting Zt = 0 for all t ≥ 0. In thesteady state without aggregate uncertainty, the following equations are satisfied:15• The Hamilton–Jacobi–Bellman (HJB) equation and the policy function for households
ρv(a, z) = max u(c) + va (a, z)(ra + (1 − τ )zw + (1 − z)bw − c) + λz (v(a, z 0 ) − v(a, z))cs(a, z) = ra + (1 − τ )zw + (1 − z)bw − c(a, z)• The Fokker–Planck equation0=∂(s(a, z)g(a, z))− λz g(a, z) + λz 0 g(a, z 0 )∂a• The wage rate and the interest ratew = (1 − α)K α L−α , r = αK α−1 L1−α − δ• The government’s budget constraintZτ wµe = bwµu , µe =Zg(a, ze )da, µu =g(a, zu )da,• The capital and the labor markets clear

K=XZ

ag(a, z)da, L =

z

B

XZ

zg(a, z)daz

Details of the XPA algorithm

We provide details of the XPA algorithm following den Haan and Rendahl (2010) and Sunakawa(2020). First, we rewrite the wealth distribution g(a, z) using the conditional probability asg(a|z) =R

g(a, z)g(a, z)=φ(z)g(a, z)da⇔ g(a, z) = g(a|z)φ(z)16where φ(z) =Rg(a, z)da is equal to the proportion of households with labor productivity z in theeconomy.8 Then we can rewrite the forecasting rule using the conditional distribution of wealth as
XZs(a, z; K, Z)g(a, z)da


Z
X
≈
s
ag(a|z)da, z; K, Z φ(z)X=s(K(z), z; K, Z)φ(z)K̇(K, Z) =where K(z) =R

ag(a|z)da is capital conditioned on labor productivity z. We compute K(z) by

the following equations:
Kss (z)Kss (z)K(z) = ψ(z)Kss , ψ(z) ≡
=P R
,
Kss
z agss (a, z)daRZ
agss (a, z)daKss (z) =agss (a|z)da =,φ(z)where Kss and gss are capital and wealth distribution at the steady state without aggregate uncertainty. Note that the ratio of the capital conditioned on z to aggregate capital, ψ(z) = Kss (z)/Kss ,can be easily obtained in the steady-state calculation.9
Moreover, following den Haan and Rendahl (2010), we conduct bias correction. In the explicit
aggregation, we assume that the household’s policy function s(a, z; K, Z) is linear at a = K(z)RR
so that s(a, z; K, Z)g(a|z)da ≈ s K(z), z; K, Z holds. Therefore,there may be bias in theforecasting rule from Jensen’s inequality. We compute the steady-state counterparts to correct thebias:

ξ(z) = K̇ss (z) − sss (Kss (z), z),RZ
sss (a, z)gss (a, z)daK̇ss (z) =sss (a, z)gss (a|z)da =.
φ(z)Again, ξ(z) can be computed at negligible cost in the steady state. Finally, we can write the8
We assume the share of employment φ(ze ) (= 1 − φ(zu )) is time-invariant, although it is straightforward to makethe employment measure be time-variant and depend on aggregate uncertainty as in Krusell and Smith (1998).
9
We assume that ψ(z) is constant even with aggregate uncertainty. The details of the steady-state calculations
are found in Appendix A.2.

17

forecasting rule as follows

K̇(K, Z) =X
{s(K(z), z, K, Z) + ξ(z)}φ(z).
zThat is, to obtain the forecasting rule, we just need to evaluate the policy function at a = K(z).
The value of K(z) may not be on the grid of a, so we use linear interpolation.

Summary of XPA Algorithm
In summary, we perform computations to solve the Krusell–Smith model with the XPA algorithm
as follows. As mentioned above, the XPA algorithm is fast because it does not use any simulations.
1. Compute the deterministic steady state without aggregate uncertainty to obtain the conditional capital ratio ψ(z) and the bias correction term for correcting the forecasting ruleξ(z).
2. (Inner loop) Solve the HJB equation for the policy function taking the forecasting rule asgiven.
3. (Outer loop) Compute the forecasting rule without simulations taking the policy function as
given. The bias correction is also done.
4. Repeat steps 2–3 until the forecasting rule converges.

C

Further numerical results

In Figure 4, we show the results of the simulation path in XPA. The red line {K̃t }t∈[0,T ] in the
figure shows the simulation obtained only from the forecasting rule for 10000 periods, while theblue line {Kt∗ }t∈[0,T ] shows the simulation obtained from the full model including the forecasting
rule and the household HJB equation for 10000 periods.10 This is known as the Den haan’s (2010)10
The time interval dt = 0.25 used in the simulation is the same as the time interval of Ahn et al. (2018). We use
linear interpolation for aggregate capital and TFP to calculate the wealth distribution at each point of time.

18

Figure 4: Simulation path in XPA (Den haan’s fundamental plot)

fundamental plot showing the accuracy of the solution. It is clear from the figure that the capital
paths resulting from these simulations are very close.11
We also check the robustness of our results with respect to the persistence of TFP. In Table 4,
we show that the Den haan errors of KS, XPA, and REITER when the persistence of TFP, 1 − η,is lowered so that η = 0.5 or η = 0.75. It is clear that, regardless of the persistence, the Den haanerrors of REITER are larger than those of XPA and KS when aggregate uncertainty is large.12
11

If the red and blue lines are close, households approximately act according tothe correct forecasting rule. If not,households are using the wrong forecasting rule. Therefore, the divergence between the two lines indicates that themodel is not solved correctly based on rational expectations.
12
However, unlike in the benchmark case of η = 0.25, the Den Haan errors of XPA are larger than that of KS whenthe volatility of TFP is σ = 5% and η = 0.5 or η = 0.75.

19

Table 4: Den Haan errors: robustness
a. Case of η = 0.50
Agg Shock σ

0.01%

0.1%

0.7%

1.0%

3.0%

5.0%

AX
εM
DH XP AEANεM
DH XP A
AX
εM
DH KS
EAN
εM
DH KS
AX
εM
DH REIT ER
EANεMDH REIT ER

0.002%

0.019%

0.143%

0.198%

0.607%

1.051%

0.000%

0.005%

0.039%

0.054%

0.163%

0.301%

0.000%

0.002%

0.021%

0.034%

0.220%

0.432%

0.000%

0.001%

0.007%

0.010%

0.049%

0.185%

0.000%

0.001%

0.067%

0.150%

2.387%

5.862%

0.000%

0.001%

0.055%

0.121%

1.953%

4.778%

Agg Shock σ

0.01%

0.1%

0.7%

1.0%

3.0%

5.0%

AX
εM
DH XP A

0.003%

0.038%

0.276%

0.399%

1.110%

1.980%EANεM
DH XP A
AX
εM
DH KS
EAN
εM
DH KS
AX
εM
DH REIT ER
EANεMDH REIT ER

0.001%

0.012%

0.089%

0.129%

0.378%

0.669%

0.000%

0.007%

0.059%

0.096%

0.439%

0.994%

0.000%

0.002%

0.012%

0.018%

0.094%

0.212%

0.000%

0.003%

0.140%

0.376%

4.301%

9.591%

0.000%

0.002%

0.102%

0.264%

3.317%

7.407%

b. Case of η = 0.75

20