| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
DataFrame.LinearAlgebra.Solve
Description
Householder QR (for ordinary least squares) and Cholesky factorisation (for
ridge normal equations and Gaussian log-densities). Pure, deterministic, no
LAPACK; sound at the d ≤ low-hundreds scales this library targets.
Synopsis
- qrLeastSquares :: Matrix -> Vector Double -> Either [Int] (Vector Double)
- cholesky :: Matrix -> Maybe Matrix
- choleskySolve :: Matrix -> Vector Double -> Maybe (Vector Double)
- logDetFromChol :: Matrix -> Double
- forwardSubst :: Matrix -> Vector Double -> Vector Double
- backSubst :: Matrix -> Vector Double -> Vector Double
Documentation
qrLeastSquares :: Matrix -> Vector Double -> Either [Int] (Vector Double) Source #
Solve min ‖A x − b‖₂ for an n×d matrix A (n ≥ d) via Householder QR.
Left cols reports rank deficiency (near-zero R diagonal) with the offending
column indices; Right x is the least-squares solution.
cholesky :: Matrix -> Maybe Matrix Source #
Cholesky factor L (lower-triangular, A = L Lᵀ) of a symmetric
positive-definite matrix, or Nothing if a non-positive pivot is hit.
choleskySolve :: Matrix -> Vector Double -> Maybe (Vector Double) Source #
Solve the SPD system A x = b via Cholesky; Nothing when A is not
positive-definite.
logDetFromChol :: Matrix -> Double Source #
log det A = 2 Σ log Lᵢᵢ from a Cholesky factor L.