Description Usage Arguments Details Value Note See Also Examples
View source: R/RMmodelsSpecial.R
RMuser
allows for a user-defined covariance function, variogram
model, or arbitrary function.
RMuser is very slow – users should avoid this model whenever possible.
1 2 3 |
type |
See Default: |
domain |
See Default: |
isotropy |
See
Default:
|
vdim |
multivariability. Default: |
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 |
coordnames |
Just the names of the variables. More variable names might be given here than used in the function. See Details for the interpretation of variables. |
fctn, fst, snd |
a user-defined function and its first,
second and third derivative, given as
|
envir |
the environment where the given function shall be evaluated |
var,scale,Aniso,proj |
optional arguments; same meaning for any
|
Primarily, a function is expected that depends on a vector whose components, x, y, z, T, are given separately as scalar quantities.
Alternatively, the function might depend only on the first argument
given by coordnames
.
A kernel should depend on the first two arguments
given by coordnames
.
RMuser
returns an object of class
RMmodel
.
The use of RMuser
is completely on the risk of the
user. There is no
way to check whether the expressions of the user are
correct in any sense.
Note that x
, y
, z
and T
are reserved
argument names that define solely the coordinates.
Hence, none of these names might be used for
other arguments within these functions.
In user-defined functions, the models of RandomFields are not recognized, so they cannot be included in the function definitions.
RMuser
may not be used in connection with obsolete
commands of RandomFields.
RMcovariate
,
RMfixcov
,
RFfit
,
RMmodelgenerator
,
RMmodel
,
RFsimulate
,
RC_ISO_NAMES, RC_DOMAIN_NAMES.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | RFoptions(seed=0) ## *ANY* simulation will have the random seed 0; set
## RFoptions(seed=NA) to make them all random again
## Alternatively to 'model <- RMexp()' one may define the following
## (which is, however, much slower and cannot use all features of
## RandomFields)
## user-defined exponential covariance model
model <- RMuser(type="positive definite", domain="single variable",
iso="isotropic", fctn=exp(-x))
x <- y <- seq(1, 10, len=100)
plot(model)
z <- RFsimulate(model, x=x, y=y)
plot(z)
## the kernel, which is the scalar product (see RMprod)
model <- RMnugget(var=1e-5) +
RMuser(type="positive definite", domain="kernel",
iso="symmetric", fctn=sum(x * y))
x <- y <- seq(1, 10, len=35)
z <- RFsimulate(model, x=x, y=y, n=6, svdtol=1e-9)
plot(z)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.