is.PSD: Check for Positive Semi-Definiteness

Description Usage Arguments Value See Also Examples

View source: R/isDefinite.R

Description

This function checks whether a symmetric matrix is Positive Semi-Definite (PSD). That means, it is determined whether all eigenvalues of the matrix are non-negative. Note that this function does not check whether the matrix is actually symmetric.

Usage

1
is.PSD(X, tol = 1e-08)

Arguments

X

a symmetric matrix

tol

torelance value. Eigenvalues between -tol and tol are assumed to be zero.

Symmetric, PSD matrices are, e.g., correlation or kernel matrices. Such matrices are used in models like Kriging or Support Vector regression.

Value

boolean, which is TRUE if X is PSD

See Also

is.CNSD, is.NSD

Examples

1
2
3
4
5
6
7
8
9
# The following permutations will produce
# a non-PSD kernel matrix with Insert distance
# and a PSD distance matrix with Hamming distance
# (for the given theta value of 0.01)
x <- list(c(2,1,4,3),c(2,4,3,1),c(4,2,1,3),c(4,3,2,1),c(1,4,3,2))
K <- exp(-0.01*distanceMatrix(x,distancePermutationInsert))
is.PSD(K)
K <- exp(-0.01*distanceMatrix(x,distancePermutationHamming))
is.PSD(K)

CEGO documentation built on May 14, 2021, 1:08 a.m.