# NOT RUN {
#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")
# }
Run the code above in your browser using DataLab