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.
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,
...
)An object of the class variomodel and variofit, see
variofit
An object of the class variogram obtained as an output of
the function variogramCMB.
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.
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"
logical. Indicates whether the nugget variance should be regarded as fixed or be estimated. The default is FALSE.
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.
logical. Indicates whether the parameter kappa should be regarded as fixed or be estimated. The default is TRUE.
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.
number of simulation. Used if vario has empirical variograms
for more than one data-set (simulations). The default is NULL
A maximum distance to fit a variogram model. The default is
x$max.dist.
Weights used in the loss function in the minimization algorithm.
Minimization function ("optim", "nlm", "nls") to estimate the parameters.
Lower and upper limits for the model parameters used
in the numerical minimisation by minimisation.function = "optim".
logical. Indicates whether or not status messages are printed on the screen.
other minimisation parameters
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.
geoR package, variofit, covmodelCMB
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)
ols
Run the code above in your browser using DataLab