cocoOptim {cocons}R Documentation

Optimizer of nonstationary spatial models

Description

Estimation of the spatial model parameters based on the L-BFGS-B optimizer [1].

Usage

cocoOptim(coco.object, boundaries = list(), 
ncores = parallel::detectCores(), optim.control, optim.type)

Arguments

coco.object

(S4) a coco object.

boundaries

(list) if provided, a list with lower, init, and upper values, as the one provided by getBoundaries. Otherwise, it is computed based on getBoundaries with global lower and upper values -2 and 2.

ncores

(integer) number of threads for the optimization routine.

optim.control

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

optim.type

(character) Optimization approach: whether "mle" for classical Maximum Likelihood approach, or "pmle" to factor out the spatial trend (when handling "dense" coco objects), or to factor out the global marginal standard deviation parameter (when considering "sparse" coco objects).

Details

Current implementation only allows a single realization for "pmle" optim.type.

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))

plot(optim_coco)

print(optim_coco)

getEstims(optim_coco)

## End(Not run)


[Package cocons version 0.1.2 Index]