Skip to main content

newton_on_pillar

Function newton_on_pillar 

fn newton_on_pillar(
    j: usize,
    pillar_date: NaiveDate,
    start: f64,
    adjoint_refusal: Option<&'static str>,
    tolerance: Tolerance,
    residual_scale: f64,
    seeded: &mut Vec<Jet1<f64>>,
    residual_at: impl FnMut(f64, &mut Vec<Jet1<f64>>) -> Result<Jet1<f64>, CalibrationError>,
) -> Result<SolvedPillar, CalibrationError>
Expand description

The damped Newton solve itself, over whatever one pillar substitutes into a view.

Split out when the inflation ladder arrived. A second copy of this body — the seeding, the refusal-driven slope, the finiteness-first backtrack, the two convergence tests — is exactly the drift products! warns about in its own domain, and every one of those decisions is documented here once. What differs between a rate ladder and an inflation one is which curve the closure substitutes and which role the view gives it; nothing else.

residual_at returns the residual, not the price: value less what the rung must be worth. Subtracting the target inside the closure leaves the seeded derivative untouched, so the Newton slope is unchanged, and the three readers downstream — the convergence test, the difference quotient and the backtracking guard — each get the quantity they want without their own subtraction.

residual_scale is the rung’s money_scale: the residual criterion is tolerance.residual per unit of it, so a rung whose money is its notional converges to the same relative accuracy as a unit-notional one.