Last data update: 2014.03.03

R: Print a measure of uncertainty for functions with dimension d...
print_uncertainty_ndR Documentation

Print a measure of uncertainty for functions with dimension d strictly higher than 2.

Description

This function draws projections on various plans of a given measure of uncertainty. Possible measures are "pn" (probability of excursion) and measures specific to a sampling criterion: "sur", "timse" and "imse". This function can be used to print relevant outputs after having used the function EGI.

Usage

print_uncertainty_nd(model,T,type="pn",lower=NULL,upper=NULL,
  		resolution=20, nintegpoints=400,main="",
			cex.main=1,cex.lab=1,cex.contourlab=1,cex.axis=1,
			nlevels=10,levels=NULL,
			xdecal=3,ydecal=3, option="mean")

Arguments

model

Kriging model of km class.

T

Target value (a real number). The sampling algorithm and the underlying kriging model aim to find the points below (resp. over) T.

type

Type of uncertainty that the user wants to print. Possible values are "pn" (probability of excursion), or "sur", "imse", "timse" if we print a measure of uncertainty corresponding to one criterion.

lower

Vector containing the lower bounds of the input domain. If nothing is set we use a vector of 0.

upper

Vector containing the upper bounds of the input domain. If nothing is set we use a vector of 1.

resolution

Number of points to discretize a plan included in the domain. For the moment, we cannot use values higher than 40.

nintegpoints

to do

main

Title of the graph.

cex.main

Multiplicative factor for the size of the title.

cex.lab

Multiplicative factor for the size of titles of the axis.

cex.contourlab

Multiplicative factor for the size of labels of the contour plot.

cex.axis

Multiplicative factor for the size of the axis graduations.

nlevels

Integer corresponding to the number of levels of the contour plot.

levels

Array: one can directly set the levels of the contour plot.

xdecal

Optional position shifting of the titles of the x axis.

ydecal

Optional position shifting of the titles of the y axis.

option

Optional argument (a string). The 3 possible values are "mean" (default), "max" and "min".

Value

the integrated uncertainty

Author(s)

Clement Chevalier (IMSV, Switzerland, and IRSN, France)

References

Bect J., Ginsbourger D., Li L., Picheny V., Vazquez E. (2010), Sequential design of computer experiments for the estimation of a probability of failure, Statistics and Computing, pp.1-21, 2011, http://arxiv.org/abs/1009.5177

See Also

EGI

Examples

#print_uncertainty_nd

set.seed(8)
N <- 25 #number of observations
T <- -1 #threshold
testfun <- hartman3
#The hartman3 function is defined over the domain [0,1]^3. 

hartman3(runif(3))

lower <- rep(0,times=3)
upper <- rep(1,times=3)

#a 9 points initial design (LHS in 3 dimensions)
design <- data.frame( matrix(runif(3*N),ncol=3) )
response <- apply(design,1,testfun)

#km object with matern3_2 covariance
#params estimated by ML from the observations
model <- km(formula=~., design = design, 
	response = response,covtype="matern3_2")

## Not run: 
print_uncertainty_nd(model=model,T=T,main="average probability of excursion",type="pn",
                    option="mean")

print_uncertainty_nd(model=model,T=T,main="maximum probability of excursion",type="pn",
                     option="max")


## End(Not run)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(KrigInv)
Loading required package: DiceKriging
Loading required package: pbivnorm
Loading required package: rgenoud
##  rgenoud (Version 5.7-12.4, Build Date: 2015-07-19)
##  See http://sekhon.berkeley.edu/rgenoud for additional documentation.
##  Please cite software as:
##   Walter Mebane, Jr. and Jasjeet S. Sekhon. 2011.
##   ``Genetic Optimization Using Derivatives: The rgenoud package for R.''
##   Journal of Statistical Software, 42(11): 1-26. 
##

Loading required package: randtoolbox
Loading required package: rngWELL
This is randtoolbox. For overview, type 'help("randtoolbox")'.
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/KrigInv/print_uncertainty_nd.Rd_%03d_medium.png", width=480, height=480)
> ### Name: print_uncertainty_nd
> ### Title: Print a measure of uncertainty for functions with dimension d
> ###   strictly higher than 2.
> ### Aliases: print_uncertainty_nd
> 
> ### ** Examples
> 
> #print_uncertainty_nd
> 
> set.seed(8)
> N <- 25 #number of observations
> T <- -1 #threshold
> testfun <- hartman3
> #The hartman3 function is defined over the domain [0,1]^3. 
> 
> hartman3(runif(3))
[1] -1.287198
> 
> lower <- rep(0,times=3)
> upper <- rep(1,times=3)
> 
> #a 9 points initial design (LHS in 3 dimensions)
> design <- data.frame( matrix(runif(3*N),ncol=3) )
> response <- apply(design,1,testfun)
> 
> #km object with matern3_2 covariance
> #params estimated by ML from the observations
> model <- km(formula=~., design = design, 
+ 	response = response,covtype="matern3_2")

optimisation start
------------------
* estimation method   : MLE 
* optimisation method : BFGS 
* analytical gradient : used
* trend model : ~X1 + X2 + X3
* covariance model : 
  - type :  matern3_2 
  - nugget : NO
  - parameters lower bounds :  1e-10 1e-10 1e-10 
  - parameters upper bounds :  1.952402 1.784364 1.95188 
  - best initial criterion value(s) :  -22.69578 

N = 3, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate     0  f=       22.696  |proj g|=       1.8913
At iterate     1  f =       21.386  |proj g|=        1.5955
At iterate     2  f =       21.255  |proj g|=        1.2957
At iterate     3  f =       20.956  |proj g|=        1.2889
At iterate     4  f =       20.887  |proj g|=        1.2605
At iterate     5  f =       20.537  |proj g|=        1.5537
At iterate     6  f =       19.944  |proj g|=        1.5342
At iterate     7  f =        19.92  |proj g|=        1.5313
At iterate     8  f =        19.43  |proj g|=        0.3019
At iterate     9  f =       19.428  |proj g|=       0.17732
At iterate    10  f =       19.428  |proj g|=      0.010546
At iterate    11  f =       19.428  |proj g|=    0.00016291
At iterate    12  f =       19.428  |proj g|=    3.3709e-07

iterations 12
function evaluations 16
segments explored during Cauchy searches 14
BFGS updates skipped 0
active bounds at final generalized Cauchy point 1
norm of the final projected gradient 3.37085e-07
final function value 19.4279

F = 19.4279
final  value 19.427939 
converged
> 
> ## Not run: 
> ##D print_uncertainty_nd(model=model,T=T,main="average probability of excursion",type="pn",
> ##D                     option="mean")
> ##D 
> ##D print_uncertainty_nd(model=model,T=T,main="maximum probability of excursion",type="pn",
> ##D                      option="max")
> ##D 
> ## End(Not run)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>