cocoSim {cocons}R Documentation

Marginal and conditional simulation of nonstationary Gaussian processes

Description

draw realizations of stationary and 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 or NULL) A vector of parameter values associated with model.list. If coco.object is a fitted object, and pars is NULL, it get pars from coco.object\@output$pars (and also sets 'type' to 'diff').

n

(integer) Number of realizations to simulate.

seed

(integer or NULL) Seed for random number generation. Defaults to NULL.

standardize

(logical) Indicates whether the provided covariates should be standardized (TRUE) or not (FALSE). Defaults to TRUE.

type

(character) Specifies whether the parameters follow a classical parameterization ('classic') or a difference parameterization ('diff'). Defaults to 'classic'. For sparse coco objects, only 'diff' is allowed.

sim.type

(character) If set to 'cond', a conditional simulation is performed.

cond.info

(list) A list containing additional information required for conditional simulation.

Details

The argument sim.type = 'cond' specifies a conditional simulation, requiring cond.info to be provided. cond.info is a list including newdataset, a data.frame containing covariates present in model.list at the simulation locations, and newlocs, a matrix specifying the locations corresponding to the simulation, with indexing that matches newdataset.

The argument type = 'classic' assumes a simplified parameterization for the covariance function, with log-parameterizations applied to the parameters std.dev, scale, and smooth.

Value

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

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.4 Index]