https://github.com/cran/bayestestR
Raw File
Tip revision: 68a979e69aa2a1e57017730e1397470d5614d216 authored by Dominique Makowski on 02 September 2021, 23:10:30 UTC
version 0.11.0
Tip revision: 68a979e
test-point_estimate.R
if (require("rstanarm", quietly = TRUE) && require("brms", quietly = TRUE)) {
  if (require("insight")) {
    m <- insight::download_model("stanreg_merMod_5")
    p <- insight::get_parameters(m, effects = "all")

    test_that("point_estimate", {
      expect_equal(
        point_estimate(m, effects = "all")$Median,
        point_estimate(p)$Median,
        tolerance = 1e-3
      )
    })

    m <- insight::download_model("brms_zi_3")
    p <- insight::get_parameters(m, effects = "all", component = "all")

    test_that("point_estimate", {
      expect_equal(
        point_estimate(m, effects = "all", component = "all")$Median,
        point_estimate(p)$Median,
        tolerance = 1e-3
      )
    })
  }
}
back to top