lines.variomodel | R Documentation |
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, cov.pars, nugget, kappa,
max.dist, scaled = FALSE, ...)
x |
a list with the values for the following components: |
cov.model |
a string with the type of the variogram function. See
documentation of |
cov.pars |
a vector or matrix with the values for the partial sill
( |
nugget |
a scalar with the value of the nugget
( |
kappa |
a scalar with the value of the smoothness
( |
max.dist |
maximum distance (x-axis) to compute and draw the line
representing the variogram model.
If a list is provided in |
scaled |
logical. If |
... |
arguments to be passed to the function
|
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. paulojus@leg.ufpr.br,
Peter J. Diggle p.diggle@lancaster.ac.uk.
Further information on the package geoR can be found at:
http://www.leg.ufpr.br/geoR/.
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)
plot(vario)
# estimating parameters by weighted least squares
vario.wls <- variofit(vario, ini = c(1, .3), fix.nugget = TRUE)
# adding fitted model to the plot
lines(vario.wls)
#
# Ploting different variogram models
plot(0:1, 0:1, type="n")
lines.variomodel(cov.model = "exp", cov.pars = c(.7, .25), nug = 0.3, max.dist = 1)
# an alternative way to do this is:
my.model <- list(cov.model = "exp", cov.pars = 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",
cov.pars=rbind(c(0.6,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"),
cov.pars=rbind(c(0.6,0.15), c(0.4,0.75)), nug=0, col=3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.