When no prediction locations are defined in the command file, gstat starts the interactive variogram modelling user interface (example 1, example 2). Multiple variables are analyzed when they are specified with data( id) commands, each having a unique id. From this interface sample variograms, covariograms, cross variograms and cross covariograms can be calculated, viewed, and modelled (see Appendix A.1); variogram plots can be saved (e.g. as POSTSCRIPT file, see below) and printed; and modified settings of data and fitted variograms can be saved as a gstat command file. The interface has several selection items and single-key options. Summary help is obtained by pressing `H' (shift-h).
A variogram plot from gnuplot (gif terminal) is shown below:
Help on a specific user interface item is obtained by selecting the item
with the cursor keys and pressing `?'. What follows is a brief
description of the visible items in the user interface:
Variogram models can be fitted to the sample variogram using iterative reweighted least squares estimation [4], or can be fitted directly to the sample data using REML estimation [15]. Appendix A.1 gives details on the calculation of sample (co-) variograms and model fitting. Non-linear least squares fitting is only guaranteed to work when good initial values are provided. Therefore, and more in general, visual examination of model fit is recommended.
Variogram plots can be saved as encapsulated POSTSCRIPT file (Fig. 2.2) from gnuplot by pressing `P' or as gif file by pressing `G' (gif only when the gd library was linked to gnuplot). Plots can be customised (e.g. labels, legend, title) by first saving sample variogram estimates to a file (`e'), then saving the gnuplot commands to a file (`g'), then modifying this file and finally using gnuplot to create the POSTSCRIPT (or other graphics) file.
By default, direct and cross variograms and covariograms are calculated from ordinary least squares residuals by using a linear model (as default only an intercept, section 2.7). Generalised least squares residuals are used when the command
set gls=1;
is added to the command file (sections 2.7, 4.4).
Variograms can also be calculated non-interactively, by adding the command
or
to the command file (section 4.5).
Sample variograms can be saved to a file, using for instance:
variogram(zinc): 'zinc.est';
For large data sets, it may be best to calculate sample variograms non-interactively and do the modelling afterwards. This is accomplished by first saving the sample variograms to file as described above, and then to load only the sample variograms in the user interface (not the data), which is done by defining dummy data:
data(zinc); # dummy data
and a valid sample variogram, as
variogram(zinc): 'zinc.est';
or, when a variogram model should be defined ahead of fitting:
variogram(zinc): 'zinc.est', 1 Nug() + 1 Sph(800);
variogram(zinc): 'zinc.map';
optionally, in addition the corresponding number of data pairs can be written to the output map zincn.map when specified as
variogram(zinc): 'zince.map', 'zincn.map';
(typically a variogram map is centred around (0,0) and has map dimension and cell size similar to cutoff and interval width values).