| Surface and domain | |
|---|---|
| scaled covariates of pool in (loan age and coupon) or (adding log average balance) | |
| marginal-mean logit of pool , | |
| piecewise-linear (triangular) or multilinear (rectangular) mesh surface evaluated at | |
| unpenalized population-level offset for pool 's group, with | |
| Vertices and surpluses | |
| index of a mesh vertex (the code writes ) | |
| the two birth parents of vertex : endpoints of the segment it bisected | |
| height (in logits) of vertex ; vector collects free vertex heights | |
| hierarchical surplus ; vector collects free surpluses | |
| prior depth of a vertex: bisected segment level in rectangles ( for a unit segment) or generation in triangles | |
| prior variance of surpluses at depth ; precision | |
| Nodal-coordinate solve | |
| hierarchical surplus design matrix (columns follow descendants at weight per generation) | |
| nodal design matrix (free-vertex columns stop at free descendants; row width at most 7 in 2-D) | |
| nodal-to-surplus linear map satisfying , built from birth parents and nodal closures | |
| quadratic prior precision matrix; in nodal coordinates | |
| penalized working information in nodal coordinates | |
| row of , mapping free heights back to surplus | |
Context. Mortgage loan termination rates vary sharply with loan age and coupon. Early months show a seasoning ramp, coupons near market rates form a steep refinancing elbow, and older cohorts exhibit burnout. Decision meshes fit that surface on the logit scale, refining cells only where a false-discovery gate finds statistical support. The interactive explorer and its detailed walkthrough run both WebAssembly engines on synthetic coin flips. This note examines the geometry layer underneath: how triangular newest-vertex bisection compares with anisotropic dyadic rectangles, how birth-parent recursion and a nodal change of variables speed up the rectangular solver, and what genuinely changes in three dimensions.
Choosing between conforming triangles and non-conforming rectangles is a statistical decision, not purely a data-structure choice. Newest-vertex bisection keeps every triangle conforming through a completion cascade at split time. That conformity forces diagonal isotropic cuts and lets later splits erode a coarse vertex's nodal support. Anisotropic dyadic rectangles drop conformity at split time and rely on birth-parent recursion to hold continuity across hanging edges. That change eliminates triangular obsolescence, the two-node hierarchy, and retirement passes while matching held-out accuracy in half the time and extending cleanly to 3-D boxes.
Setting. Scale each pool's covariates scaled covariates of pool in (loan age and coupon) or (adding log average balance) to (or in three dimensions). The mesh models pool 's marginal-mean logit of loan-count termination probability asHere is a fixed training baseline or external logit offset, and unpenalized population-level indicator offset for pool 's group, fitted jointly with the surface, with reference group is an unpenalized population-level shift fitted jointly with the surface (). The mesh surface piecewise-linear surface on triangles or multilinear (bilinear/trilinear) surface on rectangles and boxes is stored at its vertices. Every non-root vertex a vertex of the mesh, created by bisecting a segment with endpoints and sits at the midpoint of an edge with endpoints the two birth parents of vertex , always the endpoints of the segment it bisected, and writes its logit height the surface height in logits at vertex as parent average plus surplusthe hierarchical departure ; zero for a welded vertex and penalized by for a free vertex:A welded vertex holds at zero statistical cost. A free vertex carries a Gaussian prior indexed by its depth the prior depth of vertex : the bisected segment's refinement level in rectangles ( for a unit segment), or generation in triangles, shrinking fine departures toward linear parent interpolation.
Triangular newest-vertex bisection and the complications it forces. In the triangular engine, every face is a right isosceles triangle cut only at the midpoint of its hypotenuse (newest-vertex bisection). Asking for a midpoint on a short leg triggers a recursive conformity completionsplitting neighboring faces along their hypotenuses first so every active vertex remains a corner of every incident triangle, leaving no hanging nodes cascade across neighboring faces until the requested edge becomes a hypotenuse. Every vertex born from that cascade starts welded () and waits on the candidate frontier. The mesh stays strictly conforming and triangles stay right isosceles.
That geometric guarantee imposes four burdens on the statistical layer. First, diagonal isotropic cuts cannot refine a steep coupon elbow without also cutting along loan age, adding extra faces; the triangular code also carries a 5.0 aspect-ratio guard that rectangles drop. Second, once free midpoints surround a coarse vertex in the triangular nodal basis, that vertex plays two incompatible roles: the linear interpolation anchor for its children and a shrinking hat on its remaining one-ring star. Splitting it into a two-node hierarchymoving a surrounded vertex's coarse role into a virtual coarse node with its original parent stencil, while re-attaching the geometric vertex below it as a welded fine child at the child's scale (a virtual coarse node keeping the coarse stencil, plus a fine geometric node attached below it as a welded child) improved 2020 single-issuer held-out deviance by (SE ). Third, later splits can empty a free coefficient's training support, forcing a deepest-first retirement pass that checks hierarchical column norms and verifies prediction invariance to logits. Fourth, rows in the hierarchical surplus design reach width 16 on the pooled benchmark.
Anisotropic dyadic rectangles and birth-parent continuity. The rectangular engine places cells on a -per-axis integer dyadic grid and cuts a leaf cell at the midline of one chosen axis (, , or ). Every axis of every leaf cell is offered to the gate as a separate candidate (through midpoints of its perpendicular edges), so axis choice becomes a statistical decision with no aspect-ratio cap. Every new chord endpoint has canonical birth parents on the integer grid: a point on a vertical cell boundary at odd integer grid coordinate can only arise from bisecting .
Dropping conformity introduces a second weld species alongside regular statistical welds. A hanging vertexa vertex sitting in the interior of a coarser neighbor's edge; held at so the fine side matches the coarse edge's linear trace sits inside an unsplit neighbor's edge. Because a bilinear (or trilinear) function restricted to an edge is linear, evaluating vertex heights in birth order via forces the fine side to match the coarse edge's linear trace identically. Continuity holds across every shared edge from birth-parent recursion alone, with no stored master-slave constraint chains and no 2:1 balance requirement. Promoting a hanging vertex triggers an inert release split of its coarse neighbor first, paying geometric splits only for vertices the gate actually admits.
The inert-split lemma eliminates retirement and two-node splits. A dyadic bisection whose newly created vertices all hold reproduces the parent cell's multilinear surface identically. On each bisected edge, the parent's linear trace at the midpoint equals the average of its endpoints, so every child sub-rectangle inherits corner values matching the parent bilinear function. Because a bilinear function on a rectangle is uniquely determined by its four corners, the refined surface agrees with the unsplit surface pointwise.
In the hierarchical surplus basis, a free coefficient's column propagates into its descendants at weight per generation and stays fixed after birth. A release split plus promoting one hanging vertex therefore adds exactly one new design column while leaving every existing coefficient's column untouched. Later refinement cannot strip away an existing coefficient's support, so dormancy, retirement passes, and the two-node hierarchy vanish. A rectangular counterpart of the fine-node split was built and tested on the 2020 year battery. It gave (SE ) single-issuer and pooled with only two admissions on the benchmark, confirming that the two-node problem belonged to the triangular nodal basis.
Fitting in nodal coordinates with a transformed penalty. Fixed hierarchical columns carry one computational cost: a pool can sit under many overlapping hats across levels, pushing surplus design rows to width 28 on the 2020 benchmark. In the nodal basisthe basis indexed by free vertex heights , where each free vertex's column propagates downward through welded descendants and stops at free descendants , each free vertex's influence propagates downward through welded descendants and stops at free descendants. Equivalently, each welded vertex's height expands upward through welded ancestors until hitting free ancestors (its nodal closure). Design row width drops from 28 to at most 7 in two dimensions.
A linear change of variables preserves the exact hierarchical prior while using the sparse nodal design . Order free vertices with roots first and children by ascending depth. Build the nodal-to-surplus matrix the matrix mapping free vertex heights to hierarchical surpluses row by row: each root row has on its diagonal (), and each free child row places at column while subtracting at column for every free ancestor with weight in the nodal closures of and :Here for free children at depth , and (SD 1 logit) for the rectangular roots (four in 2-D, eight in 3-D). With to free vertices, forming the dense penalty costs almost nothing. Gram and candidate-scoring products scale with row width squared and fall from about 1.2 s to 0.1 s on a single-threaded pooled fit, with bit-identical admissions and held-out deviances across all 72 battery fits. For EM depth-variance updates, each surplus and posterior variance convert back via and , where is row of and .
Two genuine obstacles in three dimensions. Extending dyadic bisection to 3-D boxes (loan age, coupon, and log average balance on an starting grid with 27 free roots and depth-1 vertices) keeps two-parent edge midpoints and inert splits intact. Two properties of 2-D do break.
First, a vertex born on a fine box can land strictly inside a coarser neighbor's 2-D face (a face-hanging vertexa vertex inside a coarse leaf's 2-D face in 3-D, where two perpendicular bisection axes cross and its birth parents do not sit on an edge of the coarse box). Inside a 2-D face, two perpendicular birth axes are possible and the vertex's birth parents do not lie on an edge of the coarse box; once a neighbor splits or frees a vertex along the perpendicular axis, the birth-parent average diverges from the coarse face's trace. The closure rule inertly splits any coarse leaf along a non-birth interior axis so every hanging vertex sits on a leaf edge along its own birth axis, reducing 3-D face continuity back to the 1-D edge argument.
Second, that closure split can pass through an existing vertex along a different axis than its original birth axis. Under relaxed rebirthwhen a 3-D closure split passes through an existing vertex along a non-birth axis, the vertex keeps its original birth parents so existing columns stay inert, the vertex keeps its original birth parents so existing coefficients stay inert. That choice means a candidate's post-move column differs from the column read before the move in roughly half of random 3-D moves. The 3-D gate therefore scores each candidate by executing the exact dry-run move on a per-thread mesh copy, reading the realized column, and rolling back via an undo journal (with dependency-tracked column caching in the Python port).
Empirical comparison. On the 2020 Ginnie Mae single-issuer year battery (36 fits across 12 months and 3 seeds), the 2-D rectangular engine matches and slightly edges the triangular engine at held-out deviance (SE , better in 23 of 36 fits). It uses roughly half the cells and fewer free coefficients (February 2020 seed 1: 128 cells and 59 free versus 303 faces and 84 free for triangles) in half the runtime and 60% of peak memory. Adding log average balance in 3-D across 2020 Ginnie and Fannie panels beats the 2-D surface with the same population levels in 69 of 80 cohort folds (median deviance), 42 of 48 random splits (median ), and 13 of 16 next-month tests (median ).
Terms
- Two weld species
- Statistical welds are regular vertices at ; hanging vertices sit on a coarse edge and enforce continuity via until a release split.
- Inert-split lemma
- A dyadic cut with all new vertices at leaves a multilinear surface identical pointwise, so release + promote adds one column without moving any existing column.
- Nodal-coordinate solve
- Fit free heights with sparse nodal design (width in 2-D) and dense penalty where ; ~10x faster Gram/scoring, bit-identical fit.
- 3-D face-hanging closure
- Inertly split any coarse 3-D leaf containing a vertex inside its face so every hanging vertex sits on a leaf edge along its own birth axis.
- 3-D relaxed rebirth
- Closure splits along a non-birth axis preserve existing parents, altering pre-move candidate columns in ~50% of moves; exact dry-run scoring with an undo journal restores parity.
Sources
- Sam Babichenko. rectangular-decision-mesh: anisotropic dyadic rectangular mesh regression (2-D and 3-D). GitHub repository (docs/GEOMETRY_DESIGN.md, docs/RECT_ESTIMATOR.md, docs/RECT_3D.md), 2026.
- Sam Babichenko. triangular-decision-mesh: adaptive right-triangle mesh regression with a false-discovery gate. GitHub repository (docs/MODEL.md, docs/WRITEUP_2026-09-23.md), 2026.
- Peter Binev, Wolfgang Dahmen, and Ronald DeVore. Adaptive Finite Element Methods with Convergence Rates. Numerische Mathematik 97, 219-268, 2004.
Connected notes
- Stein's paradox and the James-Stein estimatorBenign overfitting · Shrinkage toward a common point
Because exceeds by about on average, the best factor is about , and the James-Stein version beats the raw observation at every once .
- Transformers Learn In-Context by Gradient DescentIn-context learning · Shrinkage toward a common point
A trained linear-attention layer keeps the fraction of the signal in eigendirection , a ridge-like shrinkage fixed at training time that does not weaken as the prompt grows; and because the layer applies a fixed matrix where least squares would invert the prompt's sample covariance, its error keeps a term even on noiseless prompts.
- Generalization in diffusion modelsDiffusion models · Shrinkage toward a common point
A bias-free denoiser computes , shrinkage in a basis adapted to the noisy image that keeps the coefficients above the noise and suppresses the rest.
- Regularization and fine-tuningDeep Learning Alchemy · Shrinkage toward a common point
In least squares with features, ridge with its penalty tuned at each makes the test error fall monotonically as grows (Nakkiran et al.), and the lecture takes from it the rule that an explicit regularizer should be tuned until scaling is monotone again.