我有一个Nx2输入矩阵称为X。我也有输出值Y这是一个向量Nx1。我创建一些数据进行测试,如下所示:
Xtest=linspace(x_min,x_max,n);
Ytest=linspace(y_min,y_max,n);
所以,矩阵Z is of nx2尺寸并将用作我的测试点。我使用 GPML 库提供的演示中的默认参数调整,如下所示:
covfunc = {@covMaterniso, 3};
ell = 1/4; sf = 1;
hyp.cov = log([ell; sf]);
likfunc = @likGauss;
sn = 0.1;
hyp.lik = log(sn);
然后使用 gp 函数:
[ymu ys2 fmu fs2] = gp(hyp, @infExact, [], covfunc, likfunc, x, y, z);
我期望 ymu 是 z 中每个测试值的预测值。当我这样绘制时:
[L1,L2]=meshgrid(Xtest',Ytest');
[mu,~]=meshgrid(ymu,ymu);
surf(L1,L2,ymu);
I get a strange surface. i.e i get stripes of coloured area rather some Gaussian like structure which is expected. The data in X and Y are real life data.
What I would expect: