aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_multistart.R
blob: 60fdefdc138b4b38462a3f6563edbf849ba9f792 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
context("Multistart method for saem.mmkin models")

test_that("multistart works for saem.mmkin models", {
  saem_sfo_s_multi <- multistart(sfo_saem_1, n = 8, cores = n_cores)

  llhist_sfo <- function() llhist(saem_sfo_s_multi, xlim = c(-644, -647))
  vdiffr::expect_doppelganger("llhist for sfo fit", llhist_sfo)

  set.seed(123456)
  saem_biphasic_m_multi <- multistart(saem_biphasic_m, n = 8,
    cores = n_cores)
  expect_known_output(print(saem_biphasic_m_multi),
    file = "print_multistart_biphasic.txt")

  skip_on_cran()
  skip_on_travis()

  llhist_biphasic <- function() llhist(saem_biphasic_m_multi)
  parhist_biphasic <- function() parhist(saem_biphasic_m_multi,
    ylim = c(0.5, 2))

  vdiffr::expect_doppelganger("llhist for biphasic saemix fit", llhist_biphasic)
  vdiffr::expect_doppelganger("parhist for biphasic saemix fit", parhist_biphasic)
})

Contact - Imprint