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.

enter image description here

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?

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

Hello have you tried the "Locally Periodic Kernels", these will work with periodic functions that slowly vary over time. You use a periodic kernel and add or multiply a local kernel, for example a RBF kernel multiplied by a periodic kernel. This will allow one to model functions that are only locally periodic the shape of the repeating part of the function can now change over time.

For example you can use a Periodic Kernel:

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

Then multiply it by a local RBF kernel (LC):

$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)$.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.