Description Usage Arguments Value References See Also Examples
View source: R/indefiniteLearning.R
Convert a non-PSD kernel matrix with chosen approach so that it becomes a PSD matrix.
Optionally, the resulting matrix is enforced to have values between -1 and 1 and a diagonal of 1s, with the repair
parameter.
That means, it is (optionally) converted to a valid correlation matrix.
Essentially, this is a combination of correctionDefinite
with repairConditionsCorrelationMatrix
.
1 | correctionKernelMatrix(mat, method = "flip", repair = TRUE, tol = 1e-08)
|
mat |
symmetric kernel matrix |
method |
string that specifies method for correction: spectrum clip |
repair |
boolean, whether or not to use condition repair, so that elements between -1 and 1, and the diagonal values are 1. |
tol |
torelance value. Eigenvalues between |
list with corrected kernel matrix mat
, isPSD
(boolean, whether original matrix was PSD), transformation matrix A
,
the matrix of eigenvectors (U
) and the transformation vector (a
)
Martin Zaefferer and Thomas Bartz-Beielstein. (2016). Efficient Global Optimization with Indefinite Kernels. Parallel Problem Solving from Nature-PPSN XIV. Accepted, in press. Springer.
correctionDefinite
, repairConditionsCorrelationMatrix
1 2 3 4 5 6 7 | 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))
D <- distanceMatrix(x,distancePermutationInsert)
K <- exp(-0.01*D)
is.PSD(K) #matrix should not be PSD
K <- correctionKernelMatrix(K)$mat
is.PSD(K) #matrix should now be CNSD
K
|
[1] FALSE
[1] TRUE
[,1] [,2] [,3] [,4] [,5]
[1,] 1.0000000 0.9955780 0.9955780 0.9933607 0.9955780
[2,] 0.9955780 1.0000000 0.9933578 0.9955780 0.9933578
[3,] 0.9955780 0.9933578 1.0000000 0.9955780 0.9933578
[4,] 0.9933607 0.9955780 0.9955780 1.0000000 0.9955780
[5,] 0.9955780 0.9933578 0.9933578 0.9955780 1.0000000
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.