rustyqlib/core/linalg/decomp/mod.rs
1//! Matrix decompositions, one per file — general-purpose kernels for
2//! future use across the library (regression, calibration, PCA, factor
3//! models), independent of any finance semantics.
4//!
5//! - [`cholesky`]: `A = L L^T` for symmetric PSD matrices, plus the SPD
6//! linear solve through the factor — the fast path for normal
7//! equations and covariance sampling;
8//! - [`qr`]: Householder QR (`A = Q R`, thin form), plus numerically
9//! stable linear least squares — the right tool for regression
10//! (e.g. Longstaff-Schwartz bases) without forming `A^T A`;
11//! - [`svd`]: one-sided Jacobi singular value decomposition
12//! (`A = U S V^T`), plus the minimum-norm pseudo-inverse solve for
13//! rank-deficient problems;
14//! - [`eigen`]: cyclic Jacobi eigendecomposition of symmetric matrices —
15//! the engine behind the PSD projection in
16//! [`nearest_correlation`](super::nearest_correlation).
17//!
18//! All matrices are `Vec<Vec<f64>>` row-major, matching the rest of the
19//! crate; the implementations favor clarity and robustness on the
20//! small-to-moderate sizes quant workflows use.
21
22pub mod cholesky;
23pub mod eigen;
24pub mod qr;
25pub mod svd;
26
27pub use cholesky::{cholesky_factor, cholesky_solve};
28pub use eigen::symmetric_eigen;
29pub use qr::{least_squares, qr};
30pub use svd::{pseudo_solve, svd};