ridge
std.linalg.ridge · Level L3Ridge regression: the coefficients β minimizing ‖X·β − y‖² + λ‖β‖², from the regularized normal equations. λ > 0 keeps them solvable for any X.
Signature
ridge(X: f64[n, p], y: f64[n], lam: f64[]) → f64[p]
Structure
The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.
- input
- operation
- constant
- call
- output
Verification
- Signature proven by NOVA’s shape solver, for every size.
- Equal to the reference
np.linalg.solve(X.T @ X + lam * np.eye(p), X.T @ y)in exact rational arithmetic, on all 40 test cases. - All 140 float64 results inside the running error bound; the closest uses 10% of it.
- Interpreter and NumPy backend return bit-identical results.
- At float32 too: the 40 test cases rounded to float32, and 36 of them inside the running error bound at u = 2⁻²⁴; the closest uses 11% of it. Uncertified, too ill-conditioned at float32 for a finite bound: 4.
- correctly rounded (the float64 nearest the exact value)
- 32%
- largest error, in units in the last place
- 637
Large ulp counts appear where a result is tiny next to the numbers it is computed from (after cancellation, for example), so one unit in the last place is tiny too; the absolute error is still inside the bound. Results within their own error of zero are not counted.
Identity
sha256:4d7026da2f9de6e9d6ab993d3a4536da95907dd27332e3df94de354eea3e9d87The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.
Control handle
- Symbol
- Ω:std.linalg.ridge · Ω:ridge
- Pins
sha256:e3833311b763d3e55f263ba82991f20dd2b3a3aa3477b6f3faef20cdc650f17bthis graph alone- Evidence
sha256:7c27a24c888b84567d3f4ef2417e66547cb1dfb9b8fb83aa57d70f7a76bcfbcbthe hash of its verification record- Needs
- no capability: a pure function
Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.