gstat (version 1.0-2)

vgm: Generate, or Add to Variogram Model

Description

Generates a variogram model, or adds to an existing model. print.variogramModel prints the essence of a variogram model.

Usage

vgm(psill, model, range, nugget, add.to, anis, kappa = 0.5, ..., covtable)
## S3 method for class 'variogramModel':
print(x, ...)
as.vgm.variomodel(m)

Arguments

psill
(partial) sill of the variogram model component
model
model type, e.g. "Exp", "Sph", "Gau", "Mat". Calling vgm() without a model argument returns a data.frame with available models.
range
range of the variogram model component; in case of anisotropy: major range
kappa
smoothness parameter for the Matern class of variogram models
nugget
nugget component of the variogram (this basically adds a nugget compontent to the model)
add.to
the variogram model to which we want to add a component (structure)
anis
anisotropy parameters: see notes below
x
a variogram model to print
...
arguments that will be passed to print, e.g. digits (see examples)
covtable
if model is Tab, instead of model parameters a one-dimensional covariance table can be passed here. See covtable.R in tests directory, and example below.
m
object of class variomodel, see geoR

Value

  • an object of class variogramModel, which extends data.frame.

    When called without a model argument, a data.frame with available models is returned, having two columns: short (abbreviated names, to be used as model argument: "Exp", "Sph" etc) and long (with some description).

    as.vgm.variomodel tries to convert an object of class variomodel (geoR) to vgm.

References

http://www.gstat.org/

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

Deutsch, C.V. and Journel, A.G., 1998. GSLIB: Geostatistical software library and user's guide, second edition, Oxford University Press.

See Also

show.vgms to view the available models, fit.variogram, variogramLine, variogram for the sample variogram.

Examples

Run this code
vgm()
vgm(10, "Exp", 300)
x <- vgm(10, "Exp", 300)
vgm(10, "Nug", 0)
vgm(10, "Exp", 300, 4.5)
vgm(10, "Mat", 300, 4.5, kappa = 0.7)
vgm( 5, "Exp", 300, add.to = vgm(5, "Exp", 60, nugget = 2.5))
vgm(10, "Exp", 300, anis = c(30, 0.5))
vgm(10, "Exp", 300, anis = c(30, 10, 0, 0.5, 0.3))
# Matern variogram model:
vgm(1, "Mat", 1, kappa=.3)
x <- vgm(0.39527463, "Sph", 953.8942, nugget = 0.06105141)
x
print(x, digits = 3);
# to see all components, do
print.data.frame(x)
vv=vgm(model = "Tab",  covtable = 
	variogramLine(vgm(1, "Sph", 1), 1, n=1e4, min = 0, covariance = TRUE))

Run the code above in your browser using DataLab