View source: R/indefiniteLearning.R
| correctionKernelMatrix | R Documentation |
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.
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
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.