Learn R Programming

RandomFields (version 3.0.5)

RMuser: User Defined Function

Description

RMuser allows for a user defined covariance function, variogram model, or arbitrary function

Usage

RMuser(type, domain, isotropy, vdim, beta, fctn, fst, snd, envir,
 var, scale, Aniso, proj)

Arguments

type, domain, isotropy, vdim
beta
a fixed matrix that is multiplied to the return value of the given function; the dimension must match. Defining a vector valued function and beta as a vector, an arbitrary linear model can be defined. Estimation of beta
envir
the environment where the given function shall be evaluated
fctn, fst, snd
a user defined function and its first, second and third derivative, given as quote(myfunction(x)) or as quote(myfunction(x, y)), see Details an Examples below.
var,scale,Aniso,proj
optional parameters; same meaning for any RMmodel. If not passed, the above covariance function remains unmodified.

Value

See Also

RMmodel, RMmodelgenerator RFsimulate, RFfit.

Examples

Run this code
set.seed(0)
## Alternatively to 'model <- RMexp()' one may define the following
## (which is, however, much slower and cannot use all features of
## RandomFields)

RFoptions(storing = FALSE)

model <- RMuser(type="positive definit", domain="single variable",
                iso="isotropic", fctn=exp(-x))
x <- y <- seq(1, 10, len=10^(1+interactive()))
plot(model)
z <- RFsimulate(RPcirculant(model), x=x, y=y, grid=TRUE)
plot(z)model <- RMnugget(var=1e-5) +
         RMuser(type="positive definit", domain="kernel",
                iso="symmetric", fctn=sum(x * y))
x <- y <- seq(1, 10, len=7^(1+interactive()))
z <- RFsimulate(model, x=x, y=y, grid=TRUE, n=6)
plot(z)

Run the code above in your browser using DataLab