Perform the gamma matrix used by the ordinary kriging scheme.
[G] = NL_F_GammaMatrix(S,K,L,D,N)
Slope (least-squares regerssion line).
Index vector (head).
Index vector (tail).
Distance vector.
Dataset size.
Gamma matrix.
NL_F_GammaMatrix performs the gamma matrix (G) used by the ordinary kriging scheme (G(i,j)=S*D). [K,L] provides the source and destination (inter-distance D) of all couples of points where we compute the semi-variance parameter (computed by NL_F_SemiVariogram). The 1 and 0 (G($,:) and G(:,$)) are due to unbiasedness constraints.
x=[1,3,1,4,5]; y=[5,4,3,5,1]; z=[100,105,105,100,115]; n=length(x); [k,l,d,s]=NL_F_SemiVariogram(x,y,z);//semi-variogram ni=0.1;//inter slope increment between 0 and max slope [os,isl,di]=NL_F_SemiVariogramFit(s,d,ni);//fit [g]=NL_F_GammaMatrix(os,k,l,d,n);//application of NL_F_GammaMatrix | ![]() | ![]() |