gmGeostats (version 0.11.3)

as.function.gmCgram: Convert a gmCgram object to an (evaluable) function

Description

Evaluate a gmCgram on some h values, or convert the gmCgram object into an evaluable function

Usage

# S3 method for gmCgram
as.function(x, ...)

# S3 method for gmCgram predict(object, newdata, ...)

Value

a function that can be evaluated normally, with an argument X

and possibly another argument Y; both must have the same number of columns than the geographic dimension of the variogram (i.e. dim(x$M)[3]).

Arguments

x

a gmCgram object

...

extra arguments for generic functionality

object

gmCgram object

newdata

matrix, data.frame or Spatial object containing coordinates

Functions

  • predict.gmCgram: predict a gmCgram object on some lag vector coordinates

See Also

Other gmCgram functions: [.gmCgram(), [[.gmCgram(), as.gmCgram.variogramModelList(), length.gmCgram(), ndirections(), plot.gmCgram(), variogramModelPlot()

Examples

Run this code
utils::data("variogramModels")
v1 = setCgram(type=vg.Gau, sill=diag(2)+0.5, anisRanges = 2*diag(c(3,0.5)))
v2 = setCgram(type=vg.Exp, sill=0.3*diag(2), anisRanges = 0.5*diag(2))
vm = v1+v2
vgf = as.function(vm)
(h = rbind(c(0,1), c(0,0), c(1,1)))
vgf(h)
predict(vm, h)

Run the code above in your browser using DataLab