Learn R Programming

geoRglm (version 0.9-16)

lines.covariomodel: Line with a Covariogram Model

Description

This function adds a theoretical covariogram to the current plot. The covariogram model to be added is typically with parameters estimated from the data.

Usage

# S3 method for covariomodel
lines(x, max.dist = x$max.dist, …)

Arguments

x

an object of the class covariomodel which is a list containing information about the model parameters.

max.dist

maximum distance (x-axis) to compute and draw the line representing the covariogram model. The default is the distance given by x$max.dist.

arguments to be passed to the function lines.

Value

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

Details

Allows theoretical covariogram(s) to be added to a plot. Together with plot.covariogram can be used to compare sample covariograms against fitted models.

See Also

plot.covariogram, lines.

Examples

Run this code
# NOT RUN {
sim <- grf(100, cov.pars = c(0.1, 0.2))
sim$data <- rpois(100, lambda = exp(sim$data+1))
# data generated from the poisson-log normal model
covario <- covariog(sim, max.dist = 1)  # sample covariogram
plot(covario)                      
parmval <- list(cov.model = "exponential", cov.pars = c(0.1, 0.1), 
                max.dist = 1, nugget = 0.01)
class(parmval) <- "covariomodel"
lines(parmval, lty = 2)
# }

Run the code above in your browser using DataLab