Table of Contents
This chapter discuss how to run a number of kriging algorithms implemented natively in Matlab.
These algorithms are note fast, but may be useful for smaller problems, and for teaching purposes. For larger scale problems consider using the Matlab interfaces to GSTAT (“GSTAT from Matlab”) and S-GeMS (“S-GeMS - The Stanford Geostatistical Modeling Software”).
A point in mGstat can be multidimensional (higher than 3 dimensions). Only the native Matlab implementations of geostatistical algorithm can handle this. GSTAT and GSLIB are restricted to 3D.
A point is given by a 1-row vector, where the number of columns definexs the dimension. For example, the location of the three 1D-points
(x1,x2,x3)
=
(1,5,10)
is given by
>> pos=[1;5;10]; >> [ndata,ndim]=size(pos) ndata = 3 ndim = 1
More than one location is specified by a matrix where each row defines one point, and the number of rows is the number of locations. For example, the three 4-dimensional points,
(2,2,4,8)
,
(1,2,3,4)
,
(6,6,2,2)
is given by
>> pos=[2 2 4 8; 1 2 3 4; 6 6 2 2]; >> [ndata,ndim]=size(pos) ndata = 3 ndim = 4
To transform locations from array structures to the matrix shape used by mGstat is straightforward in Matlab. The following two arrays denoting x and y locations
x =[ 1 2 3 1 2 3]; y =[ 4 4 4 5 5 5];
can be converted to the format required by mGstat by
>> pos=[x(:) y(:)] pos = 1 4 1 5 2 4 2 5 3 4 3 5 >> [ndata,ndim]=size(pos) ndata = 6 ndim = 2
© 2004-2010 Thomas Mejer Hansen. | This site is hosted by |