Consider a linear regression model whose parameters are determined by minimizing a regularized sum-of-squares error function given by

$$ J(\bold w)=\frac{1}{2}\sum_{n=1}^N\{\bold w^{\text T}\bm\phi(\bold x_n)-t_n\}^2+\frac{\lambda}{2}\bold w^{\text T}\bold w $$

where $\lambda\geqslant0$. If we set the gradient of $J(\bold w)$ with respect to $\bold w$ equal to zero, we obtain

$$ \bold w=\sum_{n=1}^Na_n\bm\phi(\bold x_n)=\bold\Phi^{\text T}\bold a $$

where $\bold \Phi$ is the design matrix, whose $n^{\text {th}}$ row is given by $\bm\phi(\bold x_n)^{\text T}$ and the vector $\bold a=(a_1,\cdots,a_N)^{\text T}$ given by

$$ a_n=-\frac{1}{\lambda}\{\bold w^{\text T}\bm\phi(\bold x_n)-t_n\} $$

This gives rise to a dual representation. We now define the Gram matrix $\bold K=\bold\Phi\bold\Phi^{\text T}$, which is an $N\times N$ symmetric matrix with elements

$$ K_{nm}=\bm\phi(\bold x_n)^{\text T}\bm\phi(\bold x_m)=k(\bold x_n,\bold x_m) $$

where we have introduced the kernel function $k(\bold x,\bold x^{\prime})$. In terms of the Gram matrix, the sum-of-squares error function can be written as

$$ J(\bold a)=\frac{1}{2}\bold a^{\text T}\bold K\bold K\bold a-\bold a^{\text T}\bold KT+\frac{1}{2}T^{\text T}T+\frac{\lambda}{2}\bold a^{\text T}\bold K\bold a $$

where $T=(t_1,\ldots,t_N)^{\text T}$. We can also hav

$$ \bold a=(\bold K+\lambda\bold I_N)^{-1}T $$

Then we obtain

$$ y(\bold x)=\bold w^{\text T}\bm\phi(\bold x)=\bold k(\bold x)^{\text T}(\bold K+\lambda\bold I_N)^{-1}T $$

where we have defined the vector $\bold k(\bold x)$ with elements $k_n(\bold x)=k(\bold x_n,\bold x)$. This is known as a dual formulation.

The advantage of the dual formulation is that it is expressed entirely in terms of the kernel function $k(\bold x,\bold x^{\prime})$ with avoid the explicit introduction of the feature vector $\bold \phi(\bold x)$, which allows us implicitly to use feature spaces of high, even infinite, diemensionality.