Perform the ordinary kriging prediction on a 2D dataset.
[K,V] = NL_F_KrigingOrdinary(X,Y,Z,Gx,Gy,N)
x-coordinate of the measurements.
y-coordinate of the measurements.
Value of the measurements.
x-coordinate of the predictions.
y-coordinate of the predictions.
Number of points used by SemiVariogramFit.
kriging predictor vector.
kriging standard error vector.
NL_F_KrigingOrdinary performs the ordinary kriging prediction (WIKIPEDIA) on the 2D dataset described by measurement points of values Z located in X and Y. Predictions are computed at the coordinates Gx and Gy. N is used to find the best slope (semivariance versus distance with a least-squares regression line, with a positive slope and passing through zero). The outputs are the kriging predictor vector K (forecasting values at [Gx,Gy]) and their kriging standard error V.
//grid mx=0; Mx=6; my=0; My=6; l=50; c=50; [gx,gy]=NL_F_GridXY(mx,Mx,my,My,l,c);//grid x=[1,3,1,4,5]; y=[5,4,3,5,1]; z=[100,105,105,100,115]; ni=100; [K,V] = NL_F_KrigingOrdinary(x,y,z,gx,gy,ni);//application of NL_F_KrigingOrdinary Mx=matrix(gx,l,c); My=matrix(gy,l,c); Mk=matrix(K,l,c); Mv=matrix(V,l,c); NL_V_Colormap(Mk,Mx(:,1)',My(1,:),256); f1=gcf(); f1.figure_name="Kriging Predictor"; NL_V_Colormap(Mv,Mx(:,1)',My(1,:),256); f2=gcf(); f2.figure_name="Kriging Standard Error"; | ![]() | ![]() |