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.
- correctly rounded (the float64 nearest the exact value)
- 32%
- bit-equal to the NumPy formula in float64
- 100%
- 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:aa16a87f5caad937d645ea2312c232006711984b00376d422e5cf96d0669fca5the 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.