# How should I go about choosing a kernel for this function?

I'm playing around with GPR and thinking about kernels. I am looking for a kernel that could do a good job of fitting this function.

It is something I drew up just to see how well GPR can do. Its functional form is

$$F(x) = -x^2 + 10 + 0.3\sin(4 \pi x) + \varepsilon$$

Where $\varepsilon \sim \mathcal{N}(0,0.5)$.

I'm doing things in python specifically sklearn, so I have a bunch of kernels at my disposal. So far I have tried a sum of the exponential sine wave to account for periodicity and the radial basis function. Is there any other way to account for the quadratic part of the function?

• I assume your F(x) is the generating function? Is so (I may be wrong) why not fit it using some optimization routine? – HEITZ Dec 13 '16 at 23:46
• If you are just playing around why don't you just try out some and observe what difference it makes? – g g Feb 19 '17 at 11:05

$k_{\textrm{Per}}(x, x') = \sigma^2\exp\left(-\frac{2\sin^2(\pi|x - x'|/p)}{\ell^2}\right)$.
$k_{\textrm{LocalPer}}(x, x') = k_{\textrm{Per}}(x, x')k_{\textrm{LC}}(x, x') = \sigma^2\exp\left(-\frac{2\sin^2(\pi|x - x'|/p)}{\ell^2}\right) \exp\left(-\frac{(x - x')^2}{2\ell^2}\right)$.