fit.variogram {gstat}R Documentation

Fit a Variogram Model to a Sample Variogram

Description

Fit ranges and/or sills from a simple or nested variogram model to a sample variogram

Usage

fit.variogram(object, model, fit.sills = TRUE, fit.ranges = TRUE,
        fit.method = 7, print.SSE = FALSE, debug.level = 1)

Arguments

object sample variogram, output of variogram
model variogram model, output of vgm
fit.sills logical; determines whether the partial sill coefficients (including nugget variance) should be fitted; or logical vector: determines for each partial sill parameter whether it should be fitted or fixed.
fit.ranges logical; determines whether the range coefficients (excluding that of the nugget component) should be fitted; or logical vector: determines for each range parameter whether it should be fitted or fixed.
fit.method fitting method, used by gstat. The default method uses weights $N_h/h^2$ with $N_h$ the number of point pairs and $h$ the distance. This criterion is not supported by theory, but by practice. For other values of fit.method, see table 4.2 in the gstat manual.
print.SSE logical; if TRUE, print the (weighted) sum of squared errors of the fitted model
debug.level integer; set gstat internal debug level

Value

returns a fitted variogram model (of class variogram.model). This is a data.frame with a logical attribute "singular" that indicates whether the non-linear fit converged, or ended in a singularity.

Author(s)

Edzer J. Pebesma

References

http://www.gstat.org/

Pebesma, E.J., 2004. Multivariable geostatistics in S: the gstat package. Computers & Geosciences, 30: 683-691.

See Also

variogram, vgm

Examples

data(meuse)
vgm1 <- variogram(log(zinc)~1, ~x+y, meuse)
fit.variogram(vgm1, vgm(1,"Sph",300,1))

[Package Contents]