Running ‘test-all.R’ [34s/55s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library("lava")
  lava version 1.4.7
  > suppressPackageStartupMessages(library("testthat"))
  > test_check("lava")
  
   *** caught segfault ***
  address a, cause 'memory not mapped'
  
  Traceback:
   1: FUN(newX[, i], ...)
   2: apply(Y, 2, function(x) B %*% matrix(x, nrow = ncol(B)) %*% t(A))
   3: rbind(apply(Y, 2, function(x) B %*% matrix(x, nrow = ncol(B)) %*%     t(A)))
   4: kronprod(t(IAi), G, res$dA)
   5: eval(expr, envir, enclos)
   6: eval(substitute(expr), data, enclos = parent.frame())
   7: with.default(mom, kronprod(t(IAi), G, res$dA))
   8: with(mom, kronprod(t(IAi), G, res$dA))
   9: deriv.lvm(x, meanpar = MeanPar, p = pars, mom = mp, mu = NULL)
  10: eval(expr, envir, enclos)
  11: eval(substitute(expr), data, enclos = parent.frame())
  12: with.default(attributes(mp), deriv.lvm(x, meanpar = MeanPar,     p = pars, mom = mp, mu = NULL))
  13: with(attributes(mp), deriv.lvm(x, meanpar = MeanPar, p = pars,     mom = mp, mu = NULL))
  14: scoreFun(x0, data = data[ii, ], p = with(pp, c(meanpar, p, p2)),     weight = weight[ii, , drop = FALSE], weight2 = weight2[ii,         , drop = FALSE], model = model, debug = debug, indiv = indiv,     ...)
  15: FUN(X[[i]], ...)
  16: lapply(X = X, FUN = FUN, ...)
  17: sapply(seq_len(nrow(data)), myfun)
  18: t(sapply(seq_len(nrow(data)), myfun))
  19: score.lvm(x, p = p0, model = model, data = data, weight = weight,     weight2 = weight2, indiv = FALSE, n = n)
  20: score(x, p = p0, model = model, data = data, weight = weight,     weight2 = weight2, indiv = FALSE, n = n)
  21: func(x, ...)
  22: jacobian.default(myf, p, method = method)
  23: numDeriv::jacobian(myf, p, method = method)
  24: information.lvm(x$lvm[[i]], p = pp[[i]], data = data[[i]], weight = weight[[i]],     ...)
  25: information(x$lvm[[i]], p = pp[[i]], data = data[[i]], weight = weight[[i]],     ...)
  26: information.multigroup(x$model0, p = p, weight = weight, model = estimator,     ...)
  27: information(x$model0, p = p, weight = weight, model = estimator,     ...)
  28: information.multigroupfit(res$estimate, type = "hessian")
  29: information(res$estimate, type = "hessian")
  30: solve(information(res$estimate, type = "hessian"))
  31: estimate.MAR(x = x, data = data, fix = fix, control = optim,     debug = lava.options()$debug, silent = silent, estimator = estimator,     weight = weight, weight2 = weight2, cluster = id, ...)
  32: estimate.lvm(m0, d0, missing = TRUE, param = "none", control = list(method = "NR",     constrain = FALSE, start = coef(e), trace = 1))
  33: estimate(m0, d0, missing = TRUE, param = "none", control = list(method = "NR",     constrain = FALSE, start = coef(e), trace = 1))
  34: withVisible(code)
  35: with_sink(temp, withVisible(code))
  36: capture_output_as_vector(code, print)
  37: capture_output(object)
  38: expect_output(e0 <- estimate(m0, d0, missing = TRUE, param = "none",     control = list(method = "NR", constrain = FALSE, start = coef(e),         trace = 1)), "Iter=")
  39: eval(expr, envir, enclos)
  40: eval(code, test_env)
  41: withCallingHandlers(eval(code, test_env), expectation = handle_expectation,     skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error)
  42: doTryCatch(return(expr), name, parentenv, handler)
  43: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  44: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
  45: doTryCatch(return(expr), name, parentenv, handler)
  46: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]),     names[nh], parentenv, handlers[[nh]])
  47: tryCatchList(expr, classes, parentenv, handlers)
  48: tryCatch(withCallingHandlers(eval(code, test_env), expectation = handle_expectation,     skip = handle_skip, warning = handle_warning, message = handle_message,     error = handle_error), error = function(e) {}, skip = function(e) {})
  49: test_code(desc, code, env = parent.frame())
  50: test_that("Random slope model", {    set.seed(1)    m <- lvm()    regression(m) <- y1 ~ 1 * u + 1 * s    regression(m) <- y2 ~ 1 * u + 2 * s    regression(m) <- y3 ~ 1 * u + 3 * s    latent(m) <- ~u + s    dw <- sim(m, 20)    dd <- mets::fast.reshape(dw)    dd0 <- dd[-c(1:2 * 3), ]    library(lme4)    l <- lmer(y ~ 1 + num + (1 + num | id), dd, REML = FALSE)    sl <- lava:::varcomp(l, profile = FALSE)    d <- mets::fast.reshape(dd, id = "id")    d0 <- mets::fast.reshape(dd0, id = "id")    m0 <- lvm(c(y1[0:v], y2[0:v], y3[0:v]) ~ 1 * u)    addvar(m0) <- ~num1 + num2 + num3    covariance(m0) <- u ~ s    latent(m0) <- ~s + u    regression(m0) <- y1 ~ num1 * s    regression(m0) <- y2 ~ num2 * s    regression(m0) <- y3 ~ num3 * s    system.time(e <- estimate(m0, d, param = "none", control = list(trace = 0,         constrain = FALSE)))    expect_true(mean(sl$coef - coef(e)[c("u", "s")])^2 < 1e-05)    expect_true((logLik(l) - logLik(e))^2 < 1e-05)    varcomp.nam <- c(paste0("u", lava.options()$symbol[2], "u"),         paste0("s", lava.options()$symbol[2], "s"))    expect_true(mean(diag(sl$varcomp) - coef(e)[varcomp.nam])^2 <         1e-05)    expect_output(e0 <- estimate(m0, d0, missing = TRUE, param = "none",         control = list(method = "NR", constrain = FALSE, start = coef(e),             trace = 1)), "Iter=")    l0 <- lmer(y ~ 1 + num + (1 + num | id), dd0, REML = FALSE)    expect_true((logLik(l0) - logLik(e0))^2 < 1e-05)    m1 <- lvm(c(y1[0:v], y2[0:v], y3[0:v]) ~ 1 * u)    addvar(m1) <- ~num1 + num2 + num3    covariance(m1) <- u ~ s    latent(m1) <- ~s + u    regression(m1) <- y1 ~ b1 * s    regression(m1) <- y2 ~ b2 * s    regression(m1) <- y3 ~ b3 * s    constrain(m1, b1 ~ num1) <- function(x) x    constrain(m1, b2 ~ num2) <- function(x) x    constrain(m1, b3 ~ num3) <- function(x) x    system.time(e1 <- estimate(m1, d, param = "none", p = coef(e)))    expect_true((logLik(e1) - logLik(e))^2 < 1e-05)})
  51: eval(expr, envir, enclos)
  52: eval(exprs, env)
  53: source_file(path, new.env(parent = env), chdir = TRUE)
  54: force(code)
  55: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter,     {        lister$start_file(basename(path))        source_file(path, new.env(parent = env), chdir = TRUE)        end_context()    })
  56: FUN(X[[i]], ...)
  57: lapply(paths, test_file, env = env, reporter = current_reporter,     start_end_reporter = FALSE, load_helpers = FALSE)
  58: force(code)
  59: with_reporter(reporter = current_reporter, results <- lapply(paths,     test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE,     load_helpers = FALSE))
  60: test_files(paths, reporter = reporter, env = env, ...)
  61: test_dir(test_path, reporter = reporter, env = env, filter = filter,     ...)
  62: with_top_env(env, {    test_dir(test_path, reporter = reporter, env = env, filter = filter,         ...)})
  63: run_tests(package, test_path, filter, reporter, ...)
  64: test_check("lava")
  An irrecoverable exception occurred. R is aborting now ...