predict.km | R Documentation |
Overload the predict
method of the class "km"
of the
DiceKriging package in order make possible the computation
of derivatives.
## S3 method for class 'km' predict( object, newdata, type, se.compute = TRUE, cov.compute = FALSE, light.return = FALSE, bias.correct = FALSE, checkNames = TRUE, deriv = FALSE, ... )
object, newdata, type |
see
|
se.compute, cov.compute |
see
|
light.return, bias.correct |
see
|
checkNames |
see |
deriv |
Logical. If |
... |
Not used yet. |
When deriv
is TRUE
"Jacobian" arrays are returned
with the following rule. For a function
F(X) with a c(q,
d) matrix argument and a c(n, m) matrix value,
the Jacobian array has dimension c(n, m, q, d) and element
DF(X)[i, j, k, ell] = dF[i, j] / dX[k, ell].
This rule is compatible with the R arrays indexation
rule: if the function is considered as a function of a vector
argument as.vector(X)
with the vector value
as.vector(F(X))
, then by simply changing the dim
attribute of the Jacobian matrix, we get the Jacobian array as
described.
A list with the elements of predict.km
plus the following elements that relate to the derivatives w.r.t. the input
trend.deriv
Derivative of the trend component. This is an array with dimension
c(nNew, nNew, d).
mean.deriv
, s2.deriv
Derivatives of the kriging mean and kriging variance. These are
arrays with dimension c(nNew, nNew, d).
cov.deriv
Derivative of the kriging covariance. This is a
four-dimensional array with dimension
c(nNew, nNew, nNew, d).
XXXY remettre "method predict km" dans le roxygen
## a 16-points factorial design, and the corresponding response d <- 2; n <- 16 X <- expand.grid(x1 = seq(0, 1, length = 4), x2 = seq(0, 1, length = 4)) y <- apply(X, MARGIN = 1, FUN = branin) ## kriging model 1 : gaussian covariance structure, no trend, ## no nugget effect myKm <- km(~1 + x1 + x2, design = X, response = y, covtype = "gauss") ## predicting at new points XNew <- expand.grid(x1 = s <- seq(0, 1, length = 15), x2 = s) pred <- predict(myKm, newdata = XNew[10, ], type = "UK", deriv = TRUE) newdata <- XNew[10, ] c.newdata <- covMat1Mat2(object = myKm@covariance, X1 = myKm@X, X2 = matrix(newdata, nrow = 1), nugget.flag = myKm@covariance@nugget.flag) covVector.dx(x = newdata, X = myKm@X, object = myKm@covariance, c = c.newdata) trend.deltax(x = newdata, model = myKm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.