Correcting, e.g., a distance matrix with chosen methods so that it becomes a CNSD matrix.
correctionCNSD(mat, method = "flip", tol = 1e-08)
the corrected CNSD matrix
symmetric matrix, which should be at least of size 3x3
string that specifies method for correction: spectrum clip "clip"
, spectrum flip "flip"
, nearest definite matrix "near"
, spectrum square"square"
, spectrum diffusion "diffusion"
.
torelance value. Eigenvalues between -tol
and tol
are assumed to be zero.
Martin Zaefferer and Thomas Bartz-Beielstein. (2016). Efficient Global Optimization with Indefinite Kernels. Parallel Problem Solving from Nature-PPSN XIV. Accepted, in press. Springer.
modelKriging
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)
is.CNSD(D) #matrix should not be CNSD
D <- correctionCNSD(D)
is.CNSD(D) #matrix should now be CNSD
D
# note: to fix the negative distances, use repairConditionsDistanceMatrix.
# Or else, use correctionDistanceMatrix.
Run the code above in your browser using DataLab