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

## Description

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

## Usage

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

## Arguments

 `qkernel` the kernel function to be used to calculate the qkernel matrix. This has to be a function of class `qkernel`, i.e. which can be generated either one of the build in kernel generating functions (e.g., `rbfbase` etc.) or a user defined function of class `qkernel` 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 `qkernel` parameter can be set to any function, of class qkernel, which computes the kernel function value in feature space between two vector arguments. qkerntool provides more than 10 qkernel functions which can be initialized by using the following functions:

• `nonlbase` Non Linear qkernel function

• `rbfbase` Gaussian qkernel function

• `laplbase` Laplacian qkernel function

• `ratibase` Rational Quadratic qkernel function

• `multbase` Multiquadric qkernel function

• `invbase` Inverse Multiquadric qkernel function

• `wavbase` Wave qkernel function

• `powbase` d qkernel function

• `logbase` Log qkernel function

• `caubase` Cauchy qkernel function

• `chibase` Chi-Square qkernel function

• `studbase` Generalized T-Student qkernel function

(see example.)

## Value

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

## Author(s)

Yusen Zhang
yusenzhang@126.com

`nonlcnd`, `rbfcnd`,`polycnd`,`laplcnd`, `anocnd`, `raticnd`, `multcnd`, `invcnd`, `wavcnd`, `powcnd`, `logcnd`, `caucnd`, `chicnd`, `studcnd`
 ```1 2 3 4 5 6 7 8 9``` ```data(iris) dt <- as.matrix(iris[ ,-5]) ## initialize kernel function rbf <- rbfbase(sigma = 1.4, q=0.8) rbf ## calculate qkernel matrix qkernmatrix(rbf, dt) ```