Running ‘AAAtest-all.R’ [41s/52s]
  Running ‘HSAURtrees.R’
  Running ‘REMLdev.R’
  Running ‘ST.R’
  Running ‘agridat_gotway.R’
  Running ‘bootMer.R’ [11s/25s]
  Running ‘boundary.R’
  Running ‘confint.R’ [8s/12s]
  Running ‘devCritFun.R’
  Running ‘drop.R’
  Running ‘drop1contrasts.R’
  Running ‘dynload.R’
  Running ‘elston.R’
  Running ‘evalCall.R’
  Running ‘extras.R’
  Running ‘falsezero_dorie.R’
  Running ‘fewlevels.R’
  Running ‘getME.R’
  Running ‘glmer-1.R’ [7s/11s]
  Running ‘glmerControlPass.R’ [10s/14s]
  Running ‘glmerWarn.R’
  Running ‘glmmExt.R’ [12s/16s]
  Running ‘glmmWeights.R’ [13s/18s]
  Running ‘hatvalues.R’
  Running ‘is.R’
  Running ‘lmList-tst.R’
  Running ‘lme4_nlme.R’
  Running ‘lmer-0.R’
  Running ‘lmer-1.R’
  Running ‘lmer-conv.R’
  Running ‘lmer2_ex.R’
  Running ‘methods.R’
  Running ‘minval.R’
  Running ‘modFormula.R’
  Running ‘nbinom.R’
  Running ‘nlmer-conv.R’
  Running ‘nlmer.R’
  Running ‘offset.R’
  Running ‘optimizer.R’
  Running ‘polytomous.R’
  Running ‘prLogistic.R’
  Running ‘predict_basis.R’
  Running ‘predsim.R’
  Running ‘priorWeights.R’
  Running ‘priorWeightsModComp.R’
  Running ‘profile-tst.R’
  Running ‘refit.R’
  Running ‘resids.R’
  Running ‘respiratory.R’ [11s/16s]
  Running ‘simulate.R’
  Running ‘test-glmernbref.R’
  Running ‘testOptControl.R’
  Running ‘testcolonizer.R’
  Running ‘testcrab.R’ [13s/19s]
  Running ‘throw.R’
  Running ‘varcorr.R’
  Running ‘vcov-etc.R’
Running the tests in ‘tests/AAAtest-all.R’ failed.
Complete output:
  > if (base::require("testthat", quietly = TRUE)) {
  +     pkg   <- "lme4"
  +     require(pkg, character.only=TRUE, quietly=TRUE)
  +     if(getRversion() < "3.5.0") { withAutoprint <- identity ; prt <- print } else { prt <- identity }
  +     if(Sys.getenv("USER") %in% c("maechler", "bbolker")) withAutoprint({
  +         ## for developers' sake:
  +         lP <- .libPaths() # ---- .libPaths() : ----
  +         prt(lP)
  +         ## ---- Entries in .libPaths()[1] : ----
  +         prt(list.files(lP[1], include.dirs=TRUE))
  +         prt(sessionInfo())
  +         prt(packageDescription("Matrix"))
  +         ## 'lme4' from packageDescription "file" :
  +         prt(attr(packageDescription("lme4"), "file"))
  +     })
  +     test_check(pkg)
  +     ##======== ^^^
  +     print(warnings()) # TODO? catch most of these by expect_warning(..)
  + } else {
  +     cat( "package 'testthat' not available, cannot run unit tests\n" )
  + }
  [ FAIL 24 | WARN 80 | SKIP 1 | PASS 455 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • On CRAN (1): 'test-eval.R:2:1'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-lmer.R:38:5'): lmer ──────────────────────────────────────────
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 2265 - 1764 == 501
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-lmer.R:38:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-lmer.R:49:5'): lmer ──────────────────────────────────────────
  `x` not equal to `expected`.
  1/1 mismatches
  [1] Inf - 320 == Inf
  Backtrace:
      ▆
   1. └─testthat::expect_that(REMLcrit(fm1), equals(319.654276842342)) at test-lmer.R:49:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-lmer.R:52:5'): lmer ──────────────────────────────────────────
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 48.6 - 49.5 == -0.886
  Backtrace:
      ▆
   1. └─testthat::expect_that(sigma(fm1), equals(49.5101272946856, tolerance = 1e-06)) at test-lmer.R:52:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-lmer.R:58:5'): lmer ──────────────────────────────────────────
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 456 - 376 == 80.6
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-lmer.R:58:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-lmer.R:64:5'): lmer ──────────────────────────────────────────
  `x` not equivalent to `expected`.
  1/1 mismatches
  [1] 12.1 - 0 == 12.1
  Backtrace:
      ▆
   1. └─testthat::expect_that(VarCorr(fm2)[[1]][1, 1], is_equivalent_to(0)) at test-lmer.R:64:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equivalent(x, expected, expected.label = label)
  ── Failure ('test-lmer.R:65:5'): lmer ──────────────────────────────────────────
  `x` not equivalent to `expected`.
  1/1 mismatches
  [1] 0.979 - 0 == 0.979
  Backtrace:
      ▆
   1. └─testthat::expect_that(getME(fm2, "theta"), is_equivalent_to(0)) at test-lmer.R:65:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equivalent(x, expected, expected.label = label)
  ── Failure ('test-lmer.R:74:5'): lmer ──────────────────────────────────────────
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 0.979 - 0.848 == 0.13
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-lmer.R:74:5
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Error ('test-lmer.R:117:5'): lmer ───────────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. ├─testthat::expect_is(...) at test-lmer.R:117:5
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─lme4::lmer(Yield ~ 1 | Batch, Dyestuff, REML = TRUE)
   5.   └─lme4::optimizeLmer(...)
   6.     └─lme4:::optwrap(...)
  ── Error ('test-lmer.R:286:5'): coef_lmer ──────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(resp ~ 0 + var1 + var1:var2 + (1 | var3), data = d) at test-lmer.R:286:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-lmer.R:335:1'): (code run outside of `test_that()`) ────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy) at test-lmer.R:335:1
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-methods.R:45:1'): (code run outside of `test_that()`) ──────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(...) at test-methods.R:45:1
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-predict.R:422:3'): prediction with . in formula + newdata ──────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(dv ~ . - groups + (1 | groups), data = train) at test-predict.R:422:3
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-predict.R:445:3'): prediction standard error ───────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Petal.Width ~ Sepal.Length + (1 | Species), iris) at test-predict.R:445:3
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-predict.R:478:5'): NA + re.form = NULL + simulate OK (GH #737) ──
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Reaction ~ Days + (Days | Subject), d) at test-predict.R:478:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-predict.R:501:5'): predict works with factors in left-out REs ──
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(yield ~ 1 + (1 | g1) + (lc | g3), data = df2, control = lmerControl(check.conv.singular = "ignore")) at test-predict.R:501:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-predict.R:514:5'): predict works with dummy() in left-out REs ──
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(...) at test-predict.R:514:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-ranef.R:34:5'): Dyestuff consistent with lme4.0 ────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Yield ~ 1 | Batch, Dyestuff, REML = FALSE) at test-ranef.R:34:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-ranef.R:43:9'): sleepstudy consistent with lme4.0 ──────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy) at test-ranef.R:43:9
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-ranef.R:61:5'): multiple terms work ────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(...) at test-ranef.R:61:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Error ('test-rank.R:14:5'): lmerRank ────────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. ├─testthat::expect_message(...) at test-rank.R:14:5
   2. │ └─testthat:::quasi_capture(enquo(object), label, capture_messages)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─lme4::lmer(z ~ x + y + (1 | r), data = d)
   7.   └─lme4::optimizeLmer(...)
   8.     └─lme4:::optwrap(...)
  ── Error ('test-rank.R:101:5'): ranksim ────────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. ├─base::suppressMessages(lmer(y ~ x1 + x2 + (1 | id), data = x)) at test-rank.R:101:5
   2. │ └─base::withCallingHandlers(...)
   3. └─lme4::lmer(y ~ x1 + x2 + (1 | id), data = x)
   4.   └─lme4::optimizeLmer(...)
   5.     └─lme4:::optwrap(...)
  ── Error ('test-resids.R:7:5'): lmer ───────────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(Reaction ~ Days + (Days | Subject), sleepstudy, control = C1) at test-resids.R:7:5
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  ── Failure ('test-start.R:39:9'): lmer ─────────────────────────────────────────
  AIC(x) not equal to 1763.939344.
  1/1 mismatches
  [1] Inf - 1764 == Inf
  ── Error ('test-summary.R:32:3'): lmer ─────────────────────────────────────────
  Error in `optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower, 
      control = control, adj = FALSE, verbose = verbose, ...)`: (converted from warning) convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Backtrace:
      ▆
   1. └─lme4::lmer(y ~ x.1 + x.2 + (1 + x.1 | g), control = C1) at test-summary.R:32:3
   2.   └─lme4::optimizeLmer(...)
   3.     └─lme4:::optwrap(...)
  
  [ FAIL 24 | WARN 80 | SKIP 1 | PASS 455 ]
  Error: Test failures
  Execution halted
