Description Usage Arguments Details Value Examples
Creator for the class "covANOVA"
.
1 2 3 4 5 6 7 8 9 10 |
k1Fun1 |
A kernel function of a scalar numeric variable, and possibly
of an extra "shape" parameter. This function can also return the
first-order derivative or the two-first order derivatives as an
attribute with name |
cov |
A character string specifying the value of the variance parameter δ for the covariance kernel. Contrarily to other kernel classes, that parameter is not equal to the variance. Thus, mind that choosing ( |
iso |
Integer. The value |
iso1 |
Integer. This applies only when |
hasGrad |
Integer or logical. Tells if the value returned by the function
|
inputs |
Character. Names of the inputs. |
d |
Integer. Number of inputs. |
parNames |
Names of the parameters. By default, ranges are prefixed
|
par |
Numeric values for the parameters. Can be |
parLower |
Numeric values for the lower bounds on the parameters. Can be
|
parUpper |
Numeric values for the upper bounds on the parameters. Can be
|
label |
A short description of the kernel object. |
... |
Other arguments passed to the method |
A ANOVA kernel on the d-dimensional Euclidean space takes the form
K(x1, x2) = δ^2 * prod_l (1 + τ[l]^2 k1(r[l])
where k1(r) is a suitable correlation kernel for a one-dimensional input, and r[l] is given by r[l] = (x2[l] - x2[l]) / θ[l] for l =1 to d.
In this default form, the ANOVA kernel depends on 2d + 1 parameters: the ranges θ[l] > 0, the variance ratios τ[l]^2, and the variance parameter δ^2.
An isotropic form uses the same range θ
for all inputs, i.e. sets θ[l]=θ for all l. This is obtained by
using iso = TRUE
.
A correlation version uses δ^2 =
1. This is obtained by using cov = "corr"
. Mind that it does not correspond to a correlation kernel. Indeed, in general, the variance is equal to
K(x, x) = δ^2 * prod_l (1 + τ[l]^2).
Finally, the correlation kernel k1(r) can depend on a "shape" parameter, e.g. have the form k1(r, α). The extra shape parameter α will be considered then as a parameter of the resulting ANOVA kernel, making it possible to estimate it by ML along with the range(s) and the variance.
An object with class "covANOVA"
.
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 26 27 | ## Not run:
if (require(DiceKriging)) {
## a 16-points factorial design and the corresponding response
d <- 2; n <- 16; x <- seq(from = 0.0, to = 1.0, length.out = 4)
X <- expand.grid(x1 = x, x2 = x)
y <- apply(X, 1, DiceKriging::branin)
## kriging model with matern5_2 covariance structure, constant
## trend. A crucial point is to set the upper bounds!
mycov <- covANOVA(k1Fun1 = k1Fun1Matern5_2, d = 2, cov = "homo")
coefUpper(mycov) <- c(2.0, 2.0, 5.0, 5.0, 1e10)
mygp <- gp(y ~ 1, data = data.frame(X, y),
cov = mycov, multistart = 100, noise = TRUE)
nGrid <- 50; xGrid <- seq(from = 0, to = 1, length.out = nGrid)
XGrid <- expand.grid(x1 = xGrid, x2 = xGrid)
yGrid <- apply(XGrid, 1, DiceKriging::branin)
pgp <- predict(mygp, XGrid)$mean
mykm <- km(design = X, response = y)
pkm <- predict(mykm, XGrid, "UK")$mean
c("km" = sqrt(mean((yGrid - pkm)^2)),
"gp" = sqrt(mean((yGrid - pgp)^2)))
}
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.