# cndkernmatrix: CND Kernel Matrix functions In qkerntool: Q-Kernel-Based and Conditionally Negative Definite Kernel-Based Machine Learning Tools

## Description

`cndkernmatrix` calculates the kernel matrix K_{ij} = k(x_i,x_j) or K_{ij} = k(x_i,y_j).

## Usage

 ```1 2``` ```## S4 method for signature 'cndkernel' cndkernmatrix(cndkernel, x, y = NULL) ```

## Arguments

 `cndkernel` the cndkernel function to be used to calculate the CND kernel matrix. This has to be a function of class `cndkernel`, i.e. which can be generated either one of the build in kernel generating functions (e.g., `rbfcnd` `nonlcnd` etc.) or a user defined function of class `cndkernel` taking two vector arguments and returning a scalar. `x` a data matrix to be used to calculate the kernel matrix. `y` second data matrix to calculate the kernel matrix.

## Details

Common functions used during kernel based computations.
The `cndkernel` parameter can be set to any function, of class cndkernel, which computes the kernel function value in feature space between two vector arguments. qkerntool provides more than 10 CND kernel functions which can be initialized by using the following functions:

• `nonlcnd` Non Linear cndkernel function

• `polycnd` Polynomial cndkernel function

• `rbfcnd` Gaussian cndkernel function

• `laplcnd` Laplacian cndkernel function

• `anocnd` ANOVA cndkernel function

• `raticnd` Rational Quadratic cndkernel function

• `multcnd` Multiquadric cndkernel function

• `invcnd` Inverse Multiquadric cndkernel function

• `wavcnd` Wave cndkernel function

• `powcnd` d cndkernel function

• `logcnd` Log cndkernel function

• `caucnd` Cauchy cndkernel function

• `chicnd` Chi-Square cndkernel function

• `studcnd` Generalized T-Student cndkernel function

(see example.)

## Value

`cndkernmatrix` returns a conditionally negative definite matrix with a zero diagonal element.

## Author(s)

Yusen Zhang
yusenzhang@126.com

`nonlbase`, `rbfbase`, `laplbase`, `ratibase`, `multbase`, `invbase`, `wavbase`, `powbase`, `logbase`, `caubase`, `chibase`, `studbase`
 ``` 1 2 3 4 5 6 7 8 9 10``` ```## use the iris data data(iris) dt <- as.matrix(iris[ ,-5]) ## initialize cndkernel function lapl <- laplcnd(gamma = 1) lapl ## calculate cndkernel matrix cndkernmatrix(lapl, dt) ```