mobKriging: Recursive Partitioning of Kriging Models

Description Usage Arguments Details Value Examples

Description

Interface function for recursive partitioning of Kriging models.

Usage

1
mobKriging(obj, part, feat, data, control = mob_control(), km.args = list())

Arguments

obj

[formula | character(1)]
Either the fitting formula or the name of the target variable. The formula looks like y ~ x1 + ... + xk | z1 + .... zl. z1 to zl are the partitioning variables (probably categorical, but numerical ones can be in included, too), while x1 to xk are the numerical variables for the kriging models in the terminal nodes of the tree.

part

[character]
The names of the partitioning variables (z1 to zl) for the tree structure. Ignored if obj is a formula.

feat

[character]
The names of the numeric modeling features (x1 to xk) passed to the kriging models in the terminal nodes. Ignored if obj is a formula.

data

[data.frame]
Data to fit the model.

control

[list]
Passed to control in mob (see also mob_control).

km.args

[list]
Further arguments passed to km. Note that arguments design and reponse must not be included.

Details

mobKriging is an interface to function mob with fixed argument model = kmModel that avoids name clashes between arguments of mob and km. (For example, both, km and mob, have arguments called formula and control.)

The formula argument of km which specifies the linear trend of the kriging model must only contain the modeling features (x1 to xk). It can be passed to km via the km.args argument, see the examples.

Value

An object of class mob inheriting from BinaryTree. Every node of the tree is associated with a fitted Kriging model.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if (require(DiceKriging)) {
    d <- 2L
    x <- seq(0, 1, length = 10L)
    design <- expand.grid(x1 = x, x2 = x)
    y <- apply(design, 1, branin)
    df <- data.frame(y = y, design)

    ## no trend (formula = ~ 1)
    m <- mobKriging(y ~ x1 + x2 | x1 + x2, data = df,
        control = mob_control(verbose = TRUE))

    ## linear trend using all modeling features (formula = ~ .)
    m <- mobKriging(y ~ x1 + x2 | x1 + x2, data = df,
        km.args = list(formula = ~ ., control = list(trace = FALSE)),
        control = mob_control(minsplit = 30L, verbose = FALSE))

    ## linear trend using all modeling features (formula = ~ .)
    m <- mobKriging(obj = "y", feat = c("x1", "x2"), part = c("x1", "x2"), data = df,
        km.args = list(formula = ~ ., control = list(trace = FALSE)),
        control = mob_control(verbose = FALSE, parm = 1:4))

   coef(m)
   # logLik(m)
   # residuals(m)
}

schiffner/mobKriging documentation built on May 29, 2019, 3:39 p.m.