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.

How Close Is HARK’s Infinite-Horizon Solution?

HARK finds the infinite-horizon solution of a consumption problem as the limit of finite-horizon solutions. It starts from the last period of life, in which the consumer spends everything, and works backward one period at a time. It stops when the solutions from two successive iterations differ by less than the consumer’s tolerance, 10-6 by default, or after 5000 iterations, whichever comes first (econ-ark/HARK#1847).

The perfect foresight model of Consumption Under Perfect Foresight and CRRA Utility has a closed-form solution at every horizon. So this notebook can measure exactly how far HARK’s infinite-horizon solution is from the true one, and see when, and why, the iteration stops short.

The exact solution at every horizon

The consumer has relative risk aversion ρ, discount factor β, interest factor R and permanent income growth factor G. With T periods left after this one, the marginal propensity to consume out of total wealth is

κT=1−ÞR1−ÞRT+1,ÞR=(Rβ)1/ρR,

where ÞR is the return patience factor. End-of-period human wealth 𝔥, the present value of income from next period on relative to this period’s permanent income, is

𝔥T=∑n=1T(G/R)n,

where G/R is the finite human wealth factor. As T grows, they approach κ=1−ÞR and 𝔥=G/(R−G), provided each factor is below 1: that is the return impatience condition (RIC) and the finite human wealth condition (FHWC).

At any finite horizon, HARK’s solution is exact. Its MPC (MPCmin) and human wealth (hNrm) match the formulas:

T =   1:  MPC 0.508515, exact 0.508515;  end-of-period human wealth 0.9806, exact 0.9806
T =   5:  MPC 0.181175, exact 0.181175;  end-of-period human wealth 4.7162, exact 4.7162
T =  25:  MPC 0.056999, exact 0.056999;  end-of-period human wealth 19.5689, exact 19.5689
T = 100:  MPC 0.034599, exact 0.034599;  end-of-period human wealth 43.3927, exact 43.3927

HARK has the pieces of this calculation itself. A consumer’s check_conditions method computes the patience factors and the infinite-horizon limits, and stores them in its bilt dictionary. There, hNrm is human wealth including this period’s income, h=𝔥+1. And HARK’s solver builds each period’s solution from the next period’s with calc_mpc_min and calc_human_wealth, one step of the recursion that gives κT and 𝔥T. Starting from the last period and taking 100 steps by hand gives the solution with 100 periods left:

return patience factor 0.9665, finite human wealth factor 0.9806
limits: MPC 0.033490, exact 0.033490;  end-of-period human wealth 50.5000, exact 50.5000
100 steps: MPC 0.034599, exact 0.034599;  end-of-period human wealth 43.3927, exact 43.3927

Convergence is geometric

Each further period of backward iteration shrinks the distance of human wealth from its limit by the factor G/R exactly, and the distance of the MPC from its limit by a factor that approaches ÞR. On a log scale the distances fall along straight lines:

<Figure size 640x480 with 1 Axes>

The factors whose being below 1 is the RIC and the FHWC therefore also set how fast backward iteration converges: the closer a factor is to 1, the more iterations the solution needs.

A small change does not mean a small error

HARK stops when two successive solutions differ by less than tolerance. If the distance from the limit shrinks by a factor Þ each iteration, a last change of d leaves a remaining distance of about dÞ/(1−Þ), which is many times d when Þ is close to 1. With ρ>1, the return patience factor ÞR approaches 1 only when β exceeds 1, approaching Rρ−1. Here is the error in HARK’s infinite-horizon MPC as β rises toward that value, for three tolerances:

tolerance 1e-06: MPC overstated by 151.7 percent at beta = 1.044
tolerance 1e-09: MPC overstated by 8.4 percent at beta = 1.044
tolerance 1e-12: MPC overstated by 8.4 percent at beta = 1.044
<Figure size 640x480 with 1 Axes>

HARK measures the change between iterations in both points that define its consumption function: where the function starts, at m=−𝔥, which moves with human wealth, and its slope, the MPC. It stops only when both have settled. At the lower values of β, human wealth is the slower to settle, so it decides when HARK stops, after log⁡(tolerance)/log⁡(G/R) iterations (1057 at a tolerance of 10-9), and by then the MPC is far closer than the tolerance. The kinks are where the MPC becomes the slower and takes over. The floor of the 10-12 curve is the precision of floating-point arithmetic.

The limit of 5000 iterations

Tightening the tolerance helps until HARK’s limit of 5000 iterations binds. From then on its solution is the one with 5000 periods left, whatever the tolerance: at β=1.044, where ÞR5000≈0.08, its MPC is κ5000, about 8 percent above κ, even at a tolerance of 10-12.

Human wealth converges by the factor G/R, which involves neither β nor ρ. When G/R is close to 1, the limit binds for it too:

G = 1.02: HARK's end-of-period human wealth 102, exact 102
G = 1.029: HARK's end-of-period human wealth 1021, exact 1029
G = 1.0295: HARK's end-of-period human wealth 1877, exact 2059

The lesson

HARK’s backward iteration is exact at every finite horizon. Its only error is stopping too soon, which matters when a factor that governs convergence is close to 1. There, tighten tolerance, and wherever the model has closed forms, check the numerical solution against them.