Running ‘testthat.R’ [141s/103s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(mdgc)
  > 
  > test_check("mdgc")
  
  error: inv_sympd(): matrix is singular or not positive definite
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  ● On CRAN (1)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-get-log-lm-terms.R:78:3): 'get_log_lm_terms' gives the correct result with and without gradients ──
  `val` not equal to -45.8852616647973.
  1/1 mismatches
  [1] -91.1 - -45.9 == -45.2
  ── Failure (test-get-log-lm-terms.R:82:3): 'get_log_lm_terms' gives the correct result with and without gradients ──
  `val` not equal to -45.8852616647973.
  1/1 mismatches
  [1] -91.8 - -45.9 == -45.9
  ── Failure (test-get-log-lm-terms.R:114:3): 'get_log_lm_terms' gives the correct result with and without gradients ──
  drop(c(attr(grad, "grad_vcov")) %*% jac) not equal to head(true_grad, -4).
  15/15 mismatches (average diff: 7.4e+220)
  [1]   8.89e+00 -   4.4439 ==   4.44e+00
  [2]   1.65e+01 -   8.2665 ==   8.27e+00
  [3]   1.54e-01 -   0.0771 ==   7.71e-02
  [4]   2.57e+00 -   1.2839 ==   1.28e+00
  [5]  -2.08e+01 - -10.3954 ==  -1.04e+01
  [6] -5.06e+220 -  -0.4874 == -5.06e+220
  [7] -1.61e+221 -   2.0320 == -1.61e+221
  [8]  2.07e+218 -  -0.1059 ==  2.07e+218
  [9]  3.04e+221 -  -5.2184 ==  3.04e+221
  ...
  ── Failure (test-get-log-lm-terms.R:117:3): 'get_log_lm_terms' gives the correct result with and without gradients ──
  drop(attr(grad, "grad_mea")) not equal to tail(true_grad, 4).
  3/4 mismatches (average diff: 1.54e+221)
  [2]  -4.52e+00 - -2.26 ==  -2.26e+00
  [3]  -5.72e+00 - -2.70 ==  -3.02e+00
  [4]  4.63e+221 - -2.10 ==  4.63e+221
  ── Error (test-get-log-lm-terms.R:122:3): 'get_log_lm_terms' gives the correct result with and without gradients ──
  Error: cdf::cdf: error in mvsort
  Backtrace:
      █
   1. └─mdgc:::log_ml(pa, comp_derivs = TRUE, n_threads = 2L) test-get-log-lm-terms.R:122:2
   2.   └─mdgc:::eval_log_lm_terms(...) test-get-log-lm-terms.R:66:4
  ── Failure (test-get-log-lm-terms.R:189:3): 'get_log_lm_terms' gives the correct result with and without gradients with multinomial variables ──
  `val` not equal to -62.496433767902.
  1/1 mismatches
  [1] -125 - -62.5 == -62.2
  ── Failure (test-get-log-lm-terms.R:221:3): 'get_log_lm_terms' gives the correct result with and without gradients with multinomial variables ──
  drop(c(attr(grad, "grad_vcov")) %*% jac) not equal to head(true_grad, -2).
  15/15 mismatches (average diff: 3.58)
  [1] -18.99 - -10.849 ==  -8.14
  [2]  25.08 -  11.341 ==  13.74
  [3] -10.33 -  -8.097 ==  -2.23
  [4]   1.78 -   0.314 ==   1.46
  [5]   8.55 -   7.783 ==   0.77
  [6] -26.35 - -14.980 == -11.37
  [7] -14.49 - -10.402 ==  -4.08
  [8]   2.36 -   1.321 ==   1.04
  [9]  12.13 -   9.081 ==   3.05
  ...
  ── Failure (test-get-log-lm-terms.R:224:3): 'get_log_lm_terms' gives the correct result with and without gradients with multinomial variables ──
  drop(attr(grad, "grad_mea")) not equal to tail(true_grad, 2).
  2/2 mismatches (average diff: 0.868)
  [1] -1.19 - -0.263 == -0.929
  [2] -1.86 - -1.055 == -0.807
  ── Failure (test-get-log-lm-terms.R:230:3): 'get_log_lm_terms' gives the correct result with and without gradients with multinomial variables ──
  drop(c(attr(grad, "grad_vcov")) %*% jac) not equal to head(true_grad, -2).
  15/15 mismatches (average diff: 4.27)
  [1] -18.363 - -10.849 ==  -7.514
  [2]  23.553 -  11.341 ==  12.212
  [3]  -4.246 -  -8.097 ==   3.851
  [4]   0.439 -   0.314 ==   0.125
  [5]   3.807 -   7.783 ==  -3.976
  [6] -29.071 - -14.980 == -14.091
  [7] -15.176 - -10.402 ==  -4.774
  [8]   1.299 -   1.321 ==  -0.022
  [9]  13.877 -   9.081 ==   4.796
  ...
  ── Failure (test-get-log-lm-terms.R:233:3): 'get_log_lm_terms' gives the correct result with and without gradients with multinomial variables ──
  drop(attr(grad, "grad_mea")) not equal to tail(true_grad, 2).
  2/2 mismatches (average diff: 1.1)
  [1] -1.84 - -0.263 == -1.573
  [2] -1.69 - -1.055 == -0.635
  ── Failure (test-get-log-lm-terms.R:323:3): 'get_log_lm_terms' gives the correct result with and without gradients (ordinal and binary data) ──
  `val` not equal to -50.633131628025.
  1/1 mismatches
  [1] -104 - -50.6 == -53.6
  ── Failure (test-get-log-lm-terms.R:326:3): 'get_log_lm_terms' gives the correct result with and without gradients (ordinal and binary data) ──
  `val` not equal to -50.633131628025.
  1/1 mismatches
  [1] -104 - -50.6 == -52.9
  ── Error (test-get-log-lm-terms.R:328:3): 'get_log_lm_terms' gives the correct result with and without gradients (ordinal and binary data) ──
  Error: cdf::cdf: error in mvsort
  Backtrace:
      █
   1. └─mdgc:::log_ml(par, comp_derivs = TRUE) test-get-log-lm-terms.R:328:2
   2.   └─mdgc:::eval_log_lm_terms(...) test-get-log-lm-terms.R:313:4
  ── Error (test-get-log-lm-terms.R:522:5): mdgc_log_ml gives the correct result with a single log marginal likelihood term ──
  Error: cdf::cdf: error in mvsort
  Backtrace:
      █
   1. └─mdgc::mdgc_log_ml(...) test-get-log-lm-terms.R:522:4
   2.   └─mdgc:::.mdgc_log_ml(...)
   3.     └─mdgc:::eval_log_lm_terms(...)
  ── Error (test-man-files.R:15:3): mdgc examples gives the same ─────────────────
  Error: deriv::prep_sim: chol failed
  Backtrace:
       █
    1. └─mdgc::mdgc(...) test-man-files.R:15:2
    2.   └─mdgc::mdgc_fit(...)
    3.     └─mdgc:::svrg(...)
    4.       └─base::sapply(...)
    5.         └─base::lapply(X = X, FUN = FUN, ...)
    6.           └─mdgc:::FUN(X[[i]], ...)
    7.             └─mdgc:::par_fn_wrap(...)
    8.               └─mdgc:::par_fn(...)
    9.                 └─mdgc:::.mdgc_log_ml(...)
   10.                   └─mdgc:::eval_log_lm_terms(...)
  ── Failure (test-man-files.R:49:3): iris examples give the same ────────────────
  mdgc_log_ml(ptr, start_vals, obj$means) not equal to `truth`.
  1/1 mismatches
  [1] -1240 - -622 == -618
  ── Failure (test-man-files.R:51:3): iris examples give the same ────────────────
  mdgc_log_ml(ptr, start_vals, obj$means, use_aprx = TRUE) not equal to `truth`.
  1/1 mismatches
  [1] -Inf - -622 == -Inf
  ── Failure (test-man-files.R:57:3): iris examples give the same ────────────────
  `res` not equal to `truth`.
  Attributes: < Component "grad_mea": Mean relative difference: 0.5682484 >
  Attributes: < Component "grad_vcov": Mean relative difference: 0.6301471 >
  ── Error (test-man-files.R:59:3): iris examples give the same ──────────────────
  Error: deriv::prep_sim: chol failed
  Backtrace:
      █
   1. └─mdgc::mdgc_fit(...) test-man-files.R:59:2
   2.   └─mdgc:::svrg(...)
   3.     └─base::sapply(...)
   4.       └─base::lapply(X = X, FUN = FUN, ...)
   5.         └─mdgc:::FUN(X[[i]], ...)
   6.           └─mdgc:::par_fn_wrap(...)
   7.             └─mdgc:::par_fn(...)
   8.               └─mdgc:::.mdgc_log_ml(...)
   9.                 └─mdgc:::eval_log_lm_terms(...)
  ── Error (test-mdgc-fit.R:58:3): ADAM gives the same ───────────────────────────
  Error: cdf::cdf: error in mvsort
  Backtrace:
      █
   1. └─mdgc::mdgc_fit(...) test-mdgc-fit.R:58:2
   2.   └─mdgc:::adam(...)
   3.     └─mdgc:::par_fn_wrap(...)
   4.       └─mdgc:::par_fn(...)
   5.         └─mdgc:::.mdgc_log_ml(...)
   6.           └─mdgc:::eval_log_lm_terms(...)
  ── Error (test-mdgc-fit.R:79:3): svrg gives the same ───────────────────────────
  Error: cdf::cdf: error in mvsort
  Backtrace:
      █
   1. └─mdgc::mdgc_fit(...) test-mdgc-fit.R:79:2
   2.   └─mdgc:::svrg(...)
   3.     └─base::sapply(...)
   4.       └─base::lapply(X = X, FUN = FUN, ...)
   5.         └─mdgc:::FUN(X[[i]], ...)
   6.           └─mdgc:::par_fn_wrap(...)
   7.             └─mdgc:::par_fn(...)
   8.               └─mdgc:::.mdgc_log_ml(...)
   9.                 └─mdgc:::eval_log_lm_terms(...)
  ── Error (test-mdgc-impute.R:45:3): mdgc_impute gives the same as before and with and without reordering ──
  Error: imputation::prep_sim: chol failed
  Backtrace:
      █
   1. └─mdgc::mdgc_impute(...) test-mdgc-impute.R:45:2
   2.   └─mdgc:::impute(...)
  
  [ FAIL 22 | WARN 0 | SKIP 1 | PASS 7 ]
  Error: Test failures
  Execution halted