Running the tests in ‘tests/REMLdev.R’ failed.
Complete output:
  > library(lme4)
  Loading required package: Matrix
  > ## show important current settings {for reference, etc} -- [early, and also on Windows !]:
  > str( lmerControl())
  List of 8
   $ optimizer      : chr "nloptwrap"
   $ restart_edge   : logi TRUE
   $ boundary.tol   : num 1e-05
   $ calc.derivs    : logi TRUE
   $ use.last.params: logi FALSE
   $ checkControl   :List of 8
    ..$ check.nobs.vs.rankZ: chr "ignore"
    ..$ check.nobs.vs.nlev : chr "stop"
    ..$ check.nlev.gtreq.5 : chr "ignore"
    ..$ check.nlev.gtr.1   : chr "stop"
    ..$ check.nobs.vs.nRE  : chr "stop"
    ..$ check.rankX        : chr "message+drop.cols"
    ..$ check.scaleX       : chr "warning"
    ..$ check.formula.LHS  : chr "stop"
   $ checkConv      :List of 3
    ..$ check.conv.grad    :List of 3
    .. ..$ action: chr "warning"
    .. ..$ tol   : num 0.002
    .. ..$ relTol: NULL
    ..$ check.conv.singular:List of 2
    .. ..$ action: chr "message"
    .. ..$ tol   : num 1e-04
    ..$ check.conv.hess    :List of 2
    .. ..$ action: chr "warning"
    .. ..$ tol   : num 1e-06
   $ optCtrl        : list()
   - attr(*, "class")= chr [1:2] "lmerControl" "merControl"
  > str(glmerControl())
  List of 11
   $ optimizer      : chr [1:2] "bobyqa" "Nelder_Mead"
   $ restart_edge   : logi FALSE
   $ boundary.tol   : num 1e-05
   $ calc.derivs    : logi TRUE
   $ use.last.params: logi FALSE
   $ checkControl   :List of 9
    ..$ check.nobs.vs.rankZ     : chr "ignore"
    ..$ check.nobs.vs.nlev      : chr "stop"
    ..$ check.nlev.gtreq.5      : chr "ignore"
    ..$ check.nlev.gtr.1        : chr "stop"
    ..$ check.nobs.vs.nRE       : chr "stop"
    ..$ check.rankX             : chr "message+drop.cols"
    ..$ check.scaleX            : chr "warning"
    ..$ check.formula.LHS       : chr "stop"
    ..$ check.response.not.const: chr "stop"
   $ checkConv      :List of 3
    ..$ check.conv.grad    :List of 3
    .. ..$ action: chr "warning"
    .. ..$ tol   : num 0.002
    .. ..$ relTol: NULL
    ..$ check.conv.singular:List of 2
    .. ..$ action: chr "message"
    .. ..$ tol   : num 1e-04
    ..$ check.conv.hess    :List of 2
    .. ..$ action: chr "warning"
    .. ..$ tol   : num 1e-06
   $ optCtrl        : list()
   $ tolPwrss       : num 1e-07
   $ compDev        : logi TRUE
   $ nAGQ0initStep  : logi TRUE
   - attr(*, "class")= chr [1:2] "glmerControl" "merControl"
  > str(nlmerControl())
  List of 3
   $ optimizer: chr [1:2] "Nelder_Mead" "Nelder_Mead"
   $ tolPwrss : num 1e-10
   $ optCtrl  : list()
   - attr(*, "class")= chr [1:2] "nlmerControl" "merControl"
  > ls.str(environment(nloptwrap))
  defaultControl : List of 4
   $ algorithm: chr "NLOPT_LN_BOBYQA"
   $ xtol_abs : num 1e-08
   $ ftol_abs : num 1e-08
   $ maxeval  : num 1e+05
  > ##
  > fm1 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
  Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  > fm1ML <- refitML(fm1)
  > REMLcrit(fm1)
  [1] Inf
  > deviance(fm1ML)
  [1] 1751.939
  > deviance(fm1,REML=FALSE)  ## FIXME: not working yet (NA)
  [1] 1784.642
  > deviance(fm1,REML=TRUE)
  [1] 1784.642
  > 
  > ## from lme4.0
  > oldvals <- c(REML=1743.6282722424, ML=1751.98581103058)
  > ## leave out ML values for REML fits for now ...
  > stopifnot(
  +           all.equal(REMLcrit(fm1),deviance(fm1,REML=TRUE),deviance(fm1ML,REML=TRUE),oldvals["REML"]),
  +           all.equal(deviance(fm1ML),deviance(fm1ML,REML=FALSE),oldvals["ML"]),
  +           all.equal(REMLcrit(fm1)/-2,c(logLik(fm1)),c(logLik(fm1ML,REML=TRUE)),c(logLik(fm1,REML=TRUE))),
  +           all.equal(deviance(fm1ML)/-2,c(logLik(fm1ML,REML=FALSE)),
  +                     c(logLik(fm1ML,REML=FALSE))))
  Error: REMLcrit(fm1) and deviance(fm1, REML = TRUE) are not equal:
    Mean scaled difference: Inf
  Execution halted
