cocoSim {cocons}R Documentation

Marginal and conditional simulation of nonstationary Gaussian process

Description

draw realizations of nonstationary Gaussian processes with covariate-based covariance functions.

Usage

cocoSim(coco.object, pars, n, seed, standardize, 
type = 'classic', sim.type = NULL, cond.info = NULL)

Arguments

coco.object

(S4) a coco object.

pars

(numeric vector) a vector of parameters values related to model.list.

n

(integer) number of realizations to simulate.

seed

(integer or NULL) seed number. default set to NULL.

standardize

(TRUE/FALSE) logical argument describing whether provided covariates should be standardize (TRUE) or not (FALSE). By default set to TRUE.

type

(character) whether parameters are related to a classical parameterization ('classic') or a difference parameterization 'diff'. Default set to 'classic'. For 'sparse' coco objects, only 'diff' is available.

sim.type

(character) if set 'cond' then a conditional simulation takes place.

cond.info

(list) a list containing added information to perform conditional simulation.

Details

'cond' sim.type requires specifying in 'cond.info' a list with 'newdataset' a data.frame containing covariates present in model.list at simulation locations, and 'newlocs' a matrix with locations related to the simulation locations, matching indexing of 'newdataset'.

type = 'classic' assumes a simpler parameterization for the covariance function, assuming log-parameterizations for 'std.dev', 'scale', and 'smooth'.

Value

(matrix) a matrix n x dim(data)[1].

Author(s)

Federico Blasi

See Also

coco()

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' = 0.5,
                   'nugget' = -Inf)
                   
coco_object <- coco(type = 'dense',
                    data = holes[[1]][1:1000,],
                    locs = as.matrix(holes[[1]][1:1000,1:2]),
                    z = holes[[1]][1:1000,]$z,
                    model.list = model.list)
                    
coco_sim <- cocoSim(coco.object = coco_object,
            pars = c(0,0.25,0.25,  # pars related to std.dev
            log(0.25),1,-1),       # pars related to scale
            n = 1, 
            standardize = TRUE) 

fields::quilt.plot(coco_object@locs,coco_sim)             

## End(Not run)


[Package cocons version 0.1.2 Index]