# cndkernels: CND Kernel Functions In qkerntool: Q-Kernel-Based and Conditionally Negative Definite Kernel-Based Machine Learning Tools

## Description

The kernel generating functions provided in qkerntool.
The Non Linear Kernel k(x,y) = [exp(α ||x||^2)+exp(α||y||^2)-2exp(α x'y)]/2.
The Polynomial kernel k(x,y) = [(α ||x||^2+c)^d+(α ||y||^2+c)^d-2(α x'y+c)^d]/2.
The Gaussian kernel k(x,y) = 1-exp(-||x-y||^2/γ).
The Laplacian Kernel k(x,y) = 1-exp(-||x-y||/γ).
The ANOVA Kernel k(x,y) = n-∑ exp(-σ (x-y)^2)^d.
The Rational Quadratic Kernel k(x,y) = ||x-y||^2/(||x-y||^2+c).
The Multiquadric Kernel k(x,y) = √{(||x-y||^2+c^2)-c}.
The Inverse Multiquadric Kernel k(x,y) = 1/c-1/√{||x-y||^2+c^2}.
The Wave Kernel k(x,y) = 1-\frac{θ}{||x-y||}\sin\frac{||x-y||}{θ}.
The d Kernel k(x,y) = ||x-y||^d.
The Log Kernel k(x,y) = \log(||x-y||^d+1).
The Cauchy Kernel k(x,y) = 1-1/(1+||x-y||^2/γ).
The Chi-Square Kernel k(x,y) = ∑{2(x-y)^2/(x+y)}.
The Generalized T-Student Kernel k(x,y) = 1-1/(1+||x-y||^d).
The normal Kernel k(x,y) = ||x-y||^2.

## Usage

  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 nonlcnd(alpha = 1) polycnd(d = 2, alpha = 1, c = 1) rbfcnd(gamma = 1) laplcnd(gamma = 1) anocnd(d = 2, sigma = 1) raticnd(c = 1) multcnd(c = 1) invcnd(c = 1) wavcnd(theta = 1) powcnd(d = 2) logcnd(d = 2) caucnd(gamma = 1) chicnd( ) studcnd(d = 2) norcnd() 

## Arguments

 alpha for the Non Linear cndkernel function "nonlcnd" and the Polynomial cndkernel function "polycnd". gamma for the Radial Basis cndkernel function "rbfcnd" and the Laplacian cndkernel function "laplcnd" and the Cauchy cndkernel function "caucnd". sigma for the ANOVA cndkernel function "anocnd". theta for the Wave cndkernel function "wavcnd". c for the Rational Quadratic cndkernel function "raticnd", the Polynomial cndkernel function "polycnd", the Multiquadric cndkernel function "multcnd" and the Inverse Multiquadric cndkernel function "invcnd". d for the Polynomial cndkernel function "polycnd", the ANOVA cndkernel function "anocnd", the cndkernel function "powcnd", the Log cndkernel function "logcnd" and the Generalized T-Student cndkernel function "studcnd".

## Details

The kernel generating functions are used to initialize a kernel function which calculates the kernel function value between two feature vectors in a Hilbert Space. These functions can be passed as a qkernel argument on almost all functions in qkerntool.

## Value

Return an S4 object of class cndkernel which extents the function class. The resulting function implements the given kernel calculating the kernel function value between two vectors.

 qpar a list containing the kernel parameters (hyperparameters) used.

The kernel parameters can be accessed by the qpar function.

## Author(s)

Yusen Zhang
yusenzhang@126.com

cndkernmatrix, qkernmatrix
  1 2 3 4 5 6 7 8 9 10 11 cndkfunc <- rbfcnd(gamma = 1) cndkfunc qpar(cndkfunc) ## create two vectors x <- rnorm(10) y <- rnorm(10) ## calculate dot product cndkfunc(x,y)