Running the tests in ‘tests/boundary.R’ failed.
Complete output:
  > ## In both of these cases boundary fit (i.e. estimate of zero RE
  > ## variance) is *incorrect*. (Nelder_Mead, restart_edge=FALSE) is the
  > ## only case where we get stuck; either optimizer=bobyqa or
  > ## restart_edge=TRUE (default) works
  > if (.Platform$OS.type != "windows") {
  + 
  +     library(lme4)
  +     library(testthat)
  + 
  +     if(!dev.interactive(orNone=TRUE)) pdf("boundary_plots.pdf")
  + 
  +     ## Stephane Laurent:
  +     dat <- read.csv(system.file("testdata","dat20101314.csv", package="lme4"))
  + 
  +     fit   <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat,
  +                   control= lmerControl(optimizer="Nelder_Mead"))
  +     fit_b <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat,
  +                   control= lmerControl(optimizer="bobyqa", restart_edge=FALSE))
  +     fit_c <- lmer(y ~ (1|Operator)+(1|Part)+(1|Part:Operator), data=dat,
  +                   control= lmerControl(optimizer="Nelder_Mead", restart_edge=FALSE,
  +                                        check.conv.hess="ignore"))
  +     ## final fit gives degenerate-Hessian warning
  +     ## FIXME: use fit_c with expect_warning() as a check on convergence tests
  +     ## tolerance=1e-5 seems OK in interactive use but not in R CMD check ... ??
  +     stopifnot(all.equal(getME(fit,  "theta") -> th.f,
  +                         getME(fit_b,"theta"), tolerance=5e-5),
  +               all(th.f > 0))
  + 
  +     ## Manuel Koller
  + 
  +     source(system.file("testdata", "koller-data.R", package="lme4"))
  +     ldata <- getData(13)
  +     ## old (backward compatible/buggy)
  +     fm4  <- lmer(y ~ (1|Var2), ldata, control=lmerControl(optimizer="Nelder_Mead",
  +                                                           use.last.params=TRUE),
  +                  start=list(theta=1))
  + 
  +     fm4b <- lmer(y ~ (1|Var2), ldata,
  +                  control = lmerControl(optimizer="Nelder_Mead", use.last.params=TRUE,
  +                                        restart_edge = FALSE,
  +                                        check.conv.hess="ignore", check.conv.grad="ignore"),
  +                  start = list(theta=1))
  +     ## FIXME: use as convergence test check
  +     stopifnot(getME(fm4b,"theta") == 0)
  +     fm4c <- lmer(y ~ (1|Var2), ldata, control=lmerControl(optimizer="bobyqa",
  +                                                           use.last.params=TRUE),
  +                  start=list(theta=1))
  +     stopifnot(all.equal(getME(fm4, "theta") -> th4,
  +                         getME(fm4c,"theta"), tolerance=1e-4),
  +               th4 > 0)
  + 
  + 
  +     ## new: doesn't get stuck at edge any more,  but gets stuck somewhere else ...
  +     fm5 <- lmer(y ~ (1|Var2), ldata, control=lmerControl(optimizer="Nelder_Mead",
  +                                                          check.conv.hess="ignore",
  +                                                          check.conv.grad="ignore"),
  +                 start=list(theta=1))
  +     fm5b <- lmer(y ~ (1|Var2), ldata, control=lmerControl(optimizer="Nelder_Mead",
  +                                                           restart_edge=FALSE,
  +                                                           check.conv.hess="ignore",
  +                                                           check.conv.grad="ignore"),
  +                  start = list(theta = 1))
  +     fm5c <- lmer(y ~ (1|Var2), ldata, control=lmerControl(optimizer="bobyqa"),
  +                  start = list(theta = 1))
  +     stopifnot(all.equal(unname(getME(fm5c,"theta")), 0.21067645, tolerance = 1e-7))
  + 					#	 0.21067644264 [64-bit, lynne]
  + 
  +     if (require("optimx")) {
  +     ## additional stuff for diagnosing Nelder-Mead problems.
  + 
  +     fm5d <- update(fm5,control=lmerControl(optimizer="optimx",
  +                                            optCtrl=list(method="L-BFGS-B")))
  + 
  +     fm5e <- update(fm5, control=lmerControl(optimizer="nloptwrap"))
  + 
  +     mList <- setNames(list(fm4,fm4b,fm4c,fm5,fm5b,fm5c,fm5d,fm5e),
  +                       c("NM/uselast","NM/uselast/norestart","bobyqa/uselast",
  +                         "NM","NM/norestart","bobyqa","LBFGSB","nloptr/bobyqa"))
  +     pp <- profile(fm5c,which=1)
  +     dd <- as.data.frame(pp)
  +     par(las=1,bty="l")
  +     v <- sapply(mList,
  +                 function(x) sqrt(VarCorr(x)[[1]]))
  +     plot(.zeta^2~.sig01, data=dd, type="b")
  +     abline(v=v)
  + 
  +     res <- cbind(VCorr  = sapply(mList, function(x) sqrt(VarCorr(x)[[1]])),
  +                  theta  = sapply(mList, getME,"theta"),
  +                  loglik = sapply(mList, logLik))
  +     res
  +     print(sessionInfo(), locale=FALSE)
  +     }
  + 
  + ######################
  +     library(lattice)
  +     ## testing boundary and near-boundary cases
  + 
  +     tmpf <- function(i,...) {
  +         set.seed(i)
  +         d <- data.frame(x=rnorm(60),f=factor(rep(1:6,each=10)))
  +         d$y <- simulate(~x+(1|f),family=gaussian,newdata=d,
  +                         newparams=list(theta=0.01,beta=c(1,1),sigma=5))[[1]]
  +         lmer(y~x+(1|f),data=d,...)
  +     }
  +     sumf <- function(m) {
  +         unlist(VarCorr(m))[1]
  +     }
  +     if (FALSE) {
  +         ## figuring out which seeds will give boundary and
  +         ## near-boundary solutions
  +         mList <- lapply(1:201,tmpf) # [FIXME tons of messages "theta parameters vector not named"]
  +         ss <- sapply(mList,sumf)+1e-50
  +         par(las=1,bty="l")
  +         hist(log(ss),col="gray",breaks=50)
  +         ## values lying on boundary
  +         which(log(ss)<(-40))   ## 5, 7-13, 15, 21, ...
  +         ## values close to boundary (if check.edge not set)
  +         which(log(ss)>(-40) & log(ss) <(-20))  ## 16, 44, 80, 86, 116, ...
  +     }
  +     ## diagnostic plot
  +     tmpplot <- function(i, FUN=tmpf) {
  +         dd <- FUN(i, devFunOnly=TRUE)
  +         x <- 10^seq(-10,-6.5,length=201)
  +         dvec <- sapply(x,dd)
  +         op <- par(las=1,bty="l"); on.exit(par(op))
  +         plot(x,dvec-min(dvec)+1e-16, log="xy", type="b")
  +         r <- FUN(i)
  +         abline(v = getME(r,"theta"), col=2)
  +         invisible(r)
  +     }
  + 
  +     ## Case #1: boundary estimate with or without boundary.tol
  +     m5  <- tmpf(5)
  +     m5B <- tmpf(5,control=lmerControl(boundary.tol=0))
  +     stopifnot(getME(m5, "theta")==0,
  +               getME(m5B,"theta")==0)
  +     p5 <- profile(m5)  ## bobyqa warnings but results look reasonable
  +     xyplot(p5)
  +     ## reveals slight glitch (bottom row of plots doesn't look right)
  +     expect_warning(splom(p5),"unreliable for singular fits")
  +     p5B <- profile(m5, signames=FALSE) # -> bobyqa convergence warning (code 3)
  +     expect_warning(splom(p5B), "unreliable for singular fits")
  + 
  +     if(lme4:::testLevel() >= 2) { ## avoid failure to warn
  +         ## Case #2: near-boundary estimate, but boundary.tol can't fix it
  +         m16 <- tmpplot(16)
  +         ## sometimes[2014-11-11] fails (??) :
  +         p16 <- profile(m16)  ## warning message*s* (non-monotonic profile and more)
  +         plotOb <- xyplot(p16)
  +         ## NB: It's the print()ing of 'plotOb' which warns ==> need to do this explicitly:
  +         expect_warning(print(plotOb), ## warns about linear interpolation in profile for variable 1
  +                        "using linear interpolation")
  +         d16 <- as.data.frame(p16)
  +         xyplot(.zeta ~ .focal|.par, data=d16, type=c("p","l"),
  +                scales = list(x=list(relation="free")))
  +         try(splom(p16))  ## breaks when calling predict(.)
  +     }
  + 
  +     ## bottom line:
  +     ##  * xyplot.thpr could still be improved
  +     ##  * most of the near-boundary cases are noisy and can't easily be
  +     ##    fixed
  + 
  +     tmpf2 <- function(i,...) {
  +         set.seed(i)
  +         d <- data.frame(x=rnorm(60),f=factor(rep(1:6,each=10)),
  +                         w=rep(10,60))
  +         d$y <- simulate(~x+(1|f),family=binomial,
  +                         weights=d$w,newdata=d,
  +                         newparams=list(theta=0.01,beta=c(1,1)))[[1]]
  +         glmer(y~x+(1|f),data=d,family=binomial,weights=w,...)
  +     }
  + 
  +     if (FALSE) {
  +         ## figuring out which seeds will give boundary and
  +         ## near-boundary solutions
  +         mList <- lapply(1:201,tmpf2)
  +         ss <- sapply(mList,sumf)+1e-50
  +         par(las=1,bty="l")
  +         hist(log(ss),col="gray",breaks=50)
  +         ## values lying on boundary
  +         head(which(log(ss)<(-50)))   ## 1-5, 7 ...
  +         ## values close to boundary (if check.edge not set)
  +         which(log(ss)>(-50) & log(ss) <(-20))  ## 44, 46, 52, ...
  +     }
  + 
  +     ##  m1 <- tmpf2(1)
  + 
  +     ## FIXME: doesn't work if we generate m1 via tmpf2(1) --
  +     ## some environment lookup problem ...
  + 
  +     set.seed(1)
  +     d <- data.frame(x=rnorm(60),f=factor(rep(1:6,each=10)),
  +                     w=rep(10,60))
  +     d$y <- simulate(~x+(1|f),family=binomial,
  +                     weights=d$w,newdata=d,
  +                     newparams=list(theta=0.01,beta=c(1,1)))[[1]]
  +     m1 <- glmer(y~x+(1|f),data=d,family=binomial,weights=w)
  + 
  +     p1 <- profile(m1)
  +     xyplot(p1)
  +     expect_warning(splom(p1),"splom is unreliable")
  + 
  + } ## skip on windows (for speed)
  Loading required package: Matrix
  boundary (singular) fit: see help('isSingular')
  Loading required package: optimx
  R Under development (unstable) (2025-02-19 r87749)
  Platform: x86_64-pc-linux-gnu
  Running under: Fedora Linux 40 (Workstation Edition)
  
  Matrix products: default
  BLAS:   /data/gannet/ripley/R/R-clang/lib/libRblas.so 
  LAPACK: /data/gannet/ripley/R/R-clang/lib/libRlapack.so;  LAPACK version 3.12.0
  
  attached base packages:
  [1] stats     graphics  grDevices utils     datasets  methods   base     
  
  other attached packages:
  [1] optimx_2024-12.2 testthat_3.2.3   lme4_1.1-36      Matrix_1.7-2    
  
  loaded via a namespace (and not attached):
   [1] R6_2.6.1            numDeriv_2016.8-1.1 lattice_0.22-6     
   [4] magrittr_2.0.3      splines_4.5.0       cli_3.6.4          
   [7] Rdpack_2.6.2        nloptr_2.1.1        grid_4.5.0         
  [10] reformulas_0.4.0    compiler_4.5.0      boot_1.3-31        
  [13] rbibutils_2.3       tools_4.5.0         pracma_2.4.4       
  [16] brio_1.1.5          nlme_3.1-167        minqa_1.2.8        
  [19] Rcpp_1.0.14         rlang_1.1.5         MASS_7.3-64        
  Error: getME(m5, "theta") == 0 is not TRUE
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  4: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  5: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 2.07244 (tol = 0.002, component 1)
  6: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  7: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 2.07244 (tol = 0.002, component 1)
  Execution halted
