autofitVariogram {automap}R Documentation

Automatically fitting a variogram

Description

Automatically fitting a variogram to the data on which it is applied. The automatic fitting is done through fit.variogram. In fit.variogram the user had to supply an initial estimate for the sill, range etc. autofitVariogram provides this estimate based on the data and then calls fit.variogram.

Usage

autofitVariogram(formula, 
                 input_data, 
                 model = c("Sph", "Exp", "Gau", "Ste"),
                 kappa = c(0.05, seq(0.2, 2, 0.1), 5, 10), 
                 fix.values = c(NA,NA,NA),
                 verbose = FALSE, 
                 GLS.model = NA)

Arguments

formula formula that defines the dependent variable as a linear model of independent variables; suppose the dependent variable has name 'z', for ordinary and simple kriging use the formula 'z~1'; for simple kriging also define 'beta' (see below); for universal kriging, suppose 'z' is linearly dependent on 'x' and 'y', use the formula 'z~x+y'.
input_data An object of SpatialPointsDataFrame-class.
model The list of variogrammodels that will be tested.
kappa Smoothing parameter of the Matern model. Provide a list if you want to check more than one value.
fix.values Can be used to fix a variogram parameter to a certain value. It consists of a list with a length of three. The items describe the fixed value for the nugget, range and sill respectively. Setting the value to NA means that the value is not fixed.
verbose logical, if TRUE the function will give extra feedback on the fitting process
GLS.model If a variogram model is passed on through this parameter a Generalized Least Squares sample variogram is calculated.

Details

Geostatistical routines are used from package gstat.

A few simple choices are made when estimating the inital guess for fit.variogram. The initial sill is estimated as the mean of the max and the median of the semi-variance. The inital range is defined as 0.10 times the diagonal of the bounding box of the data. The initial nugget is defined as the min of the the semi-variance.

There are five different types of models that are often used:

Sph
A shperical model.
Exp
An exponential model.
Gau
A gaussian model.
Mat
A model of the Matern familiy
Ste
Matern, M. Stein's parameterization

A list of all permitted variogram models is available by typing vgm() into the R console. autofitVariogram iterates over the variogram models listed in model and picks the model that has the smallest residual sum of squares with the sample variogram. For the Matern model, all the kappa values in kappa are tested.

Value

An object of type autofitVariogram is returned. This object contains the experimental variogram and the fitted variogram model

Note

autofitVariogram is mostly used indirectly through the function autoKrige

Author(s)

Paul Hiemstra, p.hiemstra@geo.uu.nl

See Also

fit.variogram, autoKrige, posPredictionInterval

Examples

data(meuse)
coordinates(meuse) =~ x+y
variogram = autofitVariogram(zinc~1,meuse)
plot(variogram)

# Residual variogram
data(meuse)
coordinates(meuse) =~ x+y
variogram = autofitVariogram(zinc ~ soil + ffreq + dist, meuse)
plot(variogram)

[Package automap version 1.0-0 Index]