Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

This notebook solves the two-asset liquid-illiquid household block of Section 3 at the published calibration of Auclert et al. (2021). It walks through the closed-form illiquid inversion, solves the household to its stationary policies, draws the endogenous mesh the inversion produces, and reruns one row of the paper’s comparison with the nested method (NEGM).

1The Household Problem

A household enters the period with liquid wealth b, an illiquid balance a and productivity e, which follows a three-state Markov chain. Out of market resources m=Rbb+Raa+y(e) it chooses consumption c and new balances b′≥0, a′≥0 subject to

c+b′+a′+Ψ(a′,a)=m,Ψ(a′,a)=χ12(a′−RaaRaa+χ0)2(Raa+χ0).

The illiquid asset pays the higher return, but moving funds into or out of it incurs the convex cost Ψ. Every two-asset exhibit in the paper uses the calibration below. The table computes relative risk aversion as the inverse of the elasticity of intertemporal substitution, which the code stores.

Parameter                     Value
----------------------------  ------
Discount factor (beta)        0.976
Relative risk aversion (rho)  2.0
Liquid return (r_b)           0.0075
Illiquid return (r_a)         0.0125
Cost offset (chi_0)           0.25
Cost scale (chi_1)            6.5
Productivity persistence      0.966
Productivity dispersion       0.92
Largest liquid node           50.0
Largest illiquid node         4000.0

2The Illiquid Stage in Closed Form

The period splits into an illiquid choice (Stage 0), a consumption choice (Stage 1) and the expectation over next period’s productivity. Stage 1 is the standard consumption EGM at each fixed a′. It leaves liquid resources ℓ=m−a′−Ψ(a′,a) as the state of Stage 0, whose first-order condition is

1+Ψ1(a′,a)=va′1(ℓ,a′,e)vℓ1(ℓ,a′,e).

Nested methods search for the a′ that solves this equation at each state. EGMn fixes a′ on a grid and solves for the incoming balance a instead. With the quadratic cost, Ψ1=χ1u for the adjustment rate u=(a′−Raa)/(Raa+χ0), so the wedge τ=va′1/vℓ1−1 inverts in two lines:

u∗=τχ1,a=a′−u∗χ0Ra(1+u∗).

At every node of the (ℓ,a′) grid, the solver applies stage0_node. One call at illustrative inputs shows that the incoming balance it returns satisfies the first-order condition.

incoming balances: a = 2.823157, b = 4.456302
Psi_1(a', a) = 0.296000000000001
wedge tau    = 0.296000000000000

Up to rounding error, the marginal cost Ψ1 equals the wedge τ. The incoming liquid balance b then follows from the two accounting identities, with no root-finding or iteration at any step.

3Solving the Household

solve_compact iterates the EGMn backward step from the initial marginal values of the sequence-space Jacobian toolkit until the marginal values change by less than 10-9, the tolerance of every published solve. It raises an error if the iteration does not converge.

EGM^n converged in 395 iterations
largest budget residual: 9.1e-13
median illiquid adjustment |a' - R_a a|: 0.338

The delivered policies satisfy the within-period budget to rounding error at every node, because the liquid choice is the budget residual.

The Liquid-Resources Grid

Stage 0 receives the Stage 1 policies on a regular grid of liquid resources ℓ, which must cover every ℓ the inversion can request. A household rich in illiquid wealth can withdraw to finance liquidity, so liquid wealth alone does not bound that range. Since the marginal value of illiquid wealth is non-negative, the first-order condition caps the withdrawal and with it ℓ, at

ℓ=Rbb+y+Raa+χ02χ1,

well past the largest liquid node. The solver builds its ℓ-grid to this bound:

largest liquid node:      50.00
closed-form bound:        364.40
largest l-grid node:      364.40
l-grid nodes past b-grid: 10

4The Endogenous Mesh

The inversion maps the exogenous (ℓ,a′) grid into a curvilinear mesh of incoming states (b,a). ENGINE interpolates on that mesh only if it is fold-free (no cell turns inside out) and index-monotone (each coordinate increases along its own grid index). The paper verifies both on every reported mesh. Here the same checks run on the converged 40×60 solution:

Fold-free and index-monotone in all 3 productivity states

Each check raises an error on the first violation it finds.

Below, the paper’s grid-transformation figure is redrawn on its own 20×20 grid, where individual mesh lines stay visible.

<Figure size 1950x825 with 3 Axes>

Where the optimal adjustment is largest, the inversion bends the mesh most. Lines of constant ℓ and constant a′ never cross. Nodes with negative b belong to withdrawal-financed choices outside the state space; the regrid to the regular (b,a) grid never queries them.

The Adjustment Wedge

Every backward step produces the Stage 1 marginal values on the whole (ℓ,a′) grid, and with them the wedge τ: the shadow price, in units of liquid wealth, of moving one unit into the illiquid account. It follows from the inverted mesh through τ=χ1u:

<Figure size 1050x750 with 2 Axes>

Households with ample liquid resources and a small illiquid position deposit at the largest rates (lower right). Where liquid resources are scarce relative to the illiquid choice, the marginal value of liquidity swamps that of the illiquid account. There the wedge approaches its lower bound of -1, which it attains at ℓ=0.

5Policy Functions

Consumption, the liquid choice and the net illiquid deposit a′−Raa on the regular (b,a) grid, at the median productivity state and the four illiquid grid nodes nearest 0, 10, 100 and 1000:

<Figure size 2250x675 with 3 Axes>

Holding a fixed, more liquid wealth raises consumption and the liquid choice. The two larger illiquid balances fund part of their spending by withdrawing from the illiquid account, most heavily when liquid wealth is low. At the lowest b, the largest balance withdraws enough to carry some of it into liquid savings, so its b′ starts above the others.

6Comparison with the Nested Method

NEGM shares every stage with EGMn except Stage 0, where it solves the first-order condition at each regular-grid node by a safeguarded bracketing iteration. accuracy_row writes each row of the archive’s accuracy_negm.csv. Run here on both solutions at the (40,60) timing grid, its output is shown beside the published row.

Column                           This run   Published
-------------------------------  ---------  ---------
iters_egmn                       395        395
iters_negm                       473        473
dist_b_median                    0.004146   0.004146
dist_a_median                    0.002639   0.002639
euler_median_egmn                1.450e-05  1.450e-05
euler_median_negm                3.928e-04  3.928e-04
euler_offgrid_median_log10_egmn  -2.8602    -2.8602
euler_offgrid_median_log10_negm  -2.8053    -2.8053
alpha_hat_max                    2          2

The two solvers converge to policies whose liquid and illiquid balances differ by less than half a percent at the median (dist_b_median, dist_a_median). At the regular grid nodes, EGMn’s Euler residual is more than an order of magnitude below NEGM’s (euler_median_*), because EGMn delivers consumption there as the output of an Euler inversion. Off the grid, where both policies are interpolated, the two medians (in log10⁡) are close.

Solve Times

Timings depend on the machine, so this page reads the published measurements from timing_negm.csv instead of timing the solves during the build. Every cell is the best of three warm solves to tolerance 10-9 on the benchmark machine the archive README describes.

Grid        NEGM 1 thread  EGM^n 1 thread  NEGM 16 threads  EGM^n 16 threads
----------  -------------  --------------  ---------------  ----------------
(40, 60)    9.81           0.78 (12.5x)    0.89             0.24 (3.7x)
(80, 120)   42.22          3.22 (13.1x)    3.27             0.54 (6.1x)
(160, 240)  178.59         13.66 (13.1x)   13.56            1.73 (7.9x)

The ratio in parentheses is NEGM’s time over EGMn’s at the same thread count.