Learn R Programming

DiceKriging (version 1.6.0)

kmData: Fit and/or create kriging models

Description

kmData is equivalent to km, except for the interface with the data. In kmData, the user must supply both the design and the response within a single data.frame data. To supply them separately, use km.

Usage

kmData(formula, data, inputnames = NULL, ...)

Arguments

formula

an object of class "formula" specifying the linear trend of the kriging model (see lm). At this stage, transformations of the response are not taken into account.

data

a data.frame containing both the design (input variables) and the response (1-dimensional output given by the objective function at the design points).

inputnames

an optional vector of character containing the names of variables in data to be considered as input variables. By default, all variables but the response are input variables.

other arguments for creating or fitting Kriging models, to be taken among the arguments of km function apart from design and response.

Value

An object of class km (see km-class).

See Also

km

Examples

Run this code
# NOT RUN {
# a 16-points factorial design, and the corresponding response
d <- 2; n <- 16
design.fact <- expand.grid(x1=seq(0,1,length=4), x2=seq(0,1,length=4))
y <- apply(design.fact, 1, branin)
data <- cbind(design.fact, y=y)

# kriging model 1 : matern5_2 covariance structure, no trend, no nugget effect
m1 <- kmData(y~1, data=data)
# this is equivalent to: m1 <- km(design=design.fact, response=y)

# now, add a second response to data:
data2 <- cbind(data, y2=-y)
# the previous model is now obtained with:
m1_2 <- kmData(y~1, data=data2, inputnames=c("x1", "x2"))

# }

Run the code above in your browser using DataLab