Running the tests in ‘tests/falsezero_dorie.R’ failed.
Complete output:
  > if (.Platform$OS.type != "windows") {
  +     ## test of false zero problem reported by Vince Dorie
  +     ## (no longer occurs with current development lme4)
  +     ## https://github.com/lme4/lme4/issues/17
  +     library(lme4)
  + 
  +     sigma.eps <- 2
  +     sigma.the <- 0.75
  +     mu <- 2
  + 
  +     n <- 5
  +     J <- 10
  +     g <- gl(J, n)
  + 
  +     set.seed(1)
  + 
  +     theta <- rnorm(J, 0, sigma.eps * sigma.the)
  +     y <- rnorm(n * J, mu + theta[g], sigma.eps)
  +     lmerFit <- lmer(y ~ 1 + (1 | g), REML = FALSE, verbose=TRUE)
  + 
  +     y.bar <- mean(y)
  +     y.bar.j <- sapply(1:J, function(j) mean(y[g == j]))
  +     S.w <- sum((y - y.bar.j[g])^2)
  +     S.b <- n * sum((y.bar.j - y.bar)^2)
  +     R <- S.b / S.w
  + 
  +     sigma.the.hat <- sqrt(max((n - 1) * R / n - 1 / n, 0))
  +     stopifnot(all.equal(sigma.the.hat,lme4Sigma <- unname(getME(lmerFit,"theta")),
  +                         tolerance=2e-5))
  + } ## skip on windows (for speed)
  Loading required package: Matrix
  Error: sigma.the.hat and lme4Sigma <- unname(getME(lmerFit, "theta")) are not equal:
    Mean relative difference: 1.134618
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 2.17399 (tol = 0.002, component 1)
  Execution halted
Running the tests in ‘tests/lme4_nlme.R’ failed.
Complete output:
  > if (lme4:::testLevel() > 1 || .Platform$OS.type != "windows") withAutoprint({
  + 
  +     ## testing whether lme4 and nlme play nicely.  Only known issue
  +     ## is lmList-masking ...
  +     library("lme4")
  +     library("nlme")
  +     fm1_lmer <- lmer(Reaction ~ Days   +       (Days|Subject), sleepstudy)
  +     fm1_lme  <- lme (Reaction ~ Days, random = ~Days|Subject,  sleepstudy)
  +     ## variance-covariance matrices: annoyingly different structures
  +     vc_lmer <- VarCorr(fm1_lmer)
  +     vc_lme  <- VarCorr(fm1_lme, rdig = 8)
  +     suppressWarnings(storage.mode(vc_lme) <- "numeric")# 2 NAs
  +     vc_lmerx <- c(diag(vc_lmer[[1]]), attr(vc_lmer[[1]],"correlation")[1,2])
  +     vc_lmex  <- c( vc_lme[1:2,1],     vc_lme[2,3])
  +     stopifnot(
  +         all.equal(vc_lmex, vc_lmerx, tolerance= 4e-4) # had 3e-5, now see 0.000296
  +       , ## fixed effects (much easier) :
  +         all.equal(fixef(fm1_lmer), fixef(fm1_lme)) # 3.6e-15
  +        ,
  +         all.equal(unname(unlist(unclass(ranef(fm1_lmer)))),
  +                   unname(unlist(unclass(ranef(fm1_lme)))),
  +                   tolerance = 2e-4) # had 2e-5, now see 8.41e-5
  +     )
  + 
  +     fm1L_lme  <- nlme::lmList(distance ~ age | Subject, Orthodont)
  +     fm1L_lmer <- lme4::lmList(distance ~ age | Subject, Orthodont)
  +     stopifnot(all.equal(fixef(fm1L_lmer),
  +                         fixef(fm1L_lme)))
  +     sm1L_e  <- summary(fm1L_lme)
  +     sm1L_er <- summary(fm1L_lmer)
  +     stopifnot(
  +         all.equal(coef(sm1L_e),
  +                   coef(sm1L_er), tol=1e-12)# even tol=0 works on some Lnx 64b
  +     )
  + 
  +     ## FIXME: test opposite order
  + })
  > library("lme4")
  Loading required package: Matrix
  > library("nlme")
  
  Attaching package: 'nlme'
  
  The following object is masked from 'package:lme4':
  
      lmList
  
  > fm1_lmer <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
  > fm1_lme <- lme(Reaction ~ Days, random = ~Days | Subject, sleepstudy)
  > vc_lmer <- VarCorr(fm1_lmer)
  > vc_lme <- VarCorr(fm1_lme, rdig = 8)
  > suppressWarnings(storage.mode(vc_lme) <- "numeric")
  > vc_lmerx <- c(diag(vc_lmer[[1]]), attr(vc_lmer[[1]], "correlation")[1, 
  +     2])
  > vc_lmex <- c(vc_lme[1:2, 1], vc_lme[2, 3])
  > stopifnot(all.equal(vc_lmex, vc_lmerx, tolerance = 4e-04), all.equal(fixef(fm1_lmer), 
  +     fixef(fm1_lme)), all.equal(unname(unlist(unclass(ranef(fm1_lmer)))), unname(unlist(unclass(ranef(fm1_lme)))), 
  +     tolerance = 2e-04))
  Error: vc_lmex and vc_lmerx are not equal:
    Mean relative difference: 0.8916242
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  Execution halted
Running the tests in ‘tests/lmer-0.R’ failed.
Complete output:
  > require(lme4)
  Loading required package: lme4
  Loading required package: Matrix
  > source(system.file("test-tools-1.R", package = "Matrix"))# identical3() etc
  Loading required package: tools
  > 
  > ## use old (<=3.5.2) sample() algorithm if necessary
  > if ("sample.kind" %in% names(formals(RNGkind))) {
  +     suppressWarnings(RNGkind("Mersenne-Twister", "Inversion", "Rounding"))
  + }
  > 
  > ## Check that quasi families throw an error
  > assertError(lmer(cbind(incidence, size - incidence) ~ period + (1|herd),
  +                  data = cbpp, family = quasibinomial))
  > assertError(lmer(incidence ~ period + (1|herd),
  +                  data = cbpp, family = quasipoisson))
  > assertError(lmer(incidence ~ period + (1|herd),
  +                  data = cbpp, family = quasi))
  > 
  > ## check bug found by Kevin Buhr
  > set.seed(7)
  > n <- 10
  > X <- data.frame(y=runif(n), x=rnorm(n), z=sample(c("A","B"), n, TRUE))
  > fm <- lmer(log(y) ~ x | z, data=X)  ## ignore grouping factors with
  Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  3: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  > ## gave error inside  model.frame()
  > stopifnot(all.equal(c(`(Intercept)` = -0.834544), fixef(fm), tolerance=.01))
  Error: c(`(Intercept)` = -0.834544) and fixef(fm) are not equal:
    Mean relative difference: 0.4954795
  Execution halted
