kernel.matrix {KSPM} | R Documentation |
Kernel matrix
Description
These functions transform a matrix into a
kernel matrix.
Usage
kernel.matrix(Z, whichkernel, rho = NULL, gamma = NULL, d = NULL)
Arguments
Z |
a |
whichkernel |
kernel function |
gamma , rho , d |
kernel hyperparameters (see details) |
Details
Given a matrix, this function returns a
matrix where each cell represents the similarity between two samples defined by two
dimensional vectors
and
,
the Gaussian kernel is defined as
where
is the Euclidean distance between
and
and
is the bandwidth of the kernel,
the linear kernel is defined as
,
the polynomial kernel is defined as
with
,
is the polynomial order. Of note, a linear kernel is a polynomial kernel with
and
,
the sigmoid kernel is defined as
which is similar to the sigmoid function in logistic regression,
the inverse quadratic function defined as
with
,
the equality kernel defined as
.
Value
A matrix.
Author(s)
Catherine Schramm, Aurelie Labbe, Celia Greenwood
See Also
kernel.gaussian, kernel.linear, kernel.polynomial, kernel.equality, kernel.sigmoid, kernel.inverse.quadratic.