dingdangsunny

kriging工具箱:https://orbit.dtu.dk/en/publications/dace-a-matlab-kriging-toolbox

x=rand(1,100)*5;
y=rand(1,100)*5;
z=x./(y+1)+0.01*rand(1,100);
data=[x\',y\',z\'];
scatter(x,y,25,z);
colorbar;

%模型参数设置
theta = [5 5]; lob = [1e-1 1e-1]; upb = [20 20];
%变异函数模型为高斯模型
[dmodel, perf] = dacefit(data(:,1:2), data(:,3), @regpoly0, @corrgauss, theta, lob, upb);
%创建一个40*40的网格,范围为0-5
X = gridsamp([0 0;5 5], 40);
%格网点的预测值返回在矩阵YX中,预测点的均方根误差返回在矩阵MSE中
[YX,MSE] = predictor(X, dmodel);
X1 = reshape(X(:,1),40,40); X2 = reshape(X(:,2),40,40);
YX = reshape(YX, size(X1));         %size(X1)=40*40
mesh(X1, X2, YX);         %绘制预测表面

theta是初始值,lob和upb是参数范围,计算结果存在dmodel.theta中。

>> dmodel.theta
ans =
   0.903390452322443   4.718047509652705

当对模型不确定或者变量波动剧烈时,所给范围宜较宽。

若初始值选取不合理,则可能造成曲面波动。

如以下情况:

分类:

技术点:

相关文章:

  • 2021-08-27
  • 2021-06-02
  • 2021-07-14
  • 2021-12-15
  • 2021-06-23
  • 2021-05-20
  • 2021-08-13
  • 2021-12-15
猜你喜欢
  • 2021-09-08
  • 2021-12-19
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
相关资源
相似解决方案