-
Notifications
You must be signed in to change notification settings - Fork 0
cond
cond(matrix, matrix_inv, max_iterations, tolerance)
Compute the condition number of a matrix, which can be useful for sensitivity analysis of given problems.
-
matrix : ArrayLike
Any matrix or matrix-like object. -
matrix_inv : ArrayLike, optional
Any matrix or matrix-like object which exactly is the inverse of thematrix
parameter. There's no input checking here, so if this isn't the inverse ofmatrix
then without warning what's returned will not be the condition number. This is optional, and if not provided thencond
acts as a wrapper to NumPy'slinalg.cond
function. -
max_iterations : int, optional
Maximum number of iterations if usingmatrix_inv
with the power method, otherwise this is ignored. The default is 5 iterations. -
tol: float, optional
Tolerance with which to check convergence if usingmatrix_inv
with the power method, otherwise this is ignored. Default value is$10^{-7}$ .
-
float
The condition number of the matrix, or the closest approximation using power method if the maximum iteration count was reached.
If computing the condition number of a matrix it's ordinarily more efficient to compute its largest eigenvalue using power method and then the smallest eigenvalue using the inverse power method. When working with pedigree data however it's relatively cheap to get the inverse of the matrix so it can work out more efficient to compute the largest eigenvalues of the matrix and its inverse both using power method. This usually possible within a relatively small number of iterations too.
This documentation relates to the latest version of the package on GitHub. For past versions, download the zip bundled with the release from here. If anything in this wiki looks incorrect or you think key information is missing, please do open an issue.