1-d infill error estimate
I think there might be a bug in the kriging or MSE estimate if the problem is compressed to 2-D (ie, one input and one output). If you run the x*sin(x) test function with only a few points (2-4) and plot the error estimate, it doesn't look correct.
Is the smoothness factor "p" getting optimized on as well as the theta values? If not, that might cause this issue. I believe this bug also exists in the Matlab code, so that won't be a great resource to compare against.
I'll take a look. 1-d arrays weren't really tested during development. I need to add some checks to make sure that the array is at least 2-d. The p factor is optimised in this code. Could you post a quick script to recreate the issue you're seeing with x*sin(x)?
I've noticed something similar in working with 1-d arrays - please see the code below and resultant output.
import pyKriging
from pyKriging.krige import kriging
MAXVAL = 32
CONVERSION = 0.9687491103216275
X = np.array([[0.01], [1], [2], [8], [16], [32]]) / MAXVAL
y = np.array([
4.97292791842937,
4.84888042822178,
4.843428519136497,
4.885980222410153,
4.952942447020513,
5.06074067099633,
]) * CONVERSION
k = kriging(X, y)
k.train(optimizer='pso')
k.snapshot()
from matplotlib import pyplot as pl
pl.scatter(X * MAXVAL, y, c='black', s=20)
xs = [x / 1000. * MAXVAL for x in xrange(1000)]
k_predictions = [k.predict([x / MAXVAL]) for x in xs]
pl.plot(xs, k_predictions,)
errors = [k.predict_var([x / MAXVAL]) for x in xs]
pl.fill(
xs + xs[::-1],
[pred + err for pred, err in zip(k_predictions, errors)] +
[pred - err for pred, err in zip(k_predictions, errors)][::-1],
alpha=.25,
fc='black'
)
pl.show()
This results in:

Any assistance would be greatly appreciated.
Hi, thanks for the example. I'm looking into this now. It seems to be an error in how the predictions are generated. More to come soon.
Best, Chris
Did you ever figure out what was going on with this?
Hi @capaulson , just wondering if you ever determined the cause of the issue here. Thanks!