cocoPredict {cocons} | R Documentation |
Computes the point predictions and standard errors based on conditional Gaussian distributions.
cocoPredict(coco.object, newdataset, newlocs, type = 'mean', ...)
coco.object |
( |
newdataset |
( |
newlocs |
( |
type |
( |
... |
( |
(list
) a list with the conditional mean, splitted into the systematic large-scale variability trend
,
and due to stochastic mean
, as well as standard errors "sd.pred"
if "pred"
is specified.
Federico Blasi
## 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))
coco_preds <- cocoPredict(optim_coco, newdataset = holes[[2]],
newlocs = as.matrix(holes[[2]][, 1:2]),
type = "pred")
coco_preds
par(mfrow = c(1, 2))
fields::quilt.plot(main = "mean", holes[[2]][, 1:2],
coco_preds$mean, xlim = c(-1, 1), ylim = c(-1, 1))
fields::quilt.plot(main = "se", holes[[2]][, 1:2],
coco_preds$sd.pred, xlim = c(-1, 1), ylim = c(-1, 1))
# Re-do it without considering cov_x and cov_y in the std.dev and scale and compare.
## End(Not run)