Function semidefiniteness()
passes all its arguments
to isSemidefinite()
.
It is only kept for backward-compatibility
and may be removed in the future.
If argument positive
is set to FALSE
,
isSemidefinite()
checks for negative semidefiniteness
by checking for positive semidefiniteness
of the negative of argument m
, i.e. -m
.
If method "det"
is used
(default for matrices with up to 12 rows/columns),
isSemidefinite()
checks whether all principal minors
(not only the leading principal minors)
of the matrix m
(or of the matrix -m
if argument positive
is FALSE
)
are larger than -tol
.
Due to rounding errors,
which are unavoidable on digital computers,
the calculated determinants of singular (sub-)matrices
(which should theoretically be zero)
can considerably deviate from zero.
In order to reduce the probability of incorrect results
due to rounding errors,
isSemidefinite()
does not calculate the determinants
of (sub-)matrices with reciprocal condition numbers
smaller than argument tol
but sets the corresponding principal minors to (exactly) zero.
The number of principal minors of an \(N \times N\) matrix is
\(\sum_{k=1}^N ( N\) choose \( k )\),
which gets very large for large matrices.
Therefore, it is not recommended to use method "det"
for matrices with, say, more than 12 rows/columns.
If method "eigen"
(default for matrices with 13 or more rows/columns) is used,
isSemidefinite()
checks whether all eigenvalues
of the matrix m
(or of the matrix -m
if argument positive
is FALSE
)
are larger than -tol
.
In case of a singular or nearly singular matrix,
some eigenvalues
that theoretically should be zero
can considerably deviate from zero
due to rounding errors,
which are unavoidable on digital computers.
isSemidefinite()
uses the following procedure
to reduce the probability of incorrectly returning FALSE
due to rounding errors in the calculation of eigenvalues
of singular or nearly singular matrices:
if the reciprocal condition number of an \(N \times N\) matrix
is smaller than argument tol
and not all of the eigenvalues of this matrix are larger than -tol
,
isSemidefinite()
checks
whether all \(( N\) choose \( (N-k) )\)
\((N-k) \times (N-k)\) submatrices
are positive semidefinite,
where \(k\) with \(0 < k < N\) is the number of eigenvalues
in the interval -tol
and tol
.
If necessary, this procedure is done recursively.
Please note that a matrix can be
neither positive semidefinite nor negative semidefinite.