🇬🇧 English · 🇪🇸 Español
Productive capital in two-asset HANK
calibrate_capital_hank builds a two-asset economy in which households own
nominal government bonds and installed productive capital. Investment changes
the capital supply, its price clears the illiquid market, and the return includes
both operating rental income and the value of remaining installed capital.
solve_hank_reduced_policy solves its local stochastic equilibrium with reduced
distribution and household marginal-value coordinates. Full-grid household
backward steps and distribution transport remain available for nonlinear audits
and state-conditioned stochastic continuation corrections.
import numpy as np
from puremacro.models import calibrate_capital_hank, solve_hank_reduced_policy
# Small demonstration grid, not a household-grid convergence certificate.
ss = calibrate_capital_hank(n_a=10, n_b=10, a_max=100., b_max=15.)
policy = solve_hank_reduced_policy(
ss, distribution_rank=12, marginal_rank=48, rho=.7, shock_std=1e-4,
)
audit = policy.audit(np.r_[-1e-5, np.zeros(7)], tolerance=1e-5)
print(ss.diagnostics, policy.diagnostics, audit.diagnostics)
print(audit.paths[["Y", "K", "I", "q", "r_a", "goods_mkt"]])
Linear policy paths contain log control deviations. Nonlinear audit paths
contain level deviations and residuals. In those paths, K is inherited
physical capital and Knext is next period's inherited stock. I is physical
investment; investment_goods adds installation costs. The exact nominal rate
and quoted capital price are carried between audited dates.
Production and investment timing
Write \(K_t\) for capital inherited at date \(t\), \(q_{t-1}\) for its actual purchase price, and \(q_t\) for the price of capital installed for \(t+1\). Production, marginal cost and the capital rental rate satisfy
Physical investment and its resource cost are
[ \Phi(I_t,K_t)=\frac{\psi}{2}\left(\frac{I_t}{K_t}-\delta\right)^2K_t, \qquad \psi=\frac1{\delta\epsilon_I},\qquad q_t=1+\psi\left(\frac{I_t}{K_t}-\delta\right), ] [ I_t=K_t[\delta+(q_t-1)/\psi],\qquad K_{t+1}=(1-\delta)K_t+I_t. ]
The technology is reversible: negative investment is allowed while \(K_{t+1}>0\). Irreversible investment would require an additional complementarity condition and is not imposed here.
The return on installed capital includes the installation rent \(\Pi^I_t=(q_t-1)I_t-\Phi_t=-K_t\Phi_K(I_t,K_t)\):
Leaving out this rent changes the marginal capital valuation equation when investment moves. The tests independently differentiate the installation technology with respect to investment and inherited capital to check both the investment FOC and the realized return.
Household and aggregate closure
The existing convex-cost two-asset household solver chooses consumption, liquid bonds, and illiquid wealth on the full grid. Both asset markets clear:
Government purchases are fixed in levels after calibration. Taxes finance government purchases and liquid interest only:
Operating profits are \(\Pi^P_t=Y_t-w_tN_t-R^K_tK_t-\mathrm{pricecost}_t\). Nonfinancial income \(w_tN_t+\Pi^P_t-T_t\) is distributed proportional to household productivity, whose stationary mean is one. Installation rents are already included in capital returns, so are not rebated again. Flexible common hours satisfy
Rotemberg price adjustment uses \(\mathrm{pricecost}_t=\mu\,[\log(1+\pi_t)]^2Y_t/[2(\mu-1)\kappa]\). The price Phillips curve is
Household budgets and the two markets imply the separately audited resource equation
resource_accounting_res also checks the identity off equilibrium. It
relates the goods residual to current asset-market residuals and inherited
ownership gaps. In particular an actual transported distribution can have
\(\int a_t\,dD_t\ne q_{t-1}K_t\). Audits preserve the actual previous quote;
they never change that return to absorb an illiquid-market error.
The recursive state is the distribution coordinates plus
lag_nominal, monetary_shock, and log_capital. The last coordinate is
\(\log(K_t/\bar K)\). In linear equilibrium the inherited price can be
identified by \(q_{t-1}=\int a_t\,dD_t/K_t\); off-equilibrium nonlinear paths
carry that price explicitly.
Calibration and reference scope
The default physical parameters use the rounded ABRS values \(\alpha=.33,\delta=.02,\mu=1.015,\epsilon_I=4\); inverse IES is 2 and Frisch elasticity is 1. Given the steady liquid and illiquid returns, calibration solves for beta, keeping those production parameters fixed:
Debt supply equals stationary liquid demand. TFP and labor disutility normalize steady hours to one. Changing the household grid can change beta and the normalizations; it does not silently change alpha, depreciation, or installation cost parameters. Failed household solves and a beta interval that does not bracket the capital condition raise. The calibration history retains warnings from intermediate household solves, and final diagnostics retain upper-grid mass, household policy errors, and resource residuals.
Production, investment, price adjustment, and the capital valuation identity are matched to the authors' SSJ two-asset example at pinned commit eb4ac4c. See also their two-asset tutorial and paper. The independent aggregate-block reference test evaluates the authors' equations at off-steady paths, not just their stationary parameter values.
This is not a replication of the full published HANK economy. The reference has sticky wages, an intermediary combining equity and bonds, a liquidity premium, a larger earnings process, and a different distribution of profits and taxes. Its exact calibrated alpha is inferred from targets, whereas this model holds the rounded .33 fixed. Its portfolio cost denominator is \((1+r^a)a+\chi_0\); the existing PureMacro household solver uses \(a+\bar a\). PureMacro retains that solver and reports the difference. A published-model replication would require those household, wage, intermediary, equity, and calibration blocks as well.
Projected equilibrium convergence is distinct from household-grid accuracy and omitted marginal-value equations. Compare ranks, inspect full-equation and Euler/KKT diagnostics, and use held-out nonlinear histories. A solved local stochastic tail does not establish global aggregate-risk accuracy or second-order welfare effects.
Retained equilibrium and adaptive checks
tests/fixtures/hank_capital_equilibrium/ retains a fixed-physical-parameter
grid ladder. The wide 10×10 household solve fails; 15×15, 20×20 and 30×30 solve.
All-grid Euler/KKT maxima fall from about 0.039 to 0.0054 to 0.0023, but
remain separate from equilibrium convergence. Beta, TFP normalization and
liquid debt supply can change across this ladder, so it is a calibration/grid
sensitivity exercise, not convergence for one completely fixed economy.
Rank 16 distribution projections fail determinacy on 15×15 and 20×20; successful
larger and smaller ranks are retained without changing the root criterion.
Independent finite-tree accounts on 15×15 and 20×20 include actual inherited
capital and quoted prices, household budgets, both markets and resource flows.
Adaptive continuation has a separately stated risk domain. A 15×15 history
with innovation standard deviation 1e-5, distribution/marginal ranks 48/128
and 96 Krylov steps passes all three observed dates at the original 1e-8
equation and 1e-6 horizon/branching thresholds. Realized innovations are
[-1e-6, 2e-6, 0], horizons are (4,8,16), and branch depths are (1,2).
The coarse 10×10 case with standard deviation 1e-4 passes its finite equations
and horizon test but fails branching refinement. A deeper 15×15 probe at that
higher risk also misses completed sensitivity comparisons and reaches its
180-second experiment budget. Those failures are retained in
tests/fixtures/hank_capital_adaptive/; the smaller-risk success does not
certify the higher-risk economy or globally solved aggregate uncertainty.