Expand description
Multiple linear regression (ISL ch 3) — ordinary least squares with full inference, solved through the engine’s linear-algebra library (no re-implemented solver) and the statistics distributions (real p-values).
Fit y = β₀ + β₁x₁ + … + β_p x_p by the normal equations (XᵀX)β = Xᵀy, formed
with linear_algebra::gemm/matvec and solved (and inverted, for the coefficient
standard errors) with linear_algebra::cholesky. Inference — t-tests on each
coefficient and the overall F-test — uses statistics::distributions.
Kernel-class: DenseLinear (the GEMM/solve), so it is dispatch-ready against
ComputePolicy; for the small p×p normal-equations solve the CPU path is the
right one — the GPU win is in forming XᵀX for large n, wired with the bridge.
Structs§
- Linear
Model - A fitted OLS model with inferential output. When
fit_interceptis true,coefficients[0]is the intercept andcoefficients[1..]align with the predictor columns; the*_per_coefvectors are aligned the same way.
Functions§
- fit
- Fit OLS of
y(lengthn) on a row-majorn × ppredictor matrixx.fit_interceptprepends a constant column. Fails closed:InvalidDimensionon a shape mismatch,InsufficientDataifn ≤ params,Singularon collinear predictors.