You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am not sure if this is just on my machine, but I can't seem to sample from prior RBF GPs or posteriors trained on them. For instance, something as simple as
x =range(0,5,30)
f =GP(SEKernel())
plot(rand(f(x), 10))
The issue you're encountering is to be expected, and will be found in any GP package. It's a consequence of unavoidable numerical error due to finite precision arithmetic, and the eigenvalues of the kernel matrix you are working with being very close to zero.
The solution is to increase the variance of the noise of the model, something like:
x =range(0,5,30)
f =GP(SEKernel())
plot(rand(f(x, 1e-12), 10))
You'll find that this happens let with less smooth kernels, such as the Matern32Kernel because the dependence between nearby inputs decays more sharply / the samples produced by a GP with a Matern-3/2 kernel are "rougher" than those produced by the SEKernel.
Thank you for your answer, this indeed fixed the issue. But in this case, if it's an expected numerical problem, is there no way to make it a default feature to include the 1e-12 noise variance when the GP(kernel) is instantiated? And if a second argument is given, it will be overridden.
So we actually do do this -- see here. The problem is that different kernels + different sets of inputs require different values of this, so if you're training kernel hyperparameters you'll potentially need to change this value during training as the kernel changes. What the correct thing to do in general is is still an open question tbh.
Hello, I am not sure if this is just on my machine, but I can't seem to sample from prior RBF GPs or posteriors trained on them. For instance, something as simple as
results in the error
Unless I change the input sample size to something small like
range(0,5,20)
.Other kernels, e.g.,
run without any issue. Thank you in advance for your help.
The text was updated successfully, but these errors were encountered: