Solved – Valid result when adding two kernels with negative coefficient

kernel trickmachine learningsvm

If $k_1$ and $k_2$ be a kernel in $ \mathbb{R}^n \times \mathbb{R}^n $. we know $k(x,z)=ak_1(x,z) + bk_2(x,z)$ (kernel addition) is still a valid kernel if $\: a,b \geq 0\,$ ($a,b$ is real numbers, scalar) .

That this is valid can be seen from the fact that the results of the kernel function can be interpreted as inner products in feature space. Adding the inner products together amounts to adding both feature spaces together.

Today I was surprised when I read my notes. My TA said $k(x,z)=ak_1(x,z) + bk_2(x,z)$ ("kernel addition") is not a valid kernel for just option (1).

1) $ a<0,b<0$

2) $a<0,b>0$

3) $a>0,b<0$

How is it possible to still have a valid kernel with $(2),(3)$?

Best Answer

Here's an example where option (3) is valid: let $k_1(x, y) = 2 x^T y$, $k_2(x, y) = x^T y$. Then $k_1 - k_2 = \left( (x, y) \mapsto x^T y \right)$ is a valid kernel. (2) can be achieved in the same way, $-k_2 + k_1$ or equivalently $-\frac12 k_1 + 2 k_2$.

In general, other combinations of kernels according to these options may or may not be positive semidefinite. Finding a valid combination becomes a difficult optimization problem.

(1), though, is by definition negative semidefinite. Only the function $k(x, y) = 0$ is both positive and negative semidefinite.

Related Question