rcosmo (version 1.1.2)

variofitCMB: Estimates parameters of variograms

Description

This function estimates variogram parameters by fitting a parametric model from covmodelCMB to a sample variogram. The function extends variofit from the package geoR to additional covariance models on spheres.

Usage

variofitCMB(vario, ini.cov.pars, cov.model, fix.nugget = FALSE,
  nugget = 0, fix.kappa = TRUE, kappa = 0.5, simul.number = NULL,
  max.dist = vario$max.dist, weights, minimisation.function,
  limits = geoR::pars.limits(), messages, ...)

Arguments

vario

An object of the class variogram obtained as an output of the function variogramCMB.

ini.cov.pars

A vector with initial values for the variogram parameters. The first parameter corresponds to the variance sigma^2. The second parameter corresponds to the range phi of the correlation function.

cov.model

A type of the variogram function. Available choices are: "matern", "exponential","spherical", "powered.exponential", "cauchy", "gencauchy", "pure.nugget", "askey", "c2wendland", "c4wendland", "sinepower", "multiquadric". The default is "matern"

fix.nugget

logical. Indicates whether the nugget variance should be regarded as fixed or be estimated. The default is FALSE.

nugget

A value for the nugget parameter. Regarded as a fixed values if fix.nugget = TRUE or as a initial value for the minimization algorithm if fix.nugget = FALSE. The default is zero.

fix.kappa

logical. Indicates whether the parameter kappa should be regarded as fixed or be estimated. The default is TRUE.

kappa

A value for the smoothness parameter. Regarded as a fixed values if fix.kappa = TRUE or as a initial value for the minimization algorithm if fix.kappa = FALSE. Required not in all covariance models, see covmodelCMB. The default is 0.5.

simul.number

number of simulation. Used if vario has empirical variograms for more than one data-set (simulations). The default is NULL

max.dist

A maximum distance to fit a variogram model. The default is x$max.dist.

weights

Weights used in the loss function in the minimization algorithm.

minimisation.function

Minimization function ("optim", "nlm", "nls") to estimate the parameters.

limits

Lower and upper limits for the model parameters used in the numerical minimisation by minimisation.function = "optim".

messages

logical. Indicates whether or not status messages are printed on the screen.

...

other minimisation parameters

Value

An object of the class variomodel and variofit, see variofit

Details

The parameter values of a variogram function from covmodelCMB are found by numerical optimization using one of the functions: optim, nlm and nls.

The function extends variofit from the package geoR to additional variogram models on spheres. Available models are: "matern", "exponential", "spherical", "powered.exponential", "cauchy", "gencauchy", "pure.nugget", "askey", "c2wendland", "c4wendland", "sinepower", "multiquadric".

Additionally it rescales an empirical variogram to the range [0,1] before numerical optimisation and then transforms all obtained results to the original scale. If ini.cov.pars are not provided then the 5x5 grid (seq(0,max(vario$v),l=5), seq(0,vario$max.dist,l=5)) of initial values of sigma^2 and phi is used.

References

geoR package, variofit, covmodelCMB

Examples

Run this code
# NOT RUN {
#
# df <- CMBDataFrame("../CMB_map_smica1024.fits")
# cmbdf <- sampleCMB(df, sample.size = 10000)
# varcmb <- variogramCMB(cmbdf, max.dist = 0.1, num.bins = 30)
# varcmb
#
# ols <- variofitCMB(varcmb,  fix.nug=FALSE, wei="equal", cov.model= "matern")
# plot(varcmb)
# lines(ols, lty=2)
# str(ols)
#
# ols <- variofitCMB(varcmb, fix.nug = TRUE, kappa = 3, wei = "equal",
# cov.model = "askey")
# plot(varcmb, main = ols$cov.model)
# linesCMB(ols, lty = 2)
# str(ols)

# }

Run the code above in your browser using DataCamp Workspace