cocoOptim {cocons}R Documentation

Optimizer for coco objects

Description

Estimation the spatial model parameters using the L-BFGS-B optimizer [1].

Usage

cocoOptim(coco.object, boundaries = list(), ncores = "auto", safe = TRUE,
optim.type, optim.control)

Arguments

coco.object

(S4) A coco object.

boundaries

(list) If provided, a list containing lower, initial, and upper values for the parameters, as defined by getBoundaries. If not provided, these values are automatically computed with global lower and upper bounds set to -2 and 2.

ncores

(character or integer) The number of threads to use for the optimization. If set to "auto", the number of threads is chosen based on system capabilities or a fraction of the available cores.

safe

(logical) If TRUE, the function avoids Cholesky decomposition errors due to ill-posed covariance matrices by returning a pre-defined large value. Defaults to TRUE.

  • "ml": Classical Maximum Likelihood estimation.

  • "pml": Profile Maximum Likelihood, factoring out the spatial trend for dense objects or the global marginal variance parameter for sparse objects.

optim.type

(character) The optimization approach. Options include:

optim.control

(list) A list of settings to be passed to the optimParallel function [2].

Value

(S4) An optimized S4 object of class coco.

Author(s)

Federico Blasi

References

[1] Byrd, Richard H., et al. "A limited memory algorithm for bound constrained optimization." SIAM Journal on scientific computing 16.5 (1995): 1190-1208.

[2] Gerber, Florian, and Reinhard Furrer. "optimParallel: An R package providing a parallel version of the L-BFGS-B optimization method." R Journal 11.1 (2019): 352-358.

See Also

[optimParallel]

Examples

## Not run: 
model.list <- list('mean' = 0,
                   'std.dev' = formula( ~ 1 + cov_x + cov_y),
                   'scale' = formula( ~ 1 + cov_x + cov_y),
                   'aniso' = 0,
                   'tilt' = 0,
                   'smooth' = 3/2,
                   'nugget' = -Inf)
                   
coco_object <- coco(type = 'dense',
                    data = holes[[1]][1:100,],
                    locs = as.matrix(holes[[1]][1:100,1:2]),
                    z = holes[[1]][1:100,]$z,
                    model.list = model.list)
                    
optim_coco <- cocoOptim(coco_object,
boundaries = getBoundaries(coco_object,
lower.value = -3, 3))

plotOptimInfo(optim_coco)

plot(optim_coco)

plot(optim_coco, type = 'ellipse')

plot(optim_coco, type = 'correlations', index = c(2,3,5))

summary(optim_coco)
 
getEstims(optim_coco)


## End(Not run)


[Package cocons version 0.1.4 Index]