Running the tests in ‘tests/minval.R’ failed.
Complete output:
  > if (lme4:::testLevel() > 1 || .Platform$OS.type!="windows") {
  +     ## example posted by Stéphane Laurent
  +     ## exercises bug where Nelder-Mead min objective function value was >0
  +     set.seed(666)
  +     sims <- function(I, J, sigmab0, sigmaw0){
  +         Mu <- rnorm(I, mean=0, sd=sigmab0)
  +         y <- c(sapply(Mu, function(mu) rnorm(J, mu, sigmaw0)))
  +         data.frame(y=y, group=gl(I,J))
  +     }
  + 
  +     I <- 3  # number of groups
  +     J <- 8  # number of repeats per group
  +     sigmab0 <- 0.15  # between standard deviation
  +     sigmaw0 <- 0.15  # within standard deviation
  + 
  +     dat <- sims(I, J, sigmab0, sigmaw0)
  + 
  +     library(lme4)
  +     isOldTol <- environment(nloptwrap)$defaultControl$xtol_abs == 1e-6
  + 
  +     fm3 <- lmer(y ~ (1|group), data=dat)
  +     stopifnot(all.equal(unname(unlist(VarCorr(fm3))),
  +                         switch(fm3@optinfo$optimizer,
  +                                "Nelder_Mead" = 0.029662844,
  +                                "bobyqa"      = 0.029662698,
  +                                "nloptwrap"   =
  +                                    if (isOldTol) 0.029679755 else 0.029662699,
  +                                stop("need new case here: value is ",unname(unlist(VarCorr(fm3))))
  +                                ),
  +                         tolerance = 1e-7))
  + } ## skip on windows (for speed)
  Loading required package: Matrix
  Error: unname(unlist(VarCorr(fm3))) and switch(fm3@optinfo$optimizer, Nelder_Mead = 0.029662844, bobyqa = 0.029662698,  .... are not equal:
    Mean relative difference: 0.1265733
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 0.147111 (tol = 0.002, component 1)
  Execution halted
Running the tests in ‘tests/modFormula.R’ failed.
Complete output:
  > if (.Platform$OS.type != "windows") {
  +     library(lme4)
  +     library(testthat)
  + 
  +     .get.checkingOpts <- lme4:::.get.checkingOpts
  +     stopifnot(identical(
  +         .get.checkingOpts(
  +             c("CheckMe", "check.foo", "check.conv.1", "check.rankZ", "check.rankX"))
  +       , c("check.foo", "check.rankZ")))
  + 
  +     lmod <- lFormula(Reaction ~ Days + (Days|Subject), sleepstudy)
  +     devfun <- do.call(mkLmerDevfun, lmod)
  +     opt <- optimizeLmer(devfun)
  +     cc <- lme4:::checkConv(attr(opt,"derivs"), opt$par, ctrl = lmerControl()$checkConv,
  +                            lbound=environment(devfun)$lower)
  +     fm1 <- mkMerMod(environment(devfun), opt, lmod$reTrms, fr = lmod$fr,
  +                     lme4conv=cc)
  +     fm2 <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy)
  + 
  +     ## basic equivalence
  +     fm1C <- fm1
  +     fm1C@call <- fm2@call
  +     expect_equal(fm2,fm1C)
  +     expect_equal(range(residuals(fm1)), c(-101.18, 132.547), tolerance = 1e-5) # these are "outliers"!
  +     expect_is(model.frame(fm1),"data.frame")
  +     ## formulae
  +     mfm1 <- model.frame(fm1)
  +     expect_equal(formula(fm1),         Reaction ~ Days + (Days | Subject))
  +     expect_equal(formula(terms(mfm1)), Reaction ~ Days + (Days + Subject))
  +     new_form_modframe <- (getRversion() >= "3.6.0" &&
  +                           as.numeric(version[["svn rev"]]) >= 75891)
  +     expect_equal(formula(mfm1),
  +                  if(new_form_modframe) {
  +                      Reaction ~ Days + (Days + Subject)
  +                  } else
  +                      Reaction ~ Days + Subject
  +                  )
  +     ## predictions
  +     expect_equal(predict(fm1,newdata=sleepstudy[1:10,],re.form=NULL),
  +                  predict(fm2,newdata=sleepstudy[1:10,],re.form=NULL))
  +     expect_equal(predict(fm1,newdata=sleepstudy),
  +                  predict(fm1))
  + 
  +     lmodOff <- lFormula(Reaction ~ Days + (Days|Subject) + offset(0.5*Days),
  +                         sleepstudy)
  +     devfunOff <- do.call(mkLmerDevfun, lmodOff)
  +     opt <- optimizeLmer(devfunOff)
  +     fm1Off <- mkMerMod(environment(devfunOff), opt, lmodOff$reTrms, fr = lmodOff$fr)
  +     fm2Off <- lmer(Reaction ~ Days + (Days|Subject) + offset(0.5*Days), sleepstudy)
  +     expect_equal(predict(fm1Off,newdata=sleepstudy[1:10,],re.form=NULL),
  +                  predict(fm2Off,newdata=sleepstudy[1:10,],re.form=NULL))
  + 
  +     ## FIXME: need more torture tests with offset specified, in different environments ...
  + 
  +     ## FIXME: drop1(.) doesn't work with modular objects ... hard to see how it
  +     ##  could, though ...
  +     ## drop1(fm1Off)
  +     drop1(fm2Off)
  + 
  + } ## skip on windows (for speed)
  Loading required package: Matrix
  Error: range(residuals(fm1)) not equal to c(-101.18, 132.547).
  2/2 mismatches (average diff: 2.42)
  [1] -106 - -101 == -4.708
  [2]  133 -  133 ==  0.129
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In lme4:::checkConv(attr(opt, "derivs"), opt$par, ctrl = lmerControl()$checkConv,  :
    unable to evaluate scaled gradient
  3: In lme4:::checkConv(attr(opt, "derivs"), opt$par, ctrl = lmerControl()$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  4: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  5: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  6: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  Execution halted
Running the tests in ‘tests/predsim.R’ failed.
Complete output:
  > ## compare range, average, etc. of simulations to
  > ## conditional and unconditional prediction
  > library(lme4)
  Loading required package: Matrix
  > do.plot <- FALSE
  > 
  > if (.Platform$OS.type != "windows") {
  + ## use old (<=3.5.2) sample() algorithm if necessary
  + if ("sample.kind" %in% names(formals(RNGkind))) {
  +     suppressWarnings(RNGkind("Mersenne-Twister", "Inversion", "Rounding"))
  + }
  + 
  + fm1 <- lmer(Reaction~Days+(1|Subject),sleepstudy)
  + set.seed(101)
  + pp <- predict(fm1)
  + rr <- range(usim2 <- simulate(fm1,1,use.u=TRUE)[[1]])
  + stopifnot(all.equal(rr,c(159.3896,439.1616),tolerance=1e-6))
  + if (do.plot) {
  +     plot(pp,ylim=rr)
  +     lines(sleepstudy$Reaction)
  +     points(simulate(fm1,1)[[1]],col=4)
  +     points(usim2,col=2)
  + }
  + 
  + set.seed(101)
  + 
  + ## conditional prediction
  + ss <- simulate(fm1,1000,use.u=TRUE)
  + ss_sum <- t(apply(ss,1,quantile,c(0.025,0.5,0.975)))
  + plot(pp)
  + matlines(ss_sum,col=c(1,2,1),lty=c(2,1,2))
  + stopifnot(all.equal(ss_sum[,2],pp,tolerance=5e-3))
  + 
  + ## population-level prediction
  + pp2 <- predict(fm1, re.form=NA)
  + ss2 <- simulate(fm1,1000,use.u=FALSE)
  + ss_sum2 <- t(apply(ss2,1,quantile,c(0.025,0.5,0.975)))
  + 
  + if (do.plot) {
  +     plot(pp2,ylim=c(200,400))
  +     matlines(ss_sum2,col=c(1,2,1),lty=c(2,1,2))
  + }
  + 
  + stopifnot(all.equal(ss_sum2[,2],pp2,tolerance=8e-3))
  + 
  + ## predict(...,newdata=...) on models with derived variables in the random effects
  + ## e.g. (f:g, f/g)
  + set.seed(101)
  + d <- expand.grid(f=factor(letters[1:10]),g=factor(letters[1:10]),
  +                  rep=1:10)
  + d$y <- rnorm(nrow(d))
  + m1 <- lmer(y~(1|f:g),d)
  + p1A <- predict(m1)
  + p1B <- predict(m1,newdata=d)
  + stopifnot(all.equal(p1A,p1B))
  + m2 <- lmer(y~(1|f/g),d)
  + p2A <- predict(m2)
  + p2B <- predict(m2,newdata=d)
  + stopifnot(all.equal(p2A,p2B))
  + 
  + ## with numeric grouping variables
  + dn <- transform(d,f=as.numeric(f),g=as.numeric(g))
  + m1N <- update(m1,data=dn)
  + p1NA <- predict(m1N)
  + p1NB <- predict(m1N,newdata=dn)
  + stopifnot(all.equal(p1NA,p1NB))
  + 
  + ## simulate with modified parameters
  + set.seed(1)
  + s1 <- simulate(fm1)
  + set.seed(1)
  + s2 <- simulate(fm1,newdata=model.frame(fm1),
  +                newparams=getME(fm1,c("theta","beta","sigma")))
  + all.equal(s1,s2)
  + 
  + fm0 <- update(fm1,.~.-Days)
  + ##
  + ## sim() -> simulate() -> refit() -> deviance
  + ##
  + 
  + ## predictions and simulations with offsets
  + 
  + set.seed(101)
  + d <- data.frame(y=rpois(100,5),x=rlnorm(100,1,1),
  +                 f=factor(sample(10,size=100,replace=TRUE)))
  + gm1 <- glmer(y~offset(log(x))+(1|f),data=d,
  +              family=poisson)
  + s1 <- simulate(gm1)
  + } ## skip on windows (for speed)
  Error: rr and c(159.3896, 439.1616) are not equal:
    Mean relative difference: 0.007853237
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 1.97927 (tol = 0.002, component 1)
  Execution halted
Running the tests in ‘tests/priorWeights.R’ failed.
Complete output:
  > ## use old (<=3.5.2) sample() algorithm if necessary
  > if ("sample.kind" %in% names(formals(RNGkind))) {
  +     suppressWarnings(RNGkind("Mersenne-Twister", "Inversion", "Rounding"))
  + }
  > 
  > 
  > compFunc <- function(lmeMod, lmerMod, tol = 1e-2){
  +     lmeVarCorr <- nlme:::VarCorr(lmeMod)[,"StdDev"]
  +     lmeCoef <- summary(lmeMod)$tTable[,-c(3,5)]
  +     lmeOut <- c(as.numeric(lmeVarCorr), as.numeric(lmeCoef))
  +     keep <- !is.na(lmeOut)
  +     lmeOut <- lmeOut[keep]
  +     dn <- dimnames(lmeCoef)
  +     if(is.null(dn)) dn <- list("", names(lmeCoef))
  +     names(lmeOut) <- c(
  +         paste(names(lmeVarCorr), "Var"),
  +         as.character(do.call(outer, c(dn, list("paste")))))[keep]
  + 
  +     ## get nested RE variances in the same order as nlme
  +     ## FIXME:  not sure if this works generally
  +     vcLmer <- VarCorr(lmerMod)
  +     vcLmer <- vcLmer[length(vcLmer):1]
  +     ##
  + 
  +     lmerVarCorr <- c(sapply(vcLmer, attr, "stddev"),
  +                      attr(VarCorr(lmerMod), "sc"))
  +     ## differentiate lme4{new} and lme4.0 :
  +     lmerCoef <- if(is(lmerMod, "merMod"))
  + 	summary(lmerMod)$coefficients else summary(lmerMod)@coefs
  +     lmerOut <- c(lmerVarCorr, as.numeric(lmerCoef))
  +     names(lmerOut) <- names(lmeOut)
  + 
  +     return(list(target = lmeOut, current = lmerOut, tolerance = tol))
  + }
  > 
  > if (.Platform$OS.type != "windows") {
  + set.seed(1)
  + nGroups <- 100
  + nObs <- 1000
  + 
  + # explanatory variable with a fixed effect
  + explVar1 <- rnorm(nObs)
  + explVar2 <- rnorm(nObs)
  + 
  + # random intercept among levels of a grouping factor
  + groupFac <- as.factor(rep(1:nGroups,each=nObs/nGroups))
  + randEff0 <- rep(rnorm(nGroups),each=nObs/nGroups)
  + randEff1 <- rep(rnorm(nGroups),each=nObs/nGroups)
  + randEff2 <- rep(rnorm(nGroups),each=nObs/nGroups)
  + 
  + # residuals with heterogeneous variance
  + residSD <- rpois(nObs,1) + 1
  + residError <- rnorm(nObs,sd=residSD)
  + 
  + # response variable
  + respVar <- randEff0 + (1+randEff1)*explVar1 + (1+randEff2)*explVar2 + residError
  + 
  + # rename to fit models on one line
  + y <- respVar
  + x <- explVar1
  + z <- explVar2
  + g <- groupFac
  + v <- residSD^2
  + w <- 1/v
  + 
  + library("nlme")
  + lmeMods <- list(
  +     ML1   = lme(y ~ x,   random = ~ 1|g,   weights = varFixed(~v), method = "ML"),
  +     REML1 = lme(y ~ x,   random = ~ 1|g,   weights = varFixed(~v), method = "REML"),
  +     ML2   = lme(y ~ x,   random = ~ x|g,   weights = varFixed(~v), method = "ML"),
  +     REML2 = lme(y ~ x,   random = ~ x|g,   weights = varFixed(~v), method = "REML"),
  +     ML1   = lme(y ~ x+z, random = ~ x+z|g, weights = varFixed(~v), method = "ML"),
  +     REML2 = lme(y ~ x+z, random = ~ x+z|g, weights = varFixed(~v), method = "REML"))
  + 
  + library("lme4")
  + lmerMods <- list(
  +     ML1 =   lmer(y ~ x +  (1|g),      weights = w, REML = FALSE),
  +     REML1 = lmer(y ~ x +  (1|g),      weights = w, REML = TRUE),
  +     ML2 =   lmer(y ~ x +  (x|g),      weights = w, REML = FALSE),
  +     REML2 = lmer(y ~ x +  (x|g),      weights = w, REML = TRUE),
  +     ML3 =   lmer(y ~ x + z + (x+z|g), weights = w, REML = FALSE),
  +     REML3 = lmer(y ~ x + z + (x+z|g), weights = w, REML = TRUE))
  + 
  + comp <- mapply(compFunc, lmeMods, lmerMods, SIMPLIFY=FALSE)
  + stopifnot(all(sapply(comp, do.call, what = all.equal)))
  + ## Look at the relative differences:
  + sapply(mapply(compFunc, lmeMods, lmerMods, SIMPLIFY=FALSE, tol = 0),
  +        do.call, what = all.equal)
  + 
  + ## add simulated weights to the sleepstudy example
  + n <- nrow(sleepstudy)
  + v <- rpois(n,1) + 1
  + w <- 1/v
  + sleepLme <- lme(Reaction ~ Days, random = ~ Days|Subject,
  +                 sleepstudy, weights = varFixed(~v),
  +                 method = "ML")
  + sleepLmer <- lmer(Reaction ~ Days + (Days|Subject),
  +                   sleepstudy, weights = w,
  +                   REML = FALSE)
  + sleepComp <- compFunc(sleepLme, sleepLmer)
  + stopifnot(do.call(all.equal, sleepComp))
  + ## look at relative differences:
  + sleepComp$tolerance <- 0
  + do.call(all.equal, sleepComp)
  + 
  + if (require("mlmRev")) {
  +     n <- nrow(Chem97)
  +     v <- rpois(n,1) + 1
  +     w <- 1/v
  +     Chem97Lme <- lme(score ~ 1, random = ~ 1|lea/school, Chem97)
  +     Chem97Lmer <- lmer(score ~ (1|lea/school), Chem97)
  +     Chem97Comp <- compFunc(Chem97Lme, Chem97Lmer)
  +     stopifnot(do.call(all.equal, Chem97Comp))
  +     ## look at relative differences:
  +     Chem97Comp$tolerance <- 0
  +     do.call(all.equal, Chem97Comp)
  + }
  + 
  + set.seed(2)
  + n <- 40
  + w <- runif(n)
  + x <- runif(n)
  + g <- factor(sample(1:10,n,replace=TRUE))
  + Z <- model.matrix(~g-1);
  + y <- Z%*%rnorm(ncol(Z)) + x + rnorm(n)/w^.5
  + m <- lmer(y ~ x + (1|g), weights=w, REML = TRUE)
  + 
  + ## CRAN-forbidden:
  + ## has4.0 <- require("lme4.0"))
  + has4.0 <- FALSE
  + if(has4.0) {
  +     ## m.0 <- lme4.0::lmer(y ~ x + (1|g), weights=w, REML = TRUE)
  +     lmer0 <- get("lmer", envir=asNamespace("lme4.0"))
  +     m.0 <- lmer0(y ~ x + (1|g), weights=w, REML = TRUE)
  +     dput(fixef(m.0)) # c(-0.73065400610675, 2.02895402562926)
  +     dput(sigma(m.0)) # 1.73614301673377
  +     dput(VarCorr(m.0)$g[1,1]) # 2.35670451590395
  +     dput(unname(coef(summary(m.0))[,"Std. Error"]))
  +     ## c(0.95070076853232, 1.37650858268602)
  + }
  + fixef_lme4.0 <- c(-0.7306540061, 2.0289540256)
  + sigma_lme4.0 <- 1.7361430
  + Sigma_lme4.0 <- 2.3567045
  + SE_lme4.0 <- c(0.95070077, 1.37650858)
  + if(has4.0) try(detach("package:lme4.0"))
  + 
  + stopifnot(all.equal(unname(fixef(m)), fixef_lme4.0, tolerance = 1e-3))
  +           all.equal(unname(fixef(m)), fixef_lme4.0, tolerance = 0) #-> 1.657e-5
  + 
  + ## but these are not at all equal :
  + (all.equal(sigma(m),                		sigma_lme4.0, tolerance = 10^-3)) # 0.4276
  + (all.equal(as.vector(VarCorr(m)$g), 		Sigma_lme4.0, tolerance = 10^-3)) # 1.038
  + (all.equal(as.vector(summary(m)$coefficients[,2]), SE_lme4.0, tolerance = 10^-3)) # 0.4276
  + ## so, lme4.0 was clearly wrong here
  + 
  + 
  + ##' make sure models that differ only in a constant
  + ##' prior weight have identical deviance:
  + fm <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy,REML=FALSE)
  + fm_wt <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy, weights = rep(5, nrow(sleepstudy)),REML=FALSE)
  + all.equal(deviance(fm), deviance(fm_wt))
  + } ## skip on windows (for speed)
  Loading required package: Matrix
  
  Attaching package: 'lme4'
  
  The following object is masked from 'package:nlme':
  
      lmList
  
  Error: all(sapply(comp, do.call, what = all.equal)) is not TRUE
  In addition: There were 13 warnings (use warnings() to see them)
  Execution halted
Running the tests in ‘tests/priorWeightsModComp.R’ failed.
Complete output:
  > library(lme4)
  Loading required package: Matrix
  > n <- nrow(sleepstudy)
  > op <- options(warn = 1, # show as they happen ("false" convergence warnings)
  +               useFancyQuotes = FALSE)
  > 
  > if (.Platform$OS.type != "windows") {
  + ##' remove all attributes but names
  + dropA <- function(x) `attributes<-`(x, list(names = names(x)))
  + ##' transform result of "numeric" all.equal.list() to a named vector
  + all.eqL <- function(x1, x2, ...) {
  +     r <- sub("^Component ", '', all.equal(x1, x2, tolerance = 0, ...))
  +     r <- strsplit(sub(": Mean relative difference:", "&&", r),
  +                   split="&&", fixed=TRUE)
  +     setNames(as.numeric(vapply(r, `[`, "1.234", 2L)),
  +              ## drop surrounding "..."
  +              nm = sub('"$', '', substring(vapply(r, `[`, "nam",   1L), first=2)))
  + }
  + seedF <- function(s) {
  +     if(s %in% c(6, 39, 52, 57, 63, 74, 76, 86))
  +         switch(as.character(s)
  +                , "52"=, "63"=, "74" = 2
  +                , "6"=, "39" = 3
  +                , "86" =  8 # needs  4 on Lnx-64b
  +                , "76" = 70 # needs 42 on Lnx-64b
  +                , "57" = 90 # needs 52 on Lnx-64b
  +                )
  +     else if(s %in% c(1, 12, 15, 34, 36, 41, 42, 43, 49, 55, 59, 67, 80, 85)) ## seeds 41,59, .. 15
  +         1.0
  +     else ## seeds 22, 20, and better
  +         0.25
  + }
  + ## be fast, running only 10 seeds by default:
  + sMax <- if(lme4:::testLevel() > 1) 99L else 9L
  + mySeeds <- 0L:sMax
  + 
  + lapply(setNames(,mySeeds), function(seed) {
  +     cat("\n------ random seed =", seed, "---------\n")
  +     set.seed(seed)
  +     v <- rpois(n,1) + 1
  +     w <- 1/v
  +     cat("weights w:\n")
  +     fm1    <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, REML=FALSE, weights = w); cat("..2:\n")
  +     fm2    <- lmer(Reaction ~ Days + (1    | Subject), sleepstudy, REML=FALSE, weights = w)
  +     cat("weights w*10:\n")
  +     fm1.10 <- lmer(Reaction ~ Days + (Days | Subject), sleepstudy, REML=FALSE, weights = w*10);cat("..2:\n")
  +     fm2.10 <- lmer(Reaction ~ Days + (1    | Subject), sleepstudy, REML=FALSE, weights = w*10)
  +     ##
  +     ano12... <- dropA(anova(fm1,    fm2   ))
  +     ano12.10 <- dropA(anova(fm1.10, fm2.10))
  +     print(aEQ <- all.eqL(ano12..., ano12.10)) # showing differences
  +     if(!exists("notChisq"))
  + 	notChisq <<-
  + 	    local({ n <- names(ano12...)
  + 		grep("Chisq", n, value=TRUE, fixed=TRUE, invert=TRUE) })
  +     stopifnot(
  +         all.equal(ano12...$Chisq,
  +                   ano12.10$Chisq, tol = 1e-6 * seedF(seed))
  +        ,
  +         all.equal(ano12...[notChisq],
  +                   ano12.10[notChisq], tol= 1.5e-8 * seedF(seed))
  +     )
  +     aEQ
  + }) -> rallEQ
  + 
  + cat("=====================================\n")
  + 
  + rallEQ <- t(simplify2array(rallEQ))
  + notChisq <- intersect(notChisq, colnames(rallEQ))
  + ## sort according to "severity":
  + srallEQ <- rallEQ[with(as.data.frame(rallEQ), order(AIC, Chisq)), ]
  + round(log10(srallEQ), 2)
  + saveRDS(srallEQ, "priorWeightsMod_relerr.rds")
  + 
  + if(!dev.interactive(orNone=TRUE)) pdf("priorWeightsMod_relerr.pdf")
  + 
  + matplot(mySeeds, log10(srallEQ), type="l", xlab=NA) ; grid()
  + legend("topleft", ncol=3, bty="n",
  +        paste(1:6, colnames(srallEQ), sep = ": "), col=1:6, lty=1:6)
  + tolD <- sqrt(.Machine$double.eps) # sqrt(eps_C)
  + abline(h = log10(tolD), col = "forest green", lty=3)
  + axis(4, at=log10(tolD), label=quote(sqrt(epsilon[c])), las=1)
  + LRG <- which(srallEQ[,"AIC"] > tolD)
  + if (length(LRG)>0) {
  +     text(LRG, log10(srallEQ[LRG, "AIC"]), names(LRG), cex = .8)
  + }
  + 
  + ## how close are we ..
  + str(tF <- sapply(mySeeds, seedF))
  + round(sort(      rallEQ[, "Chisq"] / (tF * 1e-6  ),          decreasing=TRUE), 1)
  + round(sort(apply(rallEQ[,notChisq] / (tF * 1.5e-8), 1, max), decreasing=TRUE), 1)
  + } ## skip on windows (for speed)
  
  ------ random seed = 0 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.12755 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 1 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.00449 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 2 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.68252 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 26.1456 (tol = 0.002, component 1)
  RUE 
   NA 
  
  ------ random seed = 3 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.11241 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 4 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.41542 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 5 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 2.86338 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 6 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.58993 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 7 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.57508 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 8 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 3.62162 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  
  ------ random seed = 9 ---------
  weights w:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 2.73043 (tol = 0.002, component 1)
  weights w*10:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 2 negative eigenvalues
  ..2:
  Warning in optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    unable to evaluate scaled gradient
  Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge: degenerate  Hessian with 1 negative eigenvalues
  RUE 
   NA 
  =====================================
  Error in eval(substitute(expr), data, enclos = parent.frame()) : 
    object 'Chisq' not found
  Calls: with -> with.default -> eval -> eval -> order
  Execution halted
Running the tests in ‘tests/vcov-etc.R’ failed.
Complete output:
  > stopifnot(require(lme4))
  Loading required package: lme4
  Loading required package: Matrix
  > 
  > (testLevel <- lme4:::testLevel())
  [1] 1
  > source(system.file("testdata", "lme-tst-funs.R", package="lme4", mustWork=TRUE))# -> unn()
  > 
  > 
  > ## "MEMSS" is just 'Suggest' -- must still work, when it's missing:
  > if (suppressWarnings(!require(MEMSS, quietly=TRUE)) ||
  +     (data(ergoStool, package="MEMSS") != "ergoStool")) {
  + 
  +     cat("'ergoStool' data from package 'MEMSS' is not available --> skipping test\n")
  + } else {
  + 
  + fm1   <-  lmer (effort ~ Type + (1|Subject), data = ergoStool)
  + ##sp no longer supported since ~ 2012-3:
  + ##sp fm1.s  <- lmer (effort ~ Type + (1|Subject), data = ergoStool, sparseX=TRUE)
  + ## was segfaulting with sparseX (a while upto 2010-04-06)
  + 
  + fe1   <- fixef(fm1)
  + ##sp fe1.s <- fixef(fm1.s)
  + 
  + print(s1.d <- summary(fm1))
  + ##sp print(s1.s <- summary(fm1.s))
  + Tse1.d <- c(0.57601226, rep(0.51868384, 3))
  + stopifnot(exprs = {
  +     ##sp all.equal(fe1, fe1.s, tolerance= 1e-12)
  +     all.equal(Tse1.d, unname(se1.d <- coef(s1.d)[,"Std. Error"]),
  +               tolerance = 1e-6) # std.err.: no too much accuracy
  +     is(V.d <- vcov(fm1), "symmetricMatrix")
  +     ##sp all.equal(se1.d, coef(s1.s)[,"Std. Error"])#, tol = 1e-10
  +     ##sp all.equal(  V.d, vcov(fm1.s))#, tol = 1e-9
  +     all.equal(Matrix::diag(V.d), unn(se1.d)^2, tolerance= 1e-12)
  + })
  + 
  + }## if( ergoStool is available from pkg MEMSS )
  
  Attaching package: 'MEMSS'
  
  The following objects are masked from 'package:datasets':
  
      CO2, Orange, Theoph
  
  Linear mixed model fit by REML ['lmerMod']
  Formula: effort ~ Type + (1 | Subject)
     Data: ergoStool
  
  REML criterion at convergence: Inf
  
  Scaled residuals: 
       Min       1Q   Median       3Q      Max 
  -1.55001 -0.64996 -0.04112  0.60381  1.64861 
  
  Random effects:
   Groups   Name        Variance Std.Dev.
   Subject  (Intercept) 0.915    0.9565  
   Residual             1.517    1.2316  
  Number of obs: 36, groups:  Subject, 9
  
  Fixed effects:
              Estimate Std. Error t value
  (Intercept)   8.5556     0.5198  16.459
  TypeT2        3.8889     0.5806   6.698
  TypeT3        2.2222     0.5806   3.827
  TypeT4        0.6667     0.5806   1.148
  
  Correlation of Fixed Effects:
         (Intr) TypeT2 TypeT3
  TypeT2 -0.558              
  TypeT3 -0.558  0.500       
  TypeT4 -0.558  0.500  0.500
  optimizer (nloptwrap) convergence code: -2 (NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).)
  Model failed to converge with max|grad| = 1.60567 (tol = 0.002, component 1)
  
  Error: Tse1.d and unname(se1.d <- coef(s1.d)[, "Std. Error"]) are not equal:
    Mean relative difference: 0.1134759
  In addition: Warning messages:
  1: In optwrap(optimizer, devfun, getStart(start, rho$pp), lower = rho$lower,  :
    convergence code -2 from nloptwrap: NLOPT_INVALID_ARGS: Invalid arguments (e.g. lower bounds are bigger than upper bounds, an unknown algorithm was specified, etcetera).
  2: In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
    Model failed to converge with max|grad| = 1.60567 (tol = 0.002, component 1)
  Execution halted