Why does slogdet return both sign and log absolute determinant?
MathematicsLevel: IntermediateMatrix geometry and computation
Why does slogdet return both sign and log absolute determinant?
Hints
- Not every matrix is positive definite.
- Log magnitude loses sign.
Answer
A real determinant may be negative, whose real logarithm is undefined. Separating sign also avoids overflow from multiplying many eigenvalues.
Source and licence: NumPy — numerical linear algebra · BSD-3-Clause · answer: Quantoros editorial