| branin_with_grad | R Documentation |
Branin function with its exact gradient returned into a list.
branin_with_grad(x)
x |
A vector with length d = 2. |
A list with two numeric elements named objective
and gradient corresponding to the function value
(length 1) and its gradient (length 2).
branin.
X <- matrix(runif(100), ncol = 2, dimnames = list(NULL, c("x1", "x2")))
Obj <- apply(X, 1, function(x) branin_with_grad(x)$objective)
ObjDK <- apply(X, 1, DiceKriging::branin)
max(abs(Obj - ObjDK))
Grad <- t(apply(X, 1, function(x) branin_with_grad(x)$gradient))
GradNum <- t(apply(X, 1, function(x) grad(DiceKriging::branin, x)))
max(abs(Grad - GradNum))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.