estimate
estimates the parameters of a
geostatistical linear model of class geolm_cmodStd
using maximum likelihood estimation.
# S3 method for geolm_cmodStd
estimate(
object,
reml = FALSE,
noise_type = "e",
lower = NULL,
upper = NULL,
method = "nlminb",
itnmax = NULL,
control = list(),
est_nugget = TRUE,
est_par3 = TRUE,
est_angle = FALSE,
est_ratio = FALSE,
verbose = FALSE,
...
)
A geostatistical linear model object
produced by the geolm
function.
A logical value indicating whether standard
maximum likelihood estimation should be performed
(reml = FALSE
). If reml = TRUE
, then
restricted maximum likelihood estimation is performed. The
default is FALSE
.
A character vector indicating the type
of noise (nugget) variance to estimate. The default is
est = "e"
, indicating the error variance should
be estimated. Alternatively, the user can specify
est = "f"
, indicating that the finescale (microscale)
variance should be estimated. The other type of noise
variance is set to 0, otherwise the model is not
identifiable. See Details.
A named list with the names of the parameters you wish to set lower bounds for and the associated value. See Details.
A named list with the names of the parameters you wish to set upper bounds for and the associated value.
The optimization method. The default is
"nlminb"
. "L-BFGS-B"
is another
acceptable choice. See optimx
for further choices.
An integer indicating the maximum number of iterations to allow for the optimization procedure.
A list of control parameters passed
internally to optimx
.
A logical value indicating whether the
nugget variance (evar
or fvar
) should be
estimated. The default is TRUE
, indicating that
the nugget should be estimated.
A logical value indicating whether
par3
should be estimated (for an appropriate
covariance model such as "matern"
or
"amatern"
). The default is TRUE
,
indicating that this parameter should be estimated.
A logical value indicating whether the
geometric anisotropy angle should be estimated. The
default is FALSE
, indicating that this parameter
should not be estimated.
A logical value indicating whether the
geometric anisotropy ratio of minor axis length to
major axis length should be estimated. The default is
FALSE
, indicating that this parameter should not
be estimated.
A logical value indicating whether
potentially informative messages should be printed. The
default is FALSE
.
Currently unimplemented
The optimx
function is used to find
the MLEs. The control
argument of
optimx
has a parameter kkt
related to checking optimality conditions. This is
internally set to FALSE
. See
optimx
for Details.
Only the sum of evar
and fvar
is
identifiable. Depending on the choice of
noise_type
, the covariance model is internally
updated to estimate only one type of noise. e.g., if
noise_type = "e"
, then internally we update
evar
so that evar = evar + fvar
and
fvar = 0
. Estimation is then performed on
evar
alone. Alternatively, the analagous estimated
would be made for fvar
if noise_type =
"fvar"
.
When est_nugget
is true, the likelihood is
profiled to simplify the optimization problem. In that
case a parameter lambda = (evar + fvar)/psill
is
optimized. The optimal psill
and noise variance
are then determined.
The lower
argument should be a named list with the
names of the parameters you wish to set lower bounds for.
If not specified, an attempt is made to specify
reasonable lower bounds. The current choices are r
= 0.001
, psill = 0.001
, lambda = 0
,
angle = 0
, ratio = 0.001
, par3 =
0.001
.
The upper
argument should be a named list with the
names of the parameters you wish to set upper bounds for.
If not specified, an attempt is made to specify
reasonable upper bounds. The current choices are r
= 5 *
maximum intercentroid distance, psill = 5 *
var(object$y)
, lambda = 5
, angle = 179.99
,
ratio = 1
, par3 = 3
.
# NOT RUN {
data(toydata, package = "gear")
# setup standard covariance model
mod_std = cmod_std("exponential", psill = 1, r = 1, evar = 0.1)
# setup dataframe with data
# fit Std geolm
object = geolm(y ~ x1 + x2, data = toydata, mod = mod_std,
coordnames = c("x1", "x2"))
est_object = estimate(object, control = list(trace = 1),
verbose = TRUE,
lower = list(r = 0.05, lambda = 0.05))
# }
Run the code above in your browser using DataLab