Running examples in 'DiceOptim-Ex.R' failed
The error most likely occurred in:

> ### Name: noisy.optimizer
> ### Title: Optimization of homogenously noisy functions based on Kriging
> ### Aliases: noisy.optimizer
> 
> ### ** Examples
> 
> ##########################################################################
> ### EXAMPLE 1: 3 OPTIMIZATION STEPS USING EQI WITH KNOWN NOISE         ###
> ### AND KNOWN COVARIANCE PARAMETERS FOR THE BRANIN FUNCTION            ###
> ##########################################################################
> 
> set.seed(10)
> library(DiceDesign)
> # Set test problem parameters
> doe.size <- 9
> dim <- 2
> test.function <- get("branin2")
> lower <- rep(0,1,dim)
> upper <- rep(1,1,dim)
> noise.var <- 0.1
> 
> # Build noisy simulator
> funnoise <- function(x)
+ {     f.new <- test.function(x) + sqrt(noise.var)*rnorm(n=1)
+       return(f.new)}
> 
> # Generate DOE and response
> doe <- as.data.frame(lhsDesign(doe.size, dim)$design)
> y.tilde <- funnoise(doe)
> 
> # Create kriging model
> model <- km(y~1, design=doe, response=data.frame(y=y.tilde),
+      covtype="gauss", noise.var=rep(noise.var,1,doe.size),
+      lower=rep(.1,dim), upper=rep(1,dim), control=list(trace=FALSE))
> 
> # Optimisation with noisy.optimizer (n.ite can be increased)
> n.ite <- 2
> optim.param <- list()
> optim.param$quantile <- .9
> optim.result <- noisy.optimizer(optim.crit="EQI", optim.param=optim.param, model=model,
+ 		n.ite=n.ite, noise.var=noise.var, funnoise=funnoise, lower=lower, upper=upper,
+ 		NoiseReEstimate=FALSE, CovReEstimate=FALSE)
Starting noisy optimization with the following criterion and parameters 
EQI 
$quantile
[1] 0.9

----------------- 


Fri Nov 08 13:43:45 2019
Domains:
 0.000000e+00   <=  X1   <=    1.000000e+00 
 0.000000e+00   <=  X2   <=    1.000000e+00 

Data Type: Floating Point
Operators (code number, name, population) 
	(1) Cloning........................... 	2
	(2) Uniform Mutation.................. 	1
	(3) Boundary Mutation................. 	1
	(4) Non-Uniform Mutation.............. 	1
	(5) Polytope Crossover................ 	1
	(6) Simple Crossover.................. 	2
	(7) Whole Non-Uniform Mutation........ 	1
	(8) Heuristic Crossover............... 	2
	(9) Local-Minimum Crossover........... 	0

HARD Maximum Number of Generations: 12
Maximum Nonchanging Generations: 2
Population size       : 12
Convergence Tolerance: 1.000000e-21

Using the BFGS Derivative Based Optimizer on the Best Individual Each Generation.
Not Checking Gradients before Stopping.
Not Using Out of Bounds Individuals and Not Allowing Trespassing.

Maximization Problem.


Generation#	    Solution Value

      0 	1.063658e-01
      1 	1.107913e-01
      2 	1.160717e-01
      3 	1.177830e-01
      4 	1.177830e-01

'wait.generations' limit reached.
No significant improvement in 2 generations.

Solution Fitness Value: 1.177830e-01

Parameters at the Solution (parameter, gradient):

 X[ 1] :	4.839501e-01	G[ 1] :	-7.580719e-09
 X[ 2] :	2.271152e-01	G[ 2] :	-9.746870e-09

Solution Found Generation 4
Number of Generations Run 7

Fri Nov 08 13:43:45 2019
Total run time : 0 hours 0 minutes and 0 seconds
Creating obs: 0.483950101155698 0.227115216495286 


Fri Nov 08 13:43:45 2019
Domains:
 0.000000e+00   <=  X1   <=    1.000000e+00 
 0.000000e+00   <=  X2   <=    1.000000e+00 

Data Type: Floating Point
Operators (code number, name, population) 
	(1) Cloning........................... 	2
	(2) Uniform Mutation.................. 	1
	(3) Boundary Mutation................. 	1
	(4) Non-Uniform Mutation.............. 	1
	(5) Polytope Crossover................ 	1
	(6) Simple Crossover.................. 	2
	(7) Whole Non-Uniform Mutation........ 	1
	(8) Heuristic Crossover............... 	2
	(9) Local-Minimum Crossover........... 	0

HARD Maximum Number of Generations: 12
Maximum Nonchanging Generations: 2
Population size       : 12
Convergence Tolerance: 1.000000e-21

Using the BFGS Derivative Based Optimizer on the Best Individual Each Generation.
Not Checking Gradients before Stopping.
Not Using Out of Bounds Individuals and Not Allowing Trespassing.

Maximization Problem.


Generation#	    Solution Value

      0 	4.540913e-02
      1 	5.530509e-02
      3 	5.544319e-02
      4 	5.544319e-02
      5 	5.544319e-02
      6 	5.544319e-02

'wait.generations' limit reached.
No significant improvement in 2 generations.

Solution Fitness Value: 5.544319e-02

Parameters at the Solution (parameter, gradient):

 X[ 1] :	4.956951e-01	G[ 1] :	4.590062e-09
 X[ 2] :	2.291099e-01	G[ 2] :	-1.675244e-09

Solution Found Generation 6
Number of Generations Run 9

Fri Nov 08 13:43:45 2019
Total run time : 0 hours 0 minutes and 0 seconds
Creating obs: 0.495695126403529 0.229109906400926 
> 
> new.model <- optim.result$model
> best.x    <- optim.result$best.x
> new.doe   <- optim.result$history.x
> 
> ## Not run: 
> ##D ##### DRAW RESULTS #####
> ##D # Compute actual function on a grid
> ##D n.grid <- 12
> ##D x.grid <- y.grid <- seq(0,1,length=n.grid)
> ##D design.grid <- expand.grid(x.grid, y.grid)
> ##D names(design.grid) <- c("V1","V2")
> ##D nt <- nrow(design.grid)
> ##D func.grid <- rep(0,1,nt)
> ##D 
> ##D for (i in 1:nt)
> ##D { func.grid[i] <- test.function(x=design.grid[i,])}
> ##D 
> ##D # Compute initial and final kriging on a grid
> ##D pred <- predict(object=model, newdata=design.grid, type="UK", checkNames = FALSE)
> ##D mk.grid1 <- pred$m
> ##D sk.grid1 <- pred$sd
> ##D 
> ##D pred <- predict(object=new.model, newdata=design.grid, type="UK", checkNames = FALSE)
> ##D mk.grid2 <- pred$m
> ##D sk.grid2 <- pred$sd
> ##D 
> ##D # Plot initial kriging mean
> ##D z.grid <- matrix(mk.grid1, n.grid, n.grid)
> ##D filled.contour(x.grid,y.grid, z.grid, nlevels=50, color = topo.colors,
> ##D plot.axes = {title("Initial kriging mean");
> ##D points(model@X[,1],model@X[,2],pch=17,col="black");
> ##D axis(1); axis(2)})
> ##D 
> ##D # Plot initial kriging variance
> ##D z.grid <- matrix(sk.grid1^2, n.grid, n.grid)
> ##D filled.contour(x.grid,y.grid, z.grid, nlevels=50, color = topo.colors,
> ##D plot.axes = {title("Initial kriging variance");
> ##D points(model@X[,1],model@X[,2],pch=17,col="black");
> ##D axis(1); axis(2)})
> ##D 
> ##D # Plot final kriging mean
> ##D z.grid <- matrix(mk.grid2, n.grid, n.grid)
> ##D filled.contour(x.grid,y.grid, z.grid, nlevels=50, color = topo.colors,
> ##D plot.axes = {title("Final kriging mean");
> ##D points(new.model@X[,1],new.model@X[,2],pch=17,col="black");
> ##D axis(1); axis(2)})
> ##D 
> ##D # Plot final kriging variance
> ##D z.grid <- matrix(sk.grid2^2, n.grid, n.grid)
> ##D filled.contour(x.grid,y.grid, z.grid, nlevels=50, color = topo.colors,
> ##D plot.axes = {title("Final kriging variance");
> ##D points(new.model@X[,1],new.model@X[,2],pch=17,col="black");
> ##D axis(1); axis(2)})
> ##D 
> ##D # Plot actual function and observations
> ##D z.grid <- matrix(func.grid, n.grid, n.grid)
> ##D tit <- "Actual function - Black: initial points; red: added points"
> ##D filled.contour(x.grid,y.grid, z.grid, nlevels=50, color = topo.colors,
> ##D plot.axes = {title(tit);points(model@X[,1],model@X[,2],pch=17,col="black");
> ##D points(new.doe[1,],new.doe[2,],pch=15,col="red");
> ##D axis(1); axis(2)})
> ## End(Not run)
> 
> ##########################################################################
> ### EXAMPLE 2: 3 OPTIMIZATION STEPS USING EQI WITH UNKNOWN NOISE       ###
> ### AND UNKNOWN COVARIANCE PARAMETERS FOR THE BRANIN FUNCTION          ###
> ##########################################################################
> # Same initial model and parameters as for example 1
> n.ite <- 2 # May be changed to a larger value
> res <- noisy.optimizer(optim.crit="min.quantile",
+ optim.param=list(type="quantile",quantile=0.01),
+ model=model, n.ite=n.ite, noise.var=noise.var, funnoise=funnoise,
+ lower=lower, upper=upper,
+ control=list(print.level=0),CovReEstimate=TRUE, NoiseReEstimate=TRUE)
Starting noisy optimization with the following criterion and parameters 
min.quantile 
$type
[1] quantile

$quantile
[1] 0.01

----------------- 
Creating obs: 0.214619853596017 0 

optimisation start
------------------
* estimation method   : MLE 
* optimisation method : BFGS 
* analytical gradient : used
* trend model : ~1
* covariance model : 
  - type :  gauss 
  - nugget : unknown homogenous nugget effect 
  - parameters lower bounds :  1e-10 1e-10 
  - parameters upper bounds :  1.856244 1.96525 
  - upper bound for alpha   :  1 
  - best initial criterion value(s) :  -10.89385 

N = 3, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate     0  f=       10.894  |proj g|=       1.7855
At iterate     1  f =       10.532  |proj g|=       0.24405
At iterate     2  f =       10.464  |proj g|=       0.22459
At iterate     3  f =       10.424  |proj g|=        1.3042
At iterate     4  f =       10.006  |proj g|=       0.36209
ys=-5.216e-01  -gs= 3.268e-01, BFGS update SKIPPED
At iterate     5  f =       12.116  |proj g|=             1

iterations 5
function evaluations 11
segments explored during Cauchy searches 8
BFGS updates skipped 1
active bounds at final generalized Cauchy point 2
norm of the final projected gradient 1
final function value 12.1156

F = 12.1156
final  value 12.115572 
converged
Error in validObject(covStruct) : 
  invalid class "covTensorProduct" object: The range parameters must have positive values
[1] Error occured during hyperparameter reestimation - old hyperparameter values used instead
Error in validObject(covStruct) : 
  invalid class "covTensorProduct" object: The range parameters must have positive values
Calls: noisy.optimizer ... .local -> update.km -> km -> covStruct.create -> validObject
Execution halted