Description Usage Arguments Value Author(s) Examples
View source: R/print_robinv_uncertainty_1d.R
Computes and can show two plots for functions with only one 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  print_robinv_uncertainty_1d(model, T, lower, upper, opt.index, inv.index,
control = NULL, onlycompute = FALSE, lwd = 1, 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 
lwd 
Line width 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.points: the value of the controlled parameters,
(ii) maxmk: array of the same size than all.points containing the maximum of the kriging mean taken w.r.t. the nuisance
parameters,
(iii) pn: array of the same size than all.points containing the excursion probability of the considered points (all.points),
(iv) uncertainty: scalar equal to mean(pn*(1pn))
giving a measure of the current global uncertainty on the excursion set,
(v) colors.transluded: the colors used to plot the points on the maximum of kriging mean plot.
Clement Chevalier [email protected]
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 54  library(KrigInv)
myfun < function(x) return(1 * branin_robinv(x))
d < 3
set.seed(8)
n0 < 30
T < 10
opt.index < c(2,3)
inv.index < c(1)
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(resolution = 100, n.optpoints = 300)
## Not run:
print_robinv_uncertainty_1d(model=model,T=T,lower=lower,upper=upper,
opt.index = opt.index,inv.index = inv.index,
control = control)
## End(Not run)
########################################
# A 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 < 60
T < 40
opt.index < c(2,3)
inv.index < c(1)
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,3,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)
# have a look at [email protected]@eta
control < list(resolution = 100, n.optpoints = 300, unscale.opt.simulation.points=TRUE)
## Not run:
print_robinv_uncertainty_1d(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.