Description Usage Arguments Value Author(s) Examples
View source: R/print_robinv_uncertainty_2d.R
Computes and can show two plots for functions with two controlled parameters and one or several nuisance parameters. One plot is the maximum of the kriging mean (taken w.r.t. the nuisance parameters) computed on a grid of controlled parameter values. The second plot is the excursion probability, pn, which is computed using conditional simulations.
1 2 3 4 5 6 7 | print_robinv_uncertainty_2d(model, T, lower, upper, opt.index, inv.index,
control = NULL, onlycompute = FALSE, cex.contourlab = 0.6,
cex.main = 1, cex.axis = 1, cex.lab = 1, cex.points = 1,
pch.points = 17, color.up = "red", color.down = "blue",
maxmkplot = TRUE, xlab1 = NULL, ylab1 = NULL, main1 = NULL,
pnplot = TRUE, xlab2 = NULL, ylab2 = NULL, main2 = NULL,
newpar = TRUE)
|
model |
The current kriging model. km object. |
T |
Target threshold. |
lower |
Array of size d. Lower bound of the input domain. |
upper |
Array of size d. Upper bound of the input domain. |
opt.index |
Array with integers corresponding to the indices of the nuisance parameters. |
inv.index |
Array with integers corresponding to the indices of the controlled parameters. |
control |
A list with fields that will control how the different quantities involved are computed.
|
onlycompute |
Boolean. When FALSE, no plot is performed, but the maximum of the kriging mean (resp. the excursion probability pn)
is still computed if |
cex.contourlab |
Size of the contour labels for the different plots involved in this function. |
cex.main |
Title size for the different plots involved in this function. |
cex.axis |
Axis label size for the different plots involved in this function. |
cex.lab |
Label size for the different plots involved in this function. |
cex.points |
Point size for the maximum kriging mean plot. Useless if |
pch.points |
Point pch for the maximum kriging mean plot. Useless if |
color.up |
Color of the points where there is threshold exceedance. Useless if |
color.down |
Color of the points where there is no threshold exceedance. Useless if |
maxmkplot |
Boolean. When TRUE, the maximum of the kriging mean (taken w.r.t. the nuisance parameters) is
computed. It is also ploted if |
xlab1 |
x axis label for the maximum of the kriging mean plot. |
ylab1 |
y axis label for the maximum of the kriging mean plot. |
main1 |
Title of the maximum of the kriging mean plot. |
pnplot |
Boolean. When TRUE, the excursion probability function, pn, is computed.
It is also ploted if |
xlab2 |
x axis label for the excursion probability plot. |
ylab2 |
y axis label for the excursion probability plot. |
main2 |
Title of the excursion probability plot. |
newpar |
Boolean. When TRUE, the par() function is called. Usefull only if the two plots available in this function are both performed. |
A list containing the important computed quantities:
(i) all.points1: the coordinates of the points (in the space of the controlled parameters) used for the maximum kriging mean plot,
(ii) maxmk: Square matrix of size control$resolution1
containing the maximum of the kriging mean taken w.r.t. the nuisance
parameters,
(iii) all.points2 : the coordinates of the points (in the space of the controlled parameters) used for the excursion probability plot,
(iv) pn: Square matrix of size control$resolution2
containing the excursion probability of the considered points (all.points),
(v) uncertainty: scalar equal to mean(pn*(1-pn))
giving a measure of the current global uncertainty on the excursion set,
(vi) colors.transluded: the colors used to plot the points on the maximum of kriging mean plot.
Clement Chevalier clement.chevalier@unine.ch
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | library(KrigInv)
myfun <- function(x) return(-1 * branin_robinv(x))
d <- 3
set.seed(8)
n0 <- 30
T <- -10
opt.index <- c(3)
inv.index <- c(1,2)
lower <- rep(0,times=d)
upper <- rep(1,times=d)
design <- matrix(runif(d*n0),nrow=n0)
response <- myfun(design)
model <- km(formula = ~1,design = design,response = response,covtype = "matern3_2")
control <- list(resolution1 = 40, resolution2 = 20)
## Not run:
print_robinv_uncertainty_2d(model=model,T=T,lower=lower,upper=upper,
opt.index = opt.index,inv.index = inv.index,
control = control)
## End(Not run)
######################################
# More complicated example with scaling
library(KrigInv)
myfun <- function(x){ return(-1*branin_robinv(x) - 50*sin(min(100,1/x[3])) ) }
d <- 3
set.seed(8)
n0 <- 100
T <- 40
opt.index <- c(3)
inv.index <- c(1,2)
lower <- rep(0,times=d)
upper <- rep(1,times=d)
design <- matrix(runif(d*n0),nrow=n0)
response <- apply(X = design,FUN = myfun,MARGIN = 1)
knots.number <- c(0,0,3)
knots <- generate_knots(knots.number = knots.number , d = d)
model <- km(formula = ~1,design = design,response = response,covtype = "matern3_2",scaling = TRUE,knots=knots)
control <- list(resolution1 = 40, resolution2 = 20 , unscale.opt.simulation.points = TRUE)
## Not run:
print_robinv_uncertainty_2d(model=model,T=T,lower=lower,upper=upper,
opt.index = opt.index,inv.index = inv.index,
control = control)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.