obliqueProf_UQ: Oblique profiles UQ from a kriging model

Description Usage Arguments Value Author(s) Examples

View source: R/obliqueProf_UQ.R

Description

The function obliqueProf_UQ computes the profile extrema functions for posterior realizations of a Gaussian process and its confidence bounds

Usage

1
2
3
4
5
obliqueProf_UQ(object, allPsi, threshold, allResMean = NULL,
  quantiles_uq = c(0.05, 0.95), options_approx = NULL,
  options_full_sims = NULL, options_sims = NULL,
  options_bound = NULL, plot_level = 0, plot_options = NULL,
  return_level = 1)

Arguments

object

either a km model or a list containing partial results. If object is a km model then all computations are carried out. If object is a list, then the function carries out all computations to complete the results list.

allPsi

a list containing the matrices Psi (dim pxd) for which to compute the profile extrema

threshold

the threshold of interest

allResMean

a list resulting from getProfileExtrema or approxProfileExtrema for the profile extrema on the mean. If NULL the median from the observations is plotted

quantiles_uq

a vector containing the quantiles to be computed

options_approx

an optional list of options for approxProfileExtrema, see approxProfileExtrema for details.

options_full_sims

an optional list of options for getProfileExtrema, see getProfileExtrema for details. If NULL the full computations are not executed. NOTE: this computations might be very expensive!

options_sims

an optional list of options for the posterior simulations.

  • algorithm: string choice of the algorithm to select the pilot points ("A" or "B", default "B");

  • lower: d dimensional vector with lower bounds for pilot points, default rep(0,d);

  • upper: d dimensional vector with upper bounds for pilot points, default rep(1,d);

  • batchsize: number of pilot points, default 120;

  • optimcontrol: list containing the options for optimization, see optim_dist_measure;

  • integcontrol: list containing the options for numerical integration of the criterion, see optim_dist_measure;

  • integration.param: list containing the integration design, obtained with the function integration_design;

  • nsim: number of approximate GP simulations, default 300.

options_bound

an optional list containing beta the confidence level for the approximation and alpha the confidence level for the bound. Note that alpha > 2*beta. If NULL, the bound is not computed.

plot_level

an integer to select the plots to return (0=no plots, 1=basic plots, 2= all plots)

plot_options

an optional list of parameters for plots. See setPlotOptions for currently available options.

return_level

an integer to select the amount of details returned

Value

If return_level=1 a list containing

if return_level=2 the same list as above but also including more: a list containing

Author(s)

Dario Azzimonti

Examples

 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
if (!requireNamespace("DiceKriging", quietly = TRUE)) {
stop("DiceKriging needed for this example to work. Please install it.",
     call. = FALSE)
}
# Compute a kriging model from 50 evaluations of the Branin function
# Define the function
g<-function(x){
  return(-branin(x))
}
gp_des<-lhs::maximinLHS(20,2)
reals<-apply(gp_des,1,g)
kmModel<-km(design = gp_des,response = reals,covtype = "matern3_2")

threshold=-10
d<-2

# Compute oblique profiles UQ starting from GP model
# define simulation options
options_sims<-list(algorithm="B", lower=rep(0,d), upper=rep(1,d),
                   batchsize=80, optimcontrol = list(method="genoud",pop.size=100,print.level=0),
                   integcontrol = list(distrib="sobol",n.points=1000), nsim=150)
# define approximation options
options_approx<- list(multistart=4,heavyReturn=TRUE,
                      initDesign=NULL,fullDesignSize=100,
                      smoother=NULL)
# define plot options
options_plots<-list(save=FALSE, titleProf = "Coordinate profiles",
                    title2d = "Posterior mean",qq_fill=TRUE)

# Define the oblique directions
# (for theta=0 it is equal to coordinateProfiles)
theta=pi/4
allPsi = list(Psi1=matrix(c(cos(theta),sin(theta)),ncol=2),
              Psi2=matrix(c(cos(theta+pi/2),sin(theta+pi/2)),ncol=2))
## Not run: 
# here we reduce the number of simulations to speed up the example
# a higher number should be used
options_sims$nsim <- 50

# profile UQ on approximate oblique profiles
oProfiles_UQ<-obliqueProf_UQ(object = kmModel,threshold = threshold,allPsi=allPsi,
                             allResMean = NULL,quantiles_uq = c(0.05,0.95),
                             options_approx = options_approx, options_full_sims = NULL,
                             options_sims = options_sims,options_bound = NULL,
                             plot_level = 3, plot_options = options_plots,return_level = 3)
# profile UQ on full optim oblique profiles

options_full_sims<-list(multistart=4,heavyReturn=TRUE)
oProfiles_UQ_full<- obliqueProf_UQ(object = oProfiles_UQ,threshold = threshold,allPsi=allPsi,
                             allResMean = NULL,quantiles_uq = c(0.05,0.95),
                             options_approx = options_approx, options_full_sims = options_full_sims,
                             options_sims = options_sims,options_bound = NULL,
                             plot_level = 3, plot_options = options_plots,return_level = 3)



# profile UQ on full optim oblique profiles with bound
oProfiles_UQ_full_bound<-obliqueProf_UQ(object = oProfiles_UQ_full,threshold = threshold,
                                        allPsi=allPsi, allResMean = NULL,
                                        quantiles_uq = c(0.05,0.95),
                                        options_approx = options_approx,
                                        options_full_sims = options_full_sims,
                                      options_sims = options_sims,
                                      options_bound = list(beta=0.024,alpha=0.05),
                                      plot_level = 3, plot_options = options_plots,
                                      return_level = 3)

## End(Not run)

profExtrema documentation built on March 22, 2020, 1:07 a.m.