lines.variomodel: Adds a Line with a Variogram Model to a Variogram Plot

lines.variomodelR Documentation

Adds a Line with a Variogram Model to a Variogram Plot


This function adds a line with a variogram model specifyed by the user to a current variogram plot. The variogram is specifyed either by passing a list with values for the variogram elements or using each argument in the function.


## S3 method for class 'variomodel'
lines(x, ...)
## Default S3 method:
lines.variomodel(x, cov.model,, nugget, kappa,
                          max.dist, scaled = FALSE, ...)



a list with the values for the following components: cov.model,, nugget, kappa , max.dist; or a numeric vector with values for x-axis values for the variogram (distances). This argument is not required if the other arguments in the function are provided, otherwise is compulsory. If a list is provided the arguments which match the list elements are ignored.


a string with the type of the variogram function. See documentation of cov.spatial for further details.

a vector or matrix with the values for the partial sill (sigmasq) and range (phi) parameters.


a scalar with the value of the nugget (tausq) parameter.


a scalar with the value of the smoothness (kappa) parameters. Only required if cov.model is one of the following: "matern", "powered.exponential", "cauchy" and "gneiting.matern"


maximum distance (x-axis) to compute and draw the line representing the variogram model. If a list is provided in x the default is the distance given by x$max.dist. If a vector is provided in x it takes max(x).


logical. If TRUE the total sill in the plot is equals to 1.


arguments to be passed to the function curve.


Adds a line with a variogram model to a plot. In conjuction with plot.variogram can be used for instance to compare sample variograms against fitted models returned by variofit and/or likfit.


A line with a variogram model is added to a plot on the current graphics device. No values are returned.


Paulo Justiniano Ribeiro Jr.,
Peter J. Diggle


Further information on the package geoR can be found at:

See Also

lines.variomodel.krige.bayes, lines.variomodel.grf, lines.variomodel.variofit, lines.variomodel.likGRF, plot.variogram, lines.variogram, variofit, likfit, curve.


# computing and ploting empirical variogram
vario <- variog(s100, max.dist = 1)
# estimating parameters by weighted least squares
vario.wls <- variofit(vario, ini = c(1, .3), fix.nugget = TRUE)
# adding fitted model to the plot  
# Ploting different variogram models
plot(0:1, 0:1, type="n")
lines.variomodel(cov.model = "exp", = c(.7, .25), nug = 0.3, max.dist = 1) 
# an alternative way to do this is:
my.model <- list(cov.model = "exp", = c(.7, .25), nugget = 0.3,
max.dist = 1) 
lines.variomodel(my.model, lwd = 2)
# now adding another model
lines.variomodel(cov.m = "mat", cov.p = c(.7, .25), nug = 0.3,
                 max.dist = 1, kappa = 1, lty = 2)
# adding the so-called "nested" models
# two exponential structures
lines.variomodel(seq(0,1,l=101), cov.model="exp",
       ,0.15),c(0.4,0.25)), nug=0, col=2)
## exponential and spherical structures
lines.variomodel(seq(0,1,l=101), cov.model=c("exp", "sph"),
       ,0.15), c(0.4,0.75)), nug=0, col=3)

geoR documentation built on Aug. 9, 2022, 5:11 p.m.

Related to lines.variomodel in geoR...