| kernel.function {KSPM} | R Documentation |
Kernel Functions
Description
These functions transform a n \times p matrix into a n \times n kernel matrix.
Usage
kernel.gaussian(x, rho = ncol(x))
kernel.linear(x)
kernel.polynomial(x, rho = 1, gamma = 0, d = 1)
kernel.sigmoid(x, rho = 1, gamma = 1)
kernel.inverse.quadratic(x, gamma = 1)
kernel.equality(x)
Arguments
x |
a |
gamma, rho, d |
kernel hyperparameters (see details) |
Details
Given two p-dimensional vectors x and y,
the Gaussian kernel is defined as
k(x,y) = exp\left(-\frac{\parallel x-y \parallel^2}{\rho}\right)where\parallel x-y \parallelis the Euclidean distance betweenxandyand\rho > 0is the bandwidth of the kernel,the linear kernel is defined as
k(x,y) = x^Ty,the polynomial kernel is defined as
k(x,y) = (\rho x^Ty + \gamma)^dwith\rho > 0,dis the polynomial order. Of note, a linear kernel is a polynomial kernel with\rho = d = 1and\gamma = 0,the sigmoid kernel is defined as
k(x,y) = tanh(\rho x^Ty + \gamma)which is similar to the sigmoid function in logistic regression,the inverse quadratic function defined as
k(x,y) = \frac{1}{\sqrt{\parallel x-y \parallel^2 + \gamma}}with\gamma > 0,the equality kernel defined as
k(x,y) = \left\lbrace \begin{array}{ll} 1 & if x = y \\ 0 & otherwise \end{array}\right..
Of note, Gaussian, inverse quadratic and equality kernels are measures of similarity resulting to a matrix containing 1 along the diagonal.
Value
A n \times n matrix.
Author(s)
Catherine Schramm, Aurelie Labbe, Celia Greenwood
References
Liu, D., Lin, X., and Ghosh, D. (2007). Semiparametric regression of multidimensional genetic pathway data: least squares kernel machines and linear mixed models. Biometrics, 63(4), 1079:1088.