gmGeostats (version 0.10-6)

predict.gmSpatialModel: Predict method for objects of class 'gmSpatialModel'

Description

This is a one-entry function for several spatial prediction and simulation methods, for model objects of class '>gmSpatialModel. The several methods are chosen by means of pars objects of the appropriate class.

Usage

# S3 method for gmSpatialModel
predict(object, newdata = NULL, pars = object@parameters, ...)

Arguments

object

a complete "gmSpatialModel", containing conditioning data and unconditional model

newdata

a collection of locations where a prediction/simulation is desired; this is typically a sp::SpatialPoints(), a data.frame or similar of X-Y(-Z) coordinates; or perhaps for gridded data an object of class sp::GridTopology(), sp::SpatialGrid() or sp::SpatialPixels()

pars

parameters describing the method to use, encloded in an object of appropriate class (see below)

...

further parameters for generic functionality, currently ignored

Value

Depending on the nature of newdata, the result will be a data container of the same kind, extended with the predictions or simulations. For instance, if we want to obtain predictions on the locations of a "SpatialPoints", the result will be a sp::SpatialPointsDataFrame(); if we want to obtain simulations on the coordinates provided by a "data.frame", the result will be a DataFrameStack() with the spatial coordinates stored as an extra attribute; or if the input for a simulation is a masked grid of class sp::SpatialPixels(), the result will be of class sp::SpatialPixelsDataFrame() which data slot will be a DataFrameStack.

Details

Package "gmGeostats" aims at providing a broad series of algorithms for geostatistical prediction and simulation. All can be accesses through this interface, provided that arguments object and pars are of the appropriate kind. In object, the most important criterion is the nature of its slot model. In pars its class counts: for the creation of informative parameters in the appropriate format and class, a series of accessory functions are provided as well.

Classical (gaussian-based two-point) geostatistics are obtained if object@model contains a covariance function, or a variogram model. Argument pars can be created with functions such as KrigingNeighbourhood(), SequentialSimulation(), TurningBands() or CholeskyDecomposition() to respectively trigger a cokriging, as sequential Gaussian simulation, a turning bands simulation, or a simulation via Cholesky decomposition. The kriging neighbourhood can as well be incorporated in the "gmSpatialModel" object directly, or even be nested in a "SequentialSimulation" parameter object.

Conversely, to run a multipoint geostatistics algorithm, the first condition is that object@model contains a training image. Additionally, pars must describe the characteristics of the algorithm to use. Currently, only direct sampling is available: it can be obtained by providing some parameter object created with a call to DirectSamplingParameters(). Currently it is also necessary that newdata is a gridded set of locations.

See Also

Other gmSpatialModel: as.gmSpatialModel(), gmSpatialModel-class, make.gmCompositionalGaussianSpatialModel(), make.gmCompositionalMPSSpatialModel(), make.gmMultivariateGaussianSpatialModel()