# correctionKernelMatrix: Correction of a Kernel (Correlation) Matrix In CEGO: Combinatorial Efficient Global Optimization

## Description

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`.

## Usage

 `1` ```correctionKernelMatrix(mat, method = "flip", repair = TRUE, tol = 1e-08) ```

## Arguments

 `mat` symmetric kernel matrix `method` string that specifies method for correction: spectrum clip `"clip"`, spectrum flip `"flip"`, nearest definite matrix `"near"`, spectrum square`"square"`, spectrum diffusion `"diffusion"`. `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 `-tol` and `tol` are assumed to be zero.

## Value

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`)

## References

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`

## Examples

 ```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 ```

### Example output

``` FALSE
 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
```

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