dataframe-learn-2.4.1.0: Interpretable, expression-returning machine learning for the dataframe ecosystem.
Safe HaskellNone
LanguageHaskell2010

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

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.

forwardSubst :: Matrix -> Vector Double -> Vector Double Source #

Solve L y = b for lower-triangular L.

backSubst :: Matrix -> Vector Double -> Vector Double Source #

Solve Lᵀ x = y for lower-triangular L.