aboutsummaryrefslogblamecommitdiff
path: root/tests/testthat/test_mkinfit.R
blob: 11b6111a7f0aab662cb871f058fd8edbb44efad3 (plain) (tree)
1
2
3
4
5
6
7
8
9
10








                                                                                  








                                                                          
context("mkinfit features")

test_that("Specifying initial values for state variables works correctly", {
  f_1 <- mkinfit("SFO", FOCUS_2006_C, state.ini = c(parent = 100), quiet = TRUE)
  f_2 <- mkinfit("SFO", FOCUS_2006_C, state.ini = c(parrrent = 100), quiet = TRUE)

  # Before mkin 0.9.50.3, these would give different degrees of freedom,
  # also affecting AIC calculations
  expect_equal(logLik(f_1), logLik(f_2))
})

test_that("We get messages and output from mkinfit if desired", {
  # For progress info we use message()
  expect_message(mkinfit("SFO", FOCUS_2006_A, quiet = FALSE))

  # trace_parms uses cat()
  out <- capture.output(
    tmp <- mkinfit("SFO", FOCUS_2006_A, trace_parms = TRUE, quiet = TRUE))
  expect_true(length(out) > 10)
})

Contact - Imprint