Running examples in ‘DiceKriging-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: km
> ### Title: Fit and/or create kriging models
> ### Aliases: km
> ### Keywords: models htest
> 
> ### ** Examples
> 
> 
> # ----------------------------------
> # A 2D example - Branin-Hoo function
> # ----------------------------------
> 
> # a 16-points factorial design, and the corresponding response
> d <- 2; n <- 16
> design.fact <- expand.grid(x1=seq(0,1,length=4), x2=seq(0,1,length=4))
> y <- apply(design.fact, 1, branin) 
> 
> # kriging model 1 : matern5_2 covariance structure, no trend, no nugget effect
> m1 <- km(design=design.fact, response=y)

optimisation start
------------------
* estimation method   : MLE 
* optimisation method : BFGS 
* analytical gradient : used
* trend model : ~1
* covariance model : 
  - type :  matern5_2 
  - nugget : NO
  - parameters lower bounds :  1e-10 1e-10 
  - parameters upper bounds :  2 2 
  - best initial criterion value(s) :  -82.12845 

N = 2, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate     0  f=       82.128  |proj g|=      0.76007
At iterate     1  f =       82.058  |proj g|=       0.42619
At iterate     2  f =       81.623  |proj g|=        1.2737
At iterate     3  f =       81.089  |proj g|=        1.0521
At iterate     4  f =       81.058  |proj g|=      0.049783
At iterate     5  f =       81.058  |proj g|=     0.0050937
At iterate     6  f =       81.058  |proj g|=    2.8715e-05
At iterate     7  f =       81.058  |proj g|=    1.6712e-08

iterations 7
function evaluations 9
segments explored during Cauchy searches 9
BFGS updates skipped 0
active bounds at final generalized Cauchy point 1
norm of the final projected gradient 1.67125e-08
final function value 81.0576

F = 81.0576
final  value 81.057643 
converged
> 
> # kriging model 2 : matern5_2 covariance structure, 
> #                   linear trend + interactions, no nugget effect
> m2 <- km(~.^2, design=design.fact, response=y)

optimisation start
------------------
* estimation method   : MLE 
* optimisation method : BFGS 
* analytical gradient : used
* trend model : ~x1 + x2 + x1:x2
* covariance model : 
  - type :  matern5_2 
  - nugget : NO
  - parameters lower bounds :  1e-10 1e-10 
  - parameters upper bounds :  2 2 
  - best initial criterion value(s) :  -77.99626 

N = 2, M = 5 machine precision = 2.22045e-16
At X0, 0 variables are exactly at the bounds
At iterate     0  f=       77.996  |proj g|=       0.7905
At iterate     1  f =       77.959  |proj g|=        0.7636
At iterate     2  f =        77.83  |proj g|=       0.69538
At iterate     3  f =       77.584  |proj g|=        1.2669
At iterate     4  f =       77.543  |proj g|=       0.17747
At iterate     5  f =       77.543  |proj g|=      0.017835
At iterate     6  f =       77.543  |proj g|=    0.00025577
At iterate     7  f =       77.543  |proj g|=    3.7685e-07

iterations 7
function evaluations 9
segments explored during Cauchy searches 8
BFGS updates skipped 0
active bounds at final generalized Cauchy point 1
norm of the final projected gradient 3.76846e-07
final function value 77.5425

F = 77.5425
final  value 77.542533 
converged
> 
> # graphics 
> n.grid <- 50
> x.grid <- y.grid <- seq(0,1,length=n.grid)
> design.grid <- expand.grid(x1=x.grid, x2=y.grid)
> response.grid <- apply(design.grid, 1, branin)
> predicted.values.model1 <- predict(m1, design.grid, "UK")$mean
> predicted.values.model2 <- predict(m2, design.grid, "UK")$mean
> par(mfrow=c(3,1))
> contour(x.grid, y.grid, matrix(response.grid, n.grid, n.grid), 50, main="Branin")
> points(design.fact[,1], design.fact[,2], pch=17, cex=1.5, col="blue")
> contour(x.grid, y.grid, matrix(predicted.values.model1, n.grid, n.grid), 50, 
+         main="Ordinary Kriging")
> points(design.fact[,1], design.fact[,2], pch=17, cex=1.5, col="blue")
> contour(x.grid, y.grid, matrix(predicted.values.model2, n.grid, n.grid), 50, 
+         main="Universal Kriging")
> points(design.fact[,1], design.fact[,2], pch=17, cex=1.5, col="blue")
> par(mfrow=c(1,1))
> 
> 
> # (same example) how to use the multistart argument
> # -------------------------------------------------
> require(foreach)
Loading required package: foreach
> 
> # below an example for a computer with 2 cores, but also work with 1 core
> 
> nCores <- 2
> require(doParallel)
Loading required package: doParallel
Warning in library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
  there is no package called ‘doParallel’
> cl <-  makeCluster(nCores) 
Error in makeCluster(nCores) : could not find function "makeCluster"
Execution halted