Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.NSD

Check for Negative Semi-Definiteness


Description

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

Usage

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

Arguments

X

a symmetric matrix

tol

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

Symmetric, NSD 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 NSD

See Also

Examples

# 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)-
# The respective negative should be (non-) NSD
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.NSD(-K) 
K <- exp(-0.01*distanceMatrix(x,distancePermutationHamming))
is.NSD(-K)

CEGO

Combinatorial Efficient Global Optimization

v2.4.0
GPL (>= 3)
Authors
Martin Zaefferer <mzaefferer@gmail.com>
Initial release
2019-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.