Condition Number
Shippingmatrix_condCondition number κ(A) = σ_max / σ_min — sensitivity of the linear system
Signature
Inputs
aSignal|Arrayrequired— A 2-D matrix.
Outputs
condition_numberScalar— The 2-norm condition number $\kappa(A) = \sigma_{\max}/\sigma_{\min}$.
Description
Condition Number reports , the 2-norm condition number, computed from the SVD via MKL LAPACK. It quantifies how sensitive the solution of is to perturbations in or : a small (near ) means a well-conditioned, trustworthy problem, while a very large warns that the matrix is close to singular and the solve may lose many digits of accuracy.
The input is read as a 2-D matrix; the result is a dimensionless Scalar. A singular matrix drives . This is the go-to diagnostic to run before trusting a matrix_solve, matrix_inverse, or least-squares fit.
Mathematics
Examples
Well- vs ill-conditioned
The identity has (perfectly conditioned). A nearly linearly-dependent matrix like has , warning that solving with it loses roughly 4 decimal digits of accuracy.
Applications
- Vetting a coefficient matrix before matrix_solve / matrix_inverse to predict accuracy loss.
- Diagnosing multicollinearity in a regression design matrix.
- Deciding whether regularization (ridge / pseudo-inverse) is warranted.
- Monitoring conditioning of a time-varying system matrix online.
Neat
It is derived from the same SVD spectrum as rank, pinv, and the spectral norm, so all conditioning diagnostics agree by construction.
The rule of thumb $\log_{10}\kappa$ directly estimates the number of accurate digits lost — an intuitive readout for a single scalar.
Known issues
For an exactly singular matrix $\sigma_{\min}=0$ and $\kappa$ is infinite; expect an $\infty$ (or overflow) reading.
This reports the 2-norm condition number specifically — condition numbers in other norms can differ by constant factors.