WP19 — Numerical validation (Phase 3)
Date: 2026-10-20. Code: src/model.py, src/solver.py, src/diagnostics.py; tests: tests/ (pytest 9.1.1, Python 3.14.4,
NumPy 2.4.4, SciPy 1.17.1). Logs: results/logs/pytest_full.log (24 passed), results/logs/validation.json,
results/processed/val_montecarlo*.csv. Configuration hash of the baseline: 0a165f317815d76c (Params.config_hash()),
seed 20261020 (recorded in every results/raw/*.json).
1. Solvers
| Object | Method | Tolerance | Check |
|---|---|---|---|
| Seller value $V(c)$ | Brent root of the strictly decreasing $\Phi(V)$ (Lemma 2); bracket widened automatically for unbounded supports | xtol 1e-12 |
max residual of (S) 3.9e-13 |
| Tightness $\theta^*$ | sign scan of the free-entry residual on a 60-point log grid in [0.02, 60], Brent on each sign change; multiplicity reported | 1e-12 | residual 1.6e-17; one root in the baseline and in all 60 random parameter draws (exp07_uniqueness_draws.csv) |
| Posted prices | seller FOC root (unique under log-concavity) nested in the value root | 1e-12 | FOC residual < 1e-7; posted threshold > Nash threshold for every type |
| Financing extension | 3-equation root in $(\ln\theta, U_c, \mathrm{logit},\tilde\pi)$ with $U_m$ from ex-ante free entry (hybr, lm fallback) | 1e-12 | residuals < 1e-15; identical solution from three starting points; nests the baseline when $\nu\to\infty$, $\pi\to1$ (relative $\theta$ error 3e-5) |
| Planner optimum | Nelder–Mead then Powell on $(\ln\theta, v^*(c_i))$ | 1e-9 | success flag true; welfare ≥ decentralised |
| Transition | backward semi-implicit HJB, forward implicit KFE, pointwise free entry, damped iteration on the $\theta$ path | 1e-7 on $\max_t | \Delta\theta_t |
The first implementation of the financing extension used a damped fixed-point iteration on $(U_c,U_m,\tilde\pi)$; it did not converge (the buyer map has slope of order $\lambda_b/r\gg1$) and was replaced by the root formulation above. This failure is recorded here rather than hidden.
2. Unit tests (tests/, 24 tests)
- Distributions: closed-form $H(v)$ equals $\int_v(1-G)$ by quadrature (truncated normal, exponential, Pareto, Weibull); probability mass one; means; IFR inequality $gH\le(1-G)^2$ for the truncated normal and its violation for Pareto; sample moments vs CDF; discretisation of $F$ (mass one, ordered, mean).
- Seller block: residual and uniqueness (sign change of $\Phi$ around the root); Proposition 1 monotonicity and the analytic slope $V'(c)$ against finite differences (5%); $|\bar p'|\le|V'|$; participation threshold; Proposition 2 (monotonicity in $\Lambda_s$, analytic $\partial V/\partial\Lambda_s$ vs finite difference to 1e-4, hazard increasing under IFR, reservation gap narrowing); the Pareto counterexample with its exact condition $c>\delta w_0+(r+\delta)U$ (both signs); the exponential elasticity formula of Proposition 6; boundary cases (zero urgency and no withdrawal, frozen market $\Lambda_s\to0$, very liquid market $\Lambda_s=10^7$ with $v^*\to w_H$ and $\bar p\to w_H-k$); nonnegative hazards, acceptance probabilities in [0,1], monotone survival; Lemma 3 (population hazard decreasing).
- Equilibrium: residuals, stock equation, probability sums, participation, monotone free-entry residual around the root; Proposition 3
(homogeneous sellers: strictly decreasing residual on a 40-point grid, $d\theta/d\phi>0$, $d\theta/dA>0$, $A$–$\phi$ observational
equivalence to 1e-8, amplification elasticity > 1); Proposition 4 (prices, hazards, volume, inventory; $\delta=0$ volume invariance and
composition $=f$); Proposition 5 bounds (range $\le(c_H-c_L)/(r+\delta)$; $\beta\to0$ variance bound); Proposition 6 impact
decomposition (sign of the composition term equals the sign of $\mathrm{Cov}_\omega(\bar p,\epsilon),d\ln\Lambda_s$ for the truncated
normal and the exponential; analytic $\epsilon(c)$ within 0.02 of the finite-difference elasticity); posted prices; financing
extension (residuals, sign of the selection term, closed form of $\Delta_b$, uniqueness from different starts, sales composition $=\pi$);
transition (convergence, initial and terminal stocks, sign and size of the impact composition term, slow adjustment of $Q$ and $S$,
exponential case amplifying); Walrasian benchmark $H(p^*)=rk$; welfare positivity; grid and tolerance convergence (9 vs 25 types
within 1%; $\theta$ invariant to
xtol1e-8 vs 1e-12 within 1e-6).
3. Monte Carlo cross-check of the analytic solution (src/diagnostics.py)
Listings are simulated one by one (type draw, Poisson meetings at rate $\Lambda_s$, exponential withdrawal at rate $\delta$, match draw
$w\sim G$, acceptance $w\ge v^*(c)$, Nash price) for $n\in{2{,}000, 20{,}000, 100{,}000}$ listings and three seeds.
At $n=100{,}000$ the maximum absolute relative error between simulated and analytic moments is 0.39% (sold share 0.11%, mean
duration 0.35%, mean price 0.01%, price s.d. 0.39%, meetings per listing 0.24%, mean time on market of sales 0.32%); per-type mean
prices agree within 0.50% (val_montecarlo_types.csv). Identical seeds reproduce identical samples. Errors shrink with $n$ as expected
(e.g. mean duration: 4.5% at $n=2{,}000$, 0.6% at $n=20{,}000$, 0.35% at $n=100{,}000$).
Duration dependence: the analytic mixture hazard declines monotonically from 5.42 to 5.30 per year over the first 0.6 years (Lemma 3); the exposure-based empirical hazard tracks it within 4% but the decline (2.3%) is below the Monte Carlo noise at long durations, so the empirical first-vs-last comparison is inconclusive at $n=100{,}000$; this is reported as such.
4. Convergence (Experiment 12)
- Seller-type grid: 1, 3, 5, 9, 15, 25, 41, 81 types. With 9 types the mean price differs from the 81-type solution by 2.2e-4 %;
$\theta$, time on market and the mean discount converge monotonically (
exp12_convergence_types.csv, Figure 13). - Root tolerance 1e-6…1e-12 and 20…120 grid points: $\theta$ identical to 1e-6.
- Transition time step 0.1, 0.05, 0.02, 0.01 years: impact and one-year objects converge at first order (
exp12_convergence_dt.csv).
5. Boundary and failure regions
- Participation: all baseline types satisfy $V(c)\ge w_0$; the threshold $\bar c=\Lambda_s\beta H(w_0+k)-rw_0$ is far above $c_H$. Experiment 2 reports the carrying cost at which participation fails for each arrival rate.
- Buyer participation in the financing extension: $U_m<0$ for $\phi_m\le0.60$ (Table 4b): mortgage buyers would prefer to exit, which the model does not allow; these rows are flagged and excluded from the text.
- No equilibrium was found in none of the 150 global-sensitivity draws or the 60 uniqueness draws (all converged, single root).
- Heavy-tailed $G$ (Pareto $a=4$, Weibull shape 0.8): equilibria exist but prices exceed the mean valuation and the between-type share of dispersion exceeds 90%, outside the empirically relevant region; used only to illustrate the sign conditions of Propositions 2 and 6.