Running 'testthat.R' [44s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > 
  > # the unit tests take pretty long, that can be a problem on WB and cran (and maybe annoying locally)
  > # so we run all tests only on travis and if a certain user env var is set
  > if (identical(Sys.getenv("TRAVIS"), "true") || identical(Sys.getenv("R_EXPENSIVE_TEST_OK"), "true")) {
  +   test_check("mlrMBO")
  + } else {
  +   test_check("mlrMBO", filter = "((mbo_rf)|(mbo_km))")
  + }
  Loading required package: mlrMBO
  Loading required package: mlr
  Loading required package: ParamHelpers
  Loading required package: smoof
  Loading required package: BBmisc
  
  Attaching package: 'BBmisc'
  
  The following object is masked from 'package:base':
  
      isFALSE
  
  Loading required package: checkmate
  -- 1. Error: mbo works with km (@test_mbo_km.R#11)  ----------------------------
  the leading minor of order 2 is not positive definite
  1: mbo(testf.fsphere.2d, des, learner = learner, control = ctrl) at testthat/test_mbo_km.R:11
  2: mboTemplate(opt.problem)
  3: mboTemplate.OptProblem(opt.problem)
  4: mboTemplate(opt.state)
  5: mboTemplate.OptState(opt.state)
  6: proposePoints(opt.state)
  7: proposePointsByInfillOptimization(opt.state)
  8: models %??% getOptStateModels(opt.state)$models
  9: getOptStateModels(opt.state)
  10: trainModels(learner = getOptProblemLearner(opt.problem), tasks = getOptStateTasks(opt.state), 
         control = getOptProblemControl(opt.problem))
  ...
  24: (function (.learner, .task, .subset, .weights = NULL, ...) 
     {
         UseMethod("trainLearner")
     })(.learner = structure(list(id = "regr.km", type = "regr", package = "DiceKriging", 
         properties = c("numerics", "se"), par.set = structure(list(pars = list(covtype = structure(list(
             id = "covtype", type = "discrete", len = 1L, lower = NULL, upper = NULL, 
             values = list(gauss = "gauss", matern5_2 = "matern5_2", matern3_2 = "matern3_2", 
                 exp = "exp", powexp = "powexp"), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = "matern5_2", trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.trend = structure(list(
             id = "coef.trend", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.cov = structure(list(
             id = "coef.cov", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.var = structure(list(
             id = "coef.var", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), nugget = structure(list(
             id = "nugget", type = "numeric", len = 1L, lower = -Inf, upper = Inf, values = NULL, 
             cnames = NULL, allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), nugget.estim = structure(list(id = "nugget.estim", type = "logical", 
             len = 1L, lower = NULL, upper = NULL, values = list(`TRUE` = TRUE, `FALSE` = FALSE), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = FALSE, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), noise.var = structure(list(id = "noise.var", type = "numericvector", 
             len = NA_integer_, lower = -Inf, upper = Inf, values = NULL, cnames = NULL, 
             allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, 
             tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), estim.method = structure(list(id = "estim.method", type = "discrete", 
             len = 1L, lower = NULL, upper = NULL, values = list(MLE = "MLE", LOO = "LOO"), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = "MLE", trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), optim.method = structure(list(id = "optim.method", type = "discrete", 
             len = 1L, lower = NULL, upper = NULL, values = list(BFGS = "BFGS", gen = "gen"), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = "BFGS", trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), lower = structure(list(id = "lower", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), upper = structure(list(id = "upper", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), parinit = structure(list(id = "parinit", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), multistart = structure(list(id = "multistart", type = "integer", len = 1L, 
             lower = 1L, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = TRUE, default = 1L, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), control = structure(list(id = "control", type = "untyped", len = 1L, lower = NULL, 
             upper = NULL, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), gr = structure(list(
             id = "gr", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = TRUE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), iso = structure(list(
             id = "iso", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = FALSE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), scaling = structure(list(
             id = "scaling", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = FALSE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), knots = structure(list(
             id = "knots", type = "untyped", len = 1L, lower = NULL, upper = NULL, values = NULL, 
             cnames = NULL, allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), jitter = structure(list(id = "jitter", type = "logical", len = 1L, 
             lower = NULL, upper = NULL, values = list(`TRUE` = TRUE, `FALSE` = FALSE), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = FALSE, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "predict"), class = c("LearnerParam", 
         "Param")), nugget.stability = structure(list(id = "nugget.stability", type = "numeric", 
             len = 1L, lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = !nugget.estim && 
                 is.null(nugget), tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param"))), forbidden = NULL), class = c("LearnerParamSet", "ParamSet")), par.vals = list(
             jitter = FALSE, nugget.estim = TRUE), predict.type = "response", name = "Kriging", 
         short.name = "km", note = "In predict, we currently always use `type = \"SK\"`. The extra parameter `jitter` (default is `FALSE`) enables adding a very small jitter (order 1e-12) to the x-values before prediction, as `predict.km` reproduces the exact y-values of the training data points, when you pass them in, even if the nugget effect is turned on. \n We further introduced `nugget.stability` which sets the `nugget` to `nugget.stability * var(y)` before each training to improve numerical stability. We recommend a setting of 10^-8", 
         callees = "km", help.list = list(covtype = "Argument of: DiceKriging::km\n\nan optional character string specifying the covariance structure to be used, to be chosen between \"gauss\", \"matern5_2\", \"matern3_2\", \"exp\" or \"powexp\". See a full description of available covariance kernels in covTensorProduct-class. Default is \"matern5_2\". See also the argument kernel that allows the user to build its own covariance structure.", 
             coef.trend = "Argument of: DiceKriging::km\n\n(see below)", coef.cov = "Argument of: DiceKriging::km\n\n(see below)", 
             coef.var = "Argument of: DiceKriging::km\n\noptional vectors containing the values for the trend, covariance and variance parameters. For estimation, 4 cases are implemented: 1. (All unknown) If all are missing, all are estimated. 2. (All known) If all are provided, no estimation is performed; 3. (Known trend) If coef.trend is provided but at least one of coef.cov or coef.var is missing, then BOTH coef.cov and coef.var are estimated; 4. (Unknown trend) If coef.cov and coef.var are provided but coef.trend is missing, then coef.trend is estimated (GLS formula).", 
             nugget = "Argument of: DiceKriging::km\n\nan optional variance value standing for the homogeneous nugget effect.", 
             nugget.estim = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether the nugget effect should be estimated. Note that this option does not concern the case of heterogeneous noisy observations (see noise.var below). If nugget is given, it is used as an initial value. Default is FALSE.", 
             noise.var = "Argument of: DiceKriging::km\n\nfor noisy observations : an optional vector containing the noise variance at each observation. This is useful for stochastic simulators. Default is NULL.", 
             estim.method = "Argument of: DiceKriging::km\n\na character string specifying the method by which unknown parameters are estimated. Default is \"MLE\" (Maximum Likelihood). At this stage, a beta version of leave-One-Out estimation (estim.method=\"LOO\") is also implemented for noise-free observations.", 
             optim.method = "Argument of: DiceKriging::km\n\nan optional character string indicating which optimization method is chosen for the likelihood maximization. \"BFGS\" is the optim quasi-Newton procedure of package stats, with the method \"L-BFGS-B\". \"gen\" is the genoud genetic algorithm (using derivatives) from package rgenoud (>= 5.3.3).", 
             lower = "Argument of: DiceKriging::km\n\n(see below)", upper = "Argument of: DiceKriging::km\n\noptional vectors containing the bounds of the correlation parameters for optimization. The default values are given by covParametersBounds.", 
             parinit = "Argument of: DiceKriging::km\n\nan optional vector containing the initial values for the variables to be optimized over. If no vector is given, an initial point is generated as follows. For method \"gen\", the initial point is generated uniformly inside the hyper-rectangle domain defined by lower and upper. For method \"BFGS\", some points (see control below) are generated uniformly in the domain. Then the best point with respect to the likelihood (or penalized likelihood, see penalty) criterion is chosen.", 
             multistart = "Argument of: DiceKriging::km\n\nan optional integer indicating the number of initial points from which running the BFGS optimizer. These points will be selected as the best multistart one(s) among those evaluated (see above parinit). The multiple optimizations will be performed in parallel provided that a parallel backend is registered (see package foreach).", 
             control = "Argument of: DiceKriging::km\n\nan optional list of control parameters for optimization. See details below.", 
             gr = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether the analytical gradient should be used. Default is TRUE.", 
             iso = "Argument of: DiceKriging::km\n\nan optional boolean that can be used to force a tensor-product covariance structure (see covTensorProduct-class) to have a range parameter common to all dimensions. Default is FALSE. Not used (at this stage) for the power-exponential type.", 
             scaling = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether a scaling on the covariance structure should be used.", 
             knots = "Argument of: DiceKriging::km\n\nan optional list of knots for scaling. The j-th element is a vector containing the knots for dimension j. If scaling=TRUE and knots are not specified, than knots are fixed to 0 and 1 in each dimension (which corresponds to affine scaling for the domain [0,1]^d)."), 
         config = list(on.learner.error = "stop"), fix.factors.prediction = TRUE), class = c("regr.km", 
     "RLearnerRegr", "RLearner", "Learner")), .task = structure(list(type = "regr", env = <environment>, 
         weights = NULL, blocking = NULL, coordinates = NULL, task.desc = structure(list(
             id = "data", type = "regr", target = "y", size = 12L, n.feat = c(numerics = 2L, 
             factors = 0L, ordered = 0L, functionals = 0L), has.missings = FALSE, has.weights = FALSE, 
             has.blocking = FALSE, has.coordinates = FALSE), class = c("RegrTaskDesc", 
         "SupervisedTaskDesc", "TaskDesc"))), class = c("RegrTask", "SupervisedTask", 
     "Task")), .subset = NULL, nugget.estim = TRUE)
  25: trainLearner.regr.km(.learner = structure(list(id = "regr.km", type = "regr", package = "DiceKriging", 
         properties = c("numerics", "se"), par.set = structure(list(pars = list(covtype = structure(list(
             id = "covtype", type = "discrete", len = 1L, lower = NULL, upper = NULL, 
             values = list(gauss = "gauss", matern5_2 = "matern5_2", matern3_2 = "matern3_2", 
                 exp = "exp", powexp = "powexp"), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = "matern5_2", trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.trend = structure(list(
             id = "coef.trend", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.cov = structure(list(
             id = "coef.cov", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), coef.var = structure(list(
             id = "coef.var", type = "numericvector", len = NA_integer_, lower = -Inf, 
             upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), nugget = structure(list(
             id = "nugget", type = "numeric", len = 1L, lower = -Inf, upper = Inf, values = NULL, 
             cnames = NULL, allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), nugget.estim = structure(list(id = "nugget.estim", type = "logical", 
             len = 1L, lower = NULL, upper = NULL, values = list(`TRUE` = TRUE, `FALSE` = FALSE), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = FALSE, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), noise.var = structure(list(id = "noise.var", type = "numericvector", 
             len = NA_integer_, lower = -Inf, upper = Inf, values = NULL, cnames = NULL, 
             allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, 
             tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), estim.method = structure(list(id = "estim.method", type = "discrete", 
             len = 1L, lower = NULL, upper = NULL, values = list(MLE = "MLE", LOO = "LOO"), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = "MLE", trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), optim.method = structure(list(id = "optim.method", type = "discrete", 
             len = 1L, lower = NULL, upper = NULL, values = list(BFGS = "BFGS", gen = "gen"), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = "BFGS", trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), lower = structure(list(id = "lower", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), upper = structure(list(id = "upper", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), parinit = structure(list(id = "parinit", type = "numericvector", len = NA_integer_, 
             lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), multistart = structure(list(id = "multistart", type = "integer", len = 1L, 
             lower = 1L, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = TRUE, default = 1L, trafo = NULL, requires = NULL, tunable = TRUE, 
             special.vals = list(), when = "train"), class = c("LearnerParam", "Param"
         )), control = structure(list(id = "control", type = "untyped", len = 1L, lower = NULL, 
             upper = NULL, values = NULL, cnames = NULL, allow.inf = FALSE, has.default = FALSE, 
             default = NULL, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), gr = structure(list(
             id = "gr", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = TRUE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), iso = structure(list(
             id = "iso", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = FALSE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), scaling = structure(list(
             id = "scaling", type = "logical", len = 1L, lower = NULL, upper = NULL, values = list(
                 `TRUE` = TRUE, `FALSE` = FALSE), cnames = NULL, allow.inf = FALSE, has.default = TRUE, 
             default = FALSE, trafo = NULL, requires = NULL, tunable = TRUE, special.vals = list(), 
             when = "train"), class = c("LearnerParam", "Param")), knots = structure(list(
             id = "knots", type = "untyped", len = 1L, lower = NULL, upper = NULL, values = NULL, 
             cnames = NULL, allow.inf = FALSE, has.default = FALSE, default = NULL, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param")), jitter = structure(list(id = "jitter", type = "logical", len = 1L, 
             lower = NULL, upper = NULL, values = list(`TRUE` = TRUE, `FALSE` = FALSE), 
             cnames = NULL, allow.inf = FALSE, has.default = TRUE, default = FALSE, trafo = NULL, 
             requires = NULL, tunable = TRUE, special.vals = list(), when = "predict"), class = c("LearnerParam", 
         "Param")), nugget.stability = structure(list(id = "nugget.stability", type = "numeric", 
             len = 1L, lower = -Inf, upper = Inf, values = NULL, cnames = NULL, allow.inf = FALSE, 
             has.default = FALSE, default = NULL, trafo = NULL, requires = !nugget.estim && 
                 is.null(nugget), tunable = TRUE, special.vals = list(), when = "train"), class = c("LearnerParam", 
         "Param"))), forbidden = NULL), class = c("LearnerParamSet", "ParamSet")), par.vals = list(
             jitter = FALSE, nugget.estim = TRUE), predict.type = "response", name = "Kriging", 
         short.name = "km", note = "In predict, we currently always use `type = \"SK\"`. The extra parameter `jitter` (default is `FALSE`) enables adding a very small jitter (order 1e-12) to the x-values before prediction, as `predict.km` reproduces the exact y-values of the training data points, when you pass them in, even if the nugget effect is turned on. \n We further introduced `nugget.stability` which sets the `nugget` to `nugget.stability * var(y)` before each training to improve numerical stability. We recommend a setting of 10^-8", 
         callees = "km", help.list = list(covtype = "Argument of: DiceKriging::km\n\nan optional character string specifying the covariance structure to be used, to be chosen between \"gauss\", \"matern5_2\", \"matern3_2\", \"exp\" or \"powexp\". See a full description of available covariance kernels in covTensorProduct-class. Default is \"matern5_2\". See also the argument kernel that allows the user to build its own covariance structure.", 
             coef.trend = "Argument of: DiceKriging::km\n\n(see below)", coef.cov = "Argument of: DiceKriging::km\n\n(see below)", 
             coef.var = "Argument of: DiceKriging::km\n\noptional vectors containing the values for the trend, covariance and variance parameters. For estimation, 4 cases are implemented: 1. (All unknown) If all are missing, all are estimated. 2. (All known) If all are provided, no estimation is performed; 3. (Known trend) If coef.trend is provided but at least one of coef.cov or coef.var is missing, then BOTH coef.cov and coef.var are estimated; 4. (Unknown trend) If coef.cov and coef.var are provided but coef.trend is missing, then coef.trend is estimated (GLS formula).", 
             nugget = "Argument of: DiceKriging::km\n\nan optional variance value standing for the homogeneous nugget effect.", 
             nugget.estim = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether the nugget effect should be estimated. Note that this option does not concern the case of heterogeneous noisy observations (see noise.var below). If nugget is given, it is used as an initial value. Default is FALSE.", 
             noise.var = "Argument of: DiceKriging::km\n\nfor noisy observations : an optional vector containing the noise variance at each observation. This is useful for stochastic simulators. Default is NULL.", 
             estim.method = "Argument of: DiceKriging::km\n\na character string specifying the method by which unknown parameters are estimated. Default is \"MLE\" (Maximum Likelihood). At this stage, a beta version of leave-One-Out estimation (estim.method=\"LOO\") is also implemented for noise-free observations.", 
             optim.method = "Argument of: DiceKriging::km\n\nan optional character string indicating which optimization method is chosen for the likelihood maximization. \"BFGS\" is the optim quasi-Newton procedure of package stats, with the method \"L-BFGS-B\". \"gen\" is the genoud genetic algorithm (using derivatives) from package rgenoud (>= 5.3.3).", 
             lower = "Argument of: DiceKriging::km\n\n(see below)", upper = "Argument of: DiceKriging::km\n\noptional vectors containing the bounds of the correlation parameters for optimization. The default values are given by covParametersBounds.", 
             parinit = "Argument of: DiceKriging::km\n\nan optional vector containing the initial values for the variables to be optimized over. If no vector is given, an initial point is generated as follows. For method \"gen\", the initial point is generated uniformly inside the hyper-rectangle domain defined by lower and upper. For method \"BFGS\", some points (see control below) are generated uniformly in the domain. Then the best point with respect to the likelihood (or penalized likelihood, see penalty) criterion is chosen.", 
             multistart = "Argument of: DiceKriging::km\n\nan optional integer indicating the number of initial points from which running the BFGS optimizer. These points will be selected as the best multistart one(s) among those evaluated (see above parinit). The multiple optimizations will be performed in parallel provided that a parallel backend is registered (see package foreach).", 
             control = "Argument of: DiceKriging::km\n\nan optional list of control parameters for optimization. See details below.", 
             gr = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether the analytical gradient should be used. Default is TRUE.", 
             iso = "Argument of: DiceKriging::km\n\nan optional boolean that can be used to force a tensor-product covariance structure (see covTensorProduct-class) to have a range parameter common to all dimensions. Default is FALSE. Not used (at this stage) for the power-exponential type.", 
             scaling = "Argument of: DiceKriging::km\n\nan optional boolean indicating whether a scaling on the covariance structure should be used.", 
             knots = "Argument of: DiceKriging::km\n\nan optional list of knots for scaling. The j-th element is a vector containing the knots for dimension j. If scaling=TRUE and knots are not specified, than knots are fixed to 0 and 1 in each dimension (which corresponds to affine scaling for the domain [0,1]^d)."), 
         config = list(on.learner.error = "stop"), fix.factors.prediction = TRUE), class = c("regr.km", 
     "RLearnerRegr", "RLearner", "Learner")), .task = structure(list(type = "regr", env = <environment>, 
         weights = NULL, blocking = NULL, coordinates = NULL, task.desc = structure(list(
             id = "data", type = "regr", target = "y", size = 12L, n.feat = c(numerics = 2L, 
             factors = 0L, ordered = 0L, functionals = 0L), has.missings = FALSE, has.weights = FALSE, 
             has.blocking = FALSE, has.coordinates = FALSE), class = c("RegrTaskDesc", 
         "SupervisedTaskDesc", "TaskDesc"))), class = c("RegrTask", "SupervisedTask", 
     "Task")), .subset = NULL, nugget.estim = TRUE)
  26: do.call(DiceKriging::km, c(list(design = d$data, response = d$target), args))
  27: (function (formula = ~1, design, response, covtype = "matern5_2", coef.trend = NULL, 
         coef.cov = NULL, coef.var = NULL, nugget = NULL, nugget.estim = FALSE, noise.var = NULL, 
         estim.method = "MLE", penalty = NULL, optim.method = "BFGS", lower = NULL, upper = NULL, 
         parinit = NULL, multistart = 1, control = NULL, gr = TRUE, iso = FALSE, scaling = FALSE, 
         knots = NULL, kernel = NULL) 
     {
         if (!is.null(kernel)) {
             covtype <- "covUser"
             nugget.estim <- FALSE
         }
         model <- new("km")
         model@call <- match.call()
         data <- data.frame(design)
         model@trend.formula <- formula <- drop.response(formula, data = data)
         F <- model.matrix(formula, data = data)
         X <- as.matrix(data)
         y <- as.matrix(response)
         model@X <- X
         model@y <- y
         model@d <- ncol(X)
         model@n <- nrow(X)
         model@F <- F
         model@p <- ncol(F)
         model@noise.flag <- (length(noise.var) != 0)
         model@noise.var <- as.numeric(noise.var)
         isTrend <- length(coef.trend) != 0
         isCov <- length(coef.cov) != 0
         isVar <- length(coef.var) != 0
         if ((isTrend && isCov && isVar) || (covtype == "covUser")) {
             known.param <- "All"
             nugget.estim <- FALSE
         }
         else if ((isTrend) && ((!isCov) || (!isVar))) {
             known.param <- "Trend"
         }
         else if ((!isTrend) && isCov && isVar) {
             known.param <- "CovAndVar"
             nugget.estim <- FALSE
         }
         else {
             known.param <- "None"
             coef.var <- coef.cov <- NULL
         }
         if (isCov) {
             known.covparam <- "All"
         }
         else {
             known.covparam <- "None"
         }
         model@covariance <- covStruct.create(covtype = covtype, d = model@d, known.covparam = known.covparam, 
             var.names = colnames(X), coef.cov = coef.cov, coef.var = coef.var, nugget = nugget, 
             nugget.estim = nugget.estim, nugget.flag = ((length(nugget) != 0) || nugget.estim), 
             iso = iso, scaling = scaling, knots = knots, kernel = kernel)
         model@known.param <- known.param
         if (known.param == "All") {
             model@trend.coef <- as.numeric(coef.trend)
             model@param.estim <- FALSE
             validObject(model)
             model <- computeAuxVariables(model)
             return(model)
         }
         if (known.param == "CovAndVar") {
             model@param.estim <- TRUE
             validObject(model)
             model <- computeAuxVariables(model)
             x <- backsolve(t(model@T), model@y, upper.tri = FALSE)
             beta <- compute.beta.hat(x = x, M = model@M)
             z <- compute.z(x = x, M = model@M, beta = beta)
             model@z <- z
             model@trend.coef <- beta
             return(model)
         }
         if (known.param == "Trend") {
             model@trend.coef <- as.numeric(coef.trend)
         }
         if (length(penalty) == 0) {
             if (is.element(estim.method, c("MLE", "LOO"))) {
                 model@method <- estim.method
             }
             else {
                 stop("estim.method must be: 'MLE' or 'LOO'")
             }
         }
         else {
             if (covtype != "gauss") {
                 stop("At this stage, Penalized Maximum Likelihood is coded only for Gaussian covariance")
             }
             penalty.set <- c("SCAD")
             if (!is.element(penalty$fun, penalty.set)) {
                 stop("At this stage, the penalty #function has to be one of : SCAD")
             }
             if (length(penalty$value) == 0) {
                 penalty$value <- sqrt(2 * log(model@n)/model@n) * seq(from = 1, by = 0.5, 
                     length = 15)
             }
             penalty$fun.derivative <- paste(penalty$fun, ".derivative", sep = "")
             model@penalty <- penalty
             model@method <- "PMLE"
         }
         model@param.estim <- TRUE
         model@optim.method <- as.character(optim.method)
         if ((length(lower) == 0) || (length(upper) == 0)) {
             bounds <- covParametersBounds(model@covariance, design)
             if (length(lower) == 0) 
                 lower <- bounds$lower
             if (length(upper) == 0) 
                 upper <- bounds$upper
         }
         if ((multistart > 1) && (optim.method == "gen")) {
             warning("The 'multistart' argument is not used when 'optim.method' is 'gen'.")
             multistart <- 1
         }
         control$multistart <- multistart
         model@lower <- as.numeric(lower)
         model@upper <- as.numeric(upper)
         model@parinit <- as.numeric(parinit)
         if (optim.method == "BFGS") {
             if (length(control$pop.size) == 0) 
                 control$pop.size <- 20
             control$pop.size <- max(control$pop.size, multistart)
             if (identical(control$trace, FALSE)) 
                 control$trace <- 0
             if ((length(control$trace) == 0) || (identical(control$trace, TRUE))) {
                 control$trace <- 3
             }
         }
         if (optim.method == "gen") {
             d <- ncol(design)
             if (length(control$pop.size) == 0) 
                 control$pop.size <- min(20, floor(4 + 3 * log(d)))
             if (length(control$max.generations) == 0) 
                 control$max.generations <- 5
             if (length(control$wait.generations) == 0) 
                 control$wait.generations <- 2
             if (length(control$BFGSburnin) == 0) 
                 control$BFGSburnin <- 0
             if (identical(control$trace, FALSE)) {
                 control$trace <- 0
             }
             else control$trace <- 1
         }
         upper.alpha <- control$upper.alpha
         if (length(upper.alpha) == 0) {
             control$upper.alpha <- 1 - 1e-08
         }
         else if ((upper.alpha < 0) || (upper.alpha > 1)) {
             control$upper.alpha <- 1 - 1e-08
         }
         model@control <- control
         model@gr <- as.logical(gr)
         envir.logLik <- new.env()
         validObject(model, complete = TRUE)
         varStationaryClass <- c("covTensorProduct", "covScaling", "covAffineScaling", 
             "covIso")
         if (length(noise.var) != 0) {
             model@case <- "LLconcentration_beta"
         }
         else if (!is.element(class(model@covariance), varStationaryClass)) {
             model@case <- "LLconcentration_beta"
         }
         else {
             knownNugget <- ((length(nugget) > 0) && (!nugget.estim))
             if (nugget.estim) {
                 model@case <- "LLconcentration_beta_v_alpha"
             }
             else if (knownNugget) {
                 model@case <- "LLconcentration_beta"
             }
             else {
                 model@case <- "LLconcentration_beta_sigma2"
             }
         }
         if ((model@method == "LOO") & (model@case != "LLconcentration_beta_sigma2")) {
             stop("leave-One-Out is not available for this model")
         }
         f <- kmEstimate
         if (identical(model@method, "PMLE")) {
             cv <- function(lambda, object, f) {
                 object@penalty$value <- lambda
                 object@control$trace <- 0
                 object <- f(object, envir = envir.logLik)
                 criterion <- sum((object@y - leaveOneOut.km(object, type = "UK")$mean)^2)
                 return(criterion)
             }
             lambda.val <- model@penalty$value
             nval <- length(lambda.val)
             u <- rep(0, nval)
             for (i in 1L:nval) {
                 u[i] <- cv(lambda.val[i], object = model, f)
             }
             plot(lambda.val, u)
             lambda <- lambda.val[which.min(u)]
             model@penalty$value <- lambda
             model <- f(model, envir = envir.logLik)
         }
         else {
             model <- f(model, envir = envir.logLik)
         }
         return(model)
     })(design = structure(list(x1 = c(3.90655727624893, 4.63441747236252, -0.654716249704361, 
     -4.97293109846115, -1.96676534128189, -2.72233138418198, 0.296402220010757, 2.57219884991646, 
     1.92784708380699, -3.94532017970085, -4.97476386449337, 1.92300608076155), x2 = c(2.50804862642288, 
     -2.2291252644062, -3.22063580203056, -0.22364568901062, 1.41132222890854, 4.66362847614288, 
     3.58842379713058, -4.52684600782394, -1.78892828226089, 0.807410793542862, 3.49903294260502, 
     -2.1377419798027)), class = "data.frame", row.names = c(NA, -12L)), response = c(21.5514976651152, 
     26.446824752553, 10.801148336948, 24.7800611042551, 5.85999634147904, 29.1605187287929, 
     12.9646396238404, 27.1085417020631, 6.91685877761604, 16.2174635098843, 36.9915070409042, 
     8.26789315885669), nugget.estim = TRUE)
  28: f(model, envir = envir.logLik)
  29: optim(par = parinit, fn = fn, gr = gr, method = "L-BFGS-B", lower = lower, upper = upper, 
         control = controlChecked, hessian = FALSE, model, envir = envir)
  30: (function (par) 
     fn(par, ...))(c(-76.8734506943471, -0.115791758139348, 0.99999999))
  31: fn(par, ...)
  32: chol(R)
  33: chol.default(R)
  
  == testthat results  ===========================================================
  OK: 38 SKIPPED: 0 FAILED: 1
  1. Error: mbo works with km (@test_mbo_km.R#11) 
  
  Error: testthat unit tests failed
  Execution halted