# Positive-definite kernel

(Redirected from Kernel function)

In operator theory, a branch of mathematics, a positive definite kernel is a generalization of a positive definite function or a positive-definite matrix. It was first introduced by James Mercer in the early 20th century, in the context of solving integral operator equations. Since then positive definite functions and their various analogues and generalizations have arisen in diverse parts of mathematics. They occur naturally in Fourier analysis, probability theory, operator theory, complex function-theory, moment problems, integral equations, boundary-value problems for partial differential equations, machine learning, embedding problem, information theory, and other areas.

This article will discuss some of the historical and current developments of the theory of positive definite kernels, starting with the general idea and properties before considering practical applications.

## Definition

Let ${\displaystyle {\mathcal {X}}}$ be a nonempty set, sometimes referred to as the index set. A symmetric function ${\displaystyle K:{\mathcal {X}}\times {\mathcal {X}}\to \mathbb {R} }$ is called a positive definite (p.d.) kernel on ${\displaystyle {\mathcal {X}}}$ if

${\displaystyle \sum _{i=1}^{n}\sum _{j=1}^{n}c_{i}c_{j}K(x_{i},x_{j})\geq 0\quad \quad \quad \quad (1.1)}$

holds for any ${\displaystyle n\in \mathbb {N} ,x_{1},\dots ,x_{n}\in {\mathcal {X}},c_{1},\dots ,c_{n}\in \mathbb {R} }$.

In mathematical literature, kernels are usually complex valued functions, but in this article we assume real-valued functions, which is the common practice in machine learning and other applications of p.d. kernels.

### Some general properties

• For a family of p.d. kernels ${\displaystyle (K_{i})_{i\in \mathbb {N} },\ \ K_{i}:{\mathcal {X}}\times {\mathcal {X}}\to R}$
• The sum ${\displaystyle \sum _{i=1}^{n}\lambda _{i}K_{i}}$ is p.d., given ${\displaystyle \lambda _{1},\dots ,\lambda _{n}\geq 0}$
• The product ${\displaystyle K_{1}^{a_{1}}\dots K_{n}^{a_{n}}}$ is p.d., given ${\displaystyle a_{1},\dots ,a_{n}\in \mathbb {N} }$
• The limit ${\displaystyle K=\lim _{n\to \infty }K_{n}}$ is p.d. if the limit exists.
• If ${\displaystyle ({\mathcal {X}}_{i})_{i=1}^{n}}$ is a sequence of sets, and ${\displaystyle (K_{i})_{i=1}^{n},\ \ K_{i}:{\mathcal {X}}_{i}\times {\mathcal {X}}_{i}\to R}$ a sequence of p.d. kernels, then both
${\displaystyle K((x_{1},\dots ,x_{n}),(y_{1},\dots ,y_{n}))=\prod _{i=1}^{n}K_{i}(x_{i},y_{i})}$ and
${\displaystyle K((x_{1},\dots ,x_{n}),(y_{1},\dots ,y_{n}))=\sum _{i=1}^{n}K_{i}(x_{i},y_{i})}$
are p.d. kernels on ${\displaystyle {\mathcal {X}}={\mathcal {X}}_{1}\times \dots \times {\mathcal {X}}_{n}}$.
• Let ${\displaystyle {\mathcal {X}}_{0}\subset {\mathcal {X}}}$. Then the restriction ${\displaystyle K_{0}}$ of ${\displaystyle K}$ to ${\displaystyle {\mathcal {X}}_{0}\times {\mathcal {X}}_{0}}$ is also a p.d. kernel.

### Examples of p.d. kernels

• Common examples of p.d. kernels defined on Euclidean space ${\displaystyle \mathbb {R} ^{d}}$ include:
• Linear kernel: ${\displaystyle K(x,y)=x^{T}y,x,y\in \mathbb {R} ^{d}}$.
• Polynomial kernel: ${\displaystyle K(x,y)=(x^{T}y+r)^{n},x,y\in \mathbb {R} ^{d},r>0}$.
• Gaussian kernel (RBF Kernel): ${\displaystyle K(x,y)=e^{-{\frac {\|x-y\|^{2}}{2\sigma ^{2}}}},x,y\in \mathbb {R} ^{d},\sigma >0}$.
• Laplacian kernel: ${\displaystyle K(x,y)=e^{-\alpha \|x-y\|},x,y\in \mathbb {R} ^{d},\alpha >0}$.
• Abel kernel: ${\displaystyle K(x,y)=e^{-\alpha |x-y|},x,y\in \mathbb {R} ,\alpha >0}$.
• kernel generating Sobolev spaces ${\displaystyle W_{2}^{k}(\mathbb {R} ^{d})}$: ${\displaystyle K(x,y)=\|x-y\|_{2}^{k-{\frac {d}{2}}}B_{k-{\frac {d}{2}}}(\|x-y\|_{2})}$, where ${\displaystyle B_{\nu }}$ is the Bessel function of third kind.
• kernel generating Paley-Wiener space: ${\displaystyle K(x,y)={\mbox{sinc}}(\alpha (x-y)),x,y\in \mathbb {R} ,\alpha >0}$.
• If ${\displaystyle H}$ is a Hilbert space, then its corresponding inner product ${\displaystyle (\cdot ,\cdot )_{H}:H\times H\to \mathbb {R} }$ is a p.d. kernel. Indeed, we have
${\displaystyle \sum _{i,j=1}^{n}c_{i}c_{j}(x_{i},x_{j})_{H}=\left(\sum _{i=1}^{n}c_{i}x_{i},\sum _{j=1}^{n}c_{j}x_{j}\right)_{H}=\left\|\sum _{i=1}^{n}c_{i}x_{i}\right\|_{H}^{2}\geq 0}$
• Kernels defined on ${\displaystyle \mathbb {R} _{+}^{d}}$ and histograms: Histograms are frequently encountered in applications of machine learning to real-life problems. Most observations are usually available under the form of nonnegative vectors of counts, which, if normalized, yield histograms of frequencies. It has been shown [1] that the following family of squared metrics, respectively Jensen divergence, the ${\displaystyle \chi }$-square, Total Variation, and two variations of the Hellinger distance:
${\displaystyle \psi _{JD}=H\left({\frac {\theta +\theta '}{2}}\right)-{\frac {H(\theta )+H(\theta ')}{2}},}$
${\displaystyle \psi _{\chi ^{2}}=\sum _{i}{\frac {(\theta _{i}-\theta _{i}')^{2}}{\theta _{i}+\theta _{i}'}},\quad \psi _{TV}=\sum _{i}|\theta _{i}-\theta _{i}'|,}$
${\displaystyle \psi _{H_{1}}=\sum _{i}|{\sqrt {\theta _{i}}}-{\sqrt {\theta _{i}'}}|,\psi _{H_{2}}=\sum _{i}|{\sqrt {\theta _{i}}}-{\sqrt {\theta _{i}'}}|^{2},}$

can be used to define p.d. kernels using the following formula

${\displaystyle K(\theta ,\theta ')=e^{-\alpha \psi (\theta ,\theta ')},\alpha >0.}$

## History

PD kernels, as defined in (1.1), have arisen first in 1909 in a paper on integral equations by James Mercer.[2] Several other authors made use of this concept in the following two decades, but none of them explicitly used kernels ${\displaystyle K(x,y)=f(x-y)}$, i.e. p.d. functions (indeed M. Mathias and S. Bochner seem not to have been aware of the study of p.d. kernels). Mercer’s work arose from Hilbert’s paper of 1904 [3] on Fredholm integral equations of the second kind:

${\displaystyle f(s)=\Phi (s)-\lambda \int _{a}^{b}K(s,t)\phi (t)dt.\qquad \qquad (1.2)}$

In particular, Hilbert had shown that

${\displaystyle \int _{a}^{b}\int _{a}^{b}K(s,t)x(s)x(t)dsdt=\sum {\frac {1}{\lambda _{n}}}\left[\int _{a}^{b}\psi _{n}(s)x(s)ds\right]^{2},\qquad \qquad (1.3)}$

where ${\displaystyle K}$ is a continuous real symmetric kernel, ${\displaystyle x}$ is continuous, ${\displaystyle \{\psi _{n}\}}$ is a complete system of orthonormal eigenfunctions, and ${\displaystyle \lambda _{n}}$’s are the corresponding eigenvalues of (1.2). Hilbert defined a “definite” kernel as one for which the double integral

${\displaystyle J(x)=\int _{a}^{b}\int _{a}^{b}K(s,t)x(s)x(t)dsdt}$

satisfies ${\displaystyle J(x)>0}$ except for ${\displaystyle x(t)=0}$. The original object of Mercer’s paper was to characterize the kernels which are definite in the sense of Hilbert, but Mercer soon found that the class of such functions was too restrictive to characterize in terms of determinants. He therefore defined a continuous real symmetric kernel ${\displaystyle K(s,t)}$ to be of positive type (i.e. positive definite) if ${\displaystyle J(x)\geq 0}$ for all real continuous functions ${\displaystyle x}$ on ${\displaystyle [a,b]}$, and he proved that (1.2) is a necessary and sufficient condition for a kernel to be of positive type. Mercer then proved that for any continuous p.d. kernel the expansion

${\displaystyle K(s,t)=\sum {\frac {\psi _{n}(s)\psi _{n}(t)}{\lambda _{n}}}}$

holds absolutely and uniformly.

At about the same time W. H. Young,[4] motivated by a different question in the theory of integral equations, showed that for continuous kernels condition (1.1) is equivalent to ${\displaystyle J(x)\geq 0}$ for all ${\displaystyle x\in L^{1}[a,b]}$.

E.H. Moore [5][6] initiated the study of a very general kind of p.d. kernel. If ${\displaystyle E}$ is an abstract set, he calls functions ${\displaystyle K(x,y)}$ defined on ${\displaystyle E\times E}$ “positive Hermitian matrices” if they satisfy (1.1) for all ${\displaystyle x_{i}\in E}$. Moore was interested in generalization of integral equations and showed that to each such ${\displaystyle K}$ there is a Hilbert space ${\displaystyle H}$ of functions such that, for each ${\displaystyle f\in H,f(y)=(f,K(\cdot ,y))_{H}}$. This property is called the reproducing property of the kernel and turns out to have importance in the solution of boundary-value problems for elliptic partial differential equations, and is the main reason for the success of kernel methods in machine learning. More details on this will be presented in the following section.

Another line of development in which p.d. kernels played a large role was the theory of harmonics on homogeneous spaces as begun by E. Cartan in 1929, and continued by H. Weyl and S. Ito. The most comprehensive theory of p.d. kernels in homogeneous spaces is that of M. Krein[7] which includes as special cases the work on p.d. functions and irreducible unitary representations of locally compact groups.

In probability theory p.d. kernels arise as covariance kernels of stochastic processes.[8]

## Connection with reproducing kernel Hilbert spaces and feature maps

Positive definite kernels provide a framework that encompasses some basic Hilbert space constructions. In the following we present a tight relationship between positive definite kernels and two mathematical objects, namely reproducing Hilbert spaces and feature maps.

Let ${\displaystyle X}$ be a set, ${\displaystyle H}$ a Hilbert space of functions ${\displaystyle f:X\to R}$, and ${\displaystyle (\cdot ,\cdot )_{H}:H\times H\to R}$ the corresponding inner product on ${\displaystyle H}$. For any ${\displaystyle x\in X}$ the evaluation functional ${\displaystyle e_{x}:H\to R}$ is defined by ${\displaystyle f\mapsto e_{x}(f)=f(x)}$. We first define a reproducing kernel Hilbert space (RKHS):

Definition: Space ${\displaystyle H}$ is called a reproducing kernel Hilbert space if the evaluation functionals are continuous.

Every RKHS has a special function associated to it, namely the reproducing kernel:

Definition: Reproducing kernel is a function ${\displaystyle K:X\times X\to R}$ such that

1) ${\displaystyle K_{x}(\cdot )\in H,\forall x\in X}$, and
2) ${\displaystyle (f,K_{x})=f(x)}$, for all ${\displaystyle f\in H}$ and ${\displaystyle x\in X}$.
The latter property is called the reproducing property.

The following result shows equivalence between RKHS and reproducing kernels:

Theorem: Every reproducing kernel ${\displaystyle K}$ induces a unique RKHS, and every RKHS has a unique reproducing kernel.

Now the connection between p.d. kernels and RKHS is given by the following theorem

Theorem: Every reproducing kernel is positive definite, and every p.d. kernel defines a unique RKHS, of which it is the unique reproducing kernel.

Thus given a positive definite kernel ${\displaystyle K}$, it is possible to build an associated RKHS with ${\displaystyle K}$ as a reproducing kernel.

As stated earlier, p.d. kernels can be constructed from inner products. This fact can be used to connect p.d. kernels with another interesting object that arises in machine learning applications, namely the feature map. Let ${\displaystyle F}$ be a Hilbert space, and ${\displaystyle (\cdot ,\cdot )_{F}}$ the corresponding inner product. Any map ${\displaystyle \Phi :X\to F}$ is called a feature map. In this case we call ${\displaystyle F}$ the feature space. It is easy to see [9] that every feature map defines a unique p.d. kernel by

${\displaystyle K(x,y)=(\Phi (x),\Phi (y))_{F}.}$

Indeed, positive definiteness of ${\displaystyle K}$ follows from the p.d. property of the inner product. On the other hand, every p.d. kernel, and its corresponding RKHS, have many associated feature maps. For example: Let ${\displaystyle F=H}$, and ${\displaystyle \Phi (x)=K_{x}}$ for all ${\displaystyle x\in X}$. Then ${\displaystyle (\Phi (x),\Phi (y))_{F}=(K_{x},K_{y})_{H}=K(x,y)}$, by the reproducing property. This suggests a new look at p.d. kernels as inner products in appropriate Hilbert spaces, or in other words p.d. kernels can be viewed as similarity maps which quantify effectively how similar two points ${\displaystyle x}$ and ${\displaystyle y}$ are through the value ${\displaystyle K(x,y)}$. Moreover, through the equivalence of p.d. kernels and its corresponding RKHS, every feature map can be used to construct a RKHS.

## Kernels and distances

Kernel methods, which are very popular machine learning applications of p.d. kernels, are often compared to distance based methods such as nearest neighbors. In this section we discuss parallels between their two respective ingredients, namely kernels ${\displaystyle K}$ and distances ${\displaystyle d}$.

Here by a distance function between each pair of elements of some set ${\displaystyle X}$, we mean a metric defined on that set, i.e. any nonnegative-valued function ${\displaystyle d}$ on ${\displaystyle {\mathcal {X}}\times {\mathcal {X}}}$ which satisfies

• ${\displaystyle d(x,y)\geq 0}$, and ${\displaystyle d(x,y)=0}$ if and only if ${\displaystyle x=y}$,
• ${\displaystyle d(x,y)=d(y,x)}$,
• ${\displaystyle d(x,z)\leq d(x,y)+d(y,z)}$.

The link between distances and p.d. kernels is given by a particular kind of kernel, called negative definite kernel, and defined as follows

Definition: A symmetric function ${\displaystyle \psi :{\mathcal {X}}\times {\mathcal {X}}\to \mathbb {R} }$ is called a negative definite (n.d.) kernel on ${\displaystyle {\mathcal {X}}}$ if

${\displaystyle \sum _{i,j=1}^{n}c_{i}c_{j}\psi (x_{i},x_{j})\leq 0\quad \quad \quad \quad (1.4)}$

holds for any ${\displaystyle n\in \mathbb {N} ,x_{1},\dots ,x_{n}\in {\mathcal {X}},}$ and ${\displaystyle c_{1},\dots ,c_{n}\in \mathbb {R} }$ such that ${\displaystyle \sum _{i=1}^{n}c_{i}=0}$.

The parallel between n.d. kernels and distances is in the following: whenever a n.d. kernel vanishes on the set ${\displaystyle \{(x,x):x\in {\mathcal {X}}\}}$, and is zero only on this set, then its square root is a distance for ${\displaystyle {\mathcal {X}}}$.[10] At the same time each distance does not correspond necessarily to a n.d. kernel. This is only true for Hilbertian distances, where distance ${\displaystyle d}$ is called Hilbertian if one can embed the metric space ${\displaystyle ({\mathcal {X}},d)}$ isometrically into some Hilbert space.

On the other hand, n.d. kernels can be identified with a subfamily of p.d. kernels known as infinitely divisible kernels. A nonnegative-valued kernel ${\displaystyle K}$ is said to be infinitely divisible if for every ${\displaystyle n\in \mathbb {N} }$ there exists a positive definite kernel ${\displaystyle K_{n}}$ such that ${\displaystyle K=(K_{n})^{n}}$.

## Some applications

### Kernels in machine learning

Positive definite kernels, through their equivalence with reproducing kernel Hilbert spaces, are particularly important in the field of statistical learning theory because of the celebrated representer theorem which states that every function in an RKHS can be written as a linear combination of the kernel function evaluated at the training points. This is a practically useful result as it effectively simplifies the empirical risk minimization problem from an infinite dimensional to a finite dimensional optimization problem.

### Kernels in probabilistic models

There are several different ways in which kernels arise in probability theory.

• Nondeterministic recovery problems: Assume that we want to find the response ${\displaystyle f(x)}$ of an unknown model function ${\displaystyle f}$ at a new point ${\displaystyle x}$ of a set ${\displaystyle {\mathcal {X}}}$, provided that we have a sample of input-response pairs ${\displaystyle (x_{i},f_{i})=(x_{i},f(x_{i}))}$ given by observation or experiment. The response ${\displaystyle f_{i}}$ at ${\displaystyle x_{i}}$ is not a fixed function of ${\displaystyle x_{i}}$ but rather a realization of a real-valued random variable ${\displaystyle Z(x_{i})}$. The goal is to get information about the function ${\displaystyle E[Z(x_{i})]}$ which replaces ${\displaystyle f}$ in the deterministic setting. For two elements ${\displaystyle x,y\in {\mathcal {X}}}$ the random variables ${\displaystyle Z(x)}$ and ${\displaystyle Z(y)}$ will not be uncorrelated, because if ${\displaystyle x}$ is too close to ${\displaystyle y}$ the random experiments described by ${\displaystyle Z(x)}$ and ${\displaystyle Z(y)}$ will often show similar behaviour. This is described by a covariance kernel ${\displaystyle K(x,y)=E[Z(x)\cdot Z(y)]}$. Such a kernel exists and is positive definite under weak additional assumptions. Now a good estimate for ${\displaystyle Z(x)}$ can be obtained by using kernel interpolation with the covariance kernel, ignoring the probabilistic background completely.

Assume now that a noise variable ${\displaystyle \epsilon (x)}$, with zero mean and variance ${\displaystyle \sigma ^{2}}$, is added to ${\displaystyle x}$, such that the noise is independent for different ${\displaystyle x}$ and independent of ${\displaystyle Z}$ there, then the problem of finding a good estimate for ${\displaystyle f}$ is identical to the above one, but with a modified kernel given by ${\displaystyle K(x,y)=E[Z(x)\cdot Z(y)]+\sigma ^{2}\delta _{xy}}$.

• Density estimation by kernels: The problem is to recover the density ${\displaystyle f}$ of a multivariate distribution over a domain ${\displaystyle {\mathcal {X}}}$, from a large sample ${\displaystyle x_{1},\dots ,x_{n}\in {\mathcal {X}}}$ including repetitions. Where sampling points lie dense, the true density function must take large values. A simple density estimate is possible by counting the number of samples in each cell of a grid, and plotting the resulting histogram, which yields a piecewise constant density estimate. A better estimate can be obtained by using a nonnegative translation invariant kernel ${\displaystyle K}$, with total integral equal to one, and define
${\displaystyle f(x)={\frac {1}{n}}\sum _{i=1}^{n}K\left({\frac {x-x_{i}}{h}}\right)}$

as a smooth estimate.

### Numerical solution of partial differential equations

One of the greatest application areas of so-called meshfree methods is in the numerical solution of PDEs. Some of the popular meshfree methods are closely related to positive definite kernels (such as meshless local Petrov Galerkin (MLPG), Reproducing kernel particle method (RKPM) and smoothed-particle hydrodynamics (SPH)). These methods use radial basis kernel for collocation[11]

### Other applications

In the literature on computer experiments [12] and other engineering experiments one increasingly encounters models based on p.d. kernels, RBFs or kriging. One such topic is response surface modeling. Other types of applications that boil down to data fitting are rapid prototyping and computer graphics. Here one often uses implicit surface models to approximate or interpolate point cloud data.

Applications of p.d. kernels in various other branches of mathematics are in multivariate integration, multivariate optimization, and in numerical analysis and scientific computing, where one studies fast, accurate and adaptive algorithms ideally implemented in high-performance computing environments.[13]

## References

1. ^ Hein, M. and Bousquet, O. (2005). "Hilbertian metrics and positive definite kernels on probability measures". In Ghahramani, Z. and Cowell, R., editors, Proceedings of AISTATS 2005.
2. ^ Mercer, J. (1909). “Functions of positive and negative type and their connection with the theory of integral equations”. Philosophical Transactions of the Royal Society of London, Series A 209, pp. 415-446.
3. ^ Hilbert, D. (1904). "Grundzuge einer allgemeinen Theorie der linearen Integralgleichungen I", Gott. Nachrichten, math.-phys. K1 (1904), pp. 49-91.
4. ^ Young, W. H. (1909). "A note on a class of symmetric functions and on a theorem required in the theory of integral equations", Philos. Trans. Roy.Soc. London, Ser. A, 209, pp. 415-446.
5. ^ Moore, E.H. (1916). "On properly positive Hermitian matrices", Bull. Amer. Math. Soc. 23, 59, pp. 66-67.
6. ^ Moore, E.H. (1935). "General Analysis, Part I", Memoirs Amer. Philos. Soc. 1, Philadelphia.
7. ^ Krein. M (1949/1950). "Hermitian-positive kernels on homogeneous spaces I and II" (in Russian), Ukrain. Mat. Z. 1(1949), pp. 64-98, and 2(1950), pp. 10-59. English translation: Amer. Math. Soc. Translations Ser. 2, 34 (1963), pp. 69-164.
8. ^ Loeve, M. (1960). "Probability theory", 2nd ed., Van Nostrand, Princeton, N.J.
9. ^ Rosasco, L. and Poggio, T. (2015). "A Regularization Tour of Machine Learning - MIT 9.520 Lecture Notes" Manuscript.
10. ^ Berg, C., Christensen, J. P. R., and Ressel, P. (1984). "Harmonic Analysis on Semigroups". Number 100 in Graduate Texts in Mathematics, Springer Verlag.
11. ^ Schabak, R. and Wendland, H. (2006). "Kernel Techniques: From Machine Learning to Meshless Methods", Cambridge University Press, Acta Numerica (2006), pp. 1-97.
12. ^ Haaland, B. and Qian, P. Z. G. (2010). "Accurate emulators for large-scale computer experiments", Ann. Stat.
13. ^ Gumerov, N. A. and Duraiswami, R. (2007). "Fast radial basis function interpolation via preconditioned Krylov iteration". SIAM J. Scient. Computing 29/5, pp. 1876-1899.