|
Cond
Compute the condition number of a matrix.
double matrix::Cond(
|
Parameters
norm
[in] Order of the norm from ENUM_MATRIX_NORM
Return Value
The condition number of the matrix. May be infinite.
Note
The condition number of x is defined as the norm of x times the norm of the inverse of x [1]. The norm can be the usual L2-norm (root-of-sum-of-squares) or one of a number of other matrix norms.
The condition umber is the K value equal to the product of the matrix A norms and its inverse. Matrices with a high condition number are called ill-conditioned. Those with a low condition number are called well-conditioned. The inverse matrix is obtained using pseudo-inversion, so as not to be limited by the condition of squareness and non-singularity of the matrix.
An exception is the spectral condition number.
A simple algorithm for calculating the spectral condition number in MQL5:
double MatrixCondSpectral(matrix& a)
|
MQL5 example:
matrix a= {{1, 0, -1}, {0, 1, 0}, { 1, 0, 1}};
|
Python example:
import numpy as np
|