Learn R Programming

rcosmo (version 1.1.6)

linesCMB: Adds lines of fitted variograms to variogram plots

Description

This function adds a line with the variogram model fitted by the function variofitCMB to a current variogram plot. The function modifies lines.variomodel.variofit from the package geoR for additional covariance models on spheres.

Usage

linesCMB(x, max.dist, scaled = FALSE, ...)

Value

A line with a fitted variogram model is added to a plot.

Arguments

x

An object of the class variofit containing information about the fitted model obtained as an output of the function variofitCMB.

max.dist

A maximum distance to draw the variogram line. The default is x$max.dist.

scaled

logical. If TRUE the sill in the plot is 1.

...

other plotting parameters passed to curve

Details

The function adds a line with fitted variogram model to a plot. It is used to compare empirical variograms against fitted models returned by variofitCMB.

Available models are: "matern", "exponential", "spherical", "powered.exponential", "cauchy", "gencauchy", "pure.nugget", "askey", "c2wendland", "c4wendland", "sinepower", "multiquadric".

References

geoR package, lines.variomodel.variofit, covmodelCMB, variofitCMB

Examples

Run this code
set.seed(1)
cmbdf <- CMBDataFrame(nside = 8, I = rnorm(12 * 8^2), ordering = "nested")
varcmb <- variogramCMB(cmbdf, max.dist = pi/2, num.bins = 6)
ols <- variofitCMB(varcmb, ini.cov.pars = c(1, 0.5),
                   cov.model = "matern", weights = "equal", messages = FALSE)
plot(varcmb)
linesCMB(ols, lty = 2)

Run the code above in your browser using DataLab