swh:1:snp:2c68a6c5a8af2f06ac2c0225927f25b54fd1f9d0
Tip revision: 6313ce21ea98857cf95d996de7978cfd52175e59 authored by Dominique Makowski on 08 April 2021, 04:40:02 UTC
version 0.9.0
version 0.9.0
Tip revision: 6313ce2
test-rope_range.R
test_that("rope_range", {
x <- cor.test(ToothGrowth$len, ToothGrowth$dose)
expect_equal(
rope_range(x),
c(-0.05, 0.05)
)
})
.runThisTest <- Sys.getenv("RunAllbayestestRTests") == "yes"
if (.runThisTest && require("brms", quietly = TRUE)) {
test_that("rope_range", {
model <- brm(mpg ~ wt + gear, data = mtcars, iter = 300)
expect_equal(
rope_range(model),
c(-0.6026948, 0.6026948),
tolerance = 0.01
)
})
test_that("rope_range (multivariate)", {
model <- brm(mvbind(mpg, disp) ~ wt + gear, data = mtcars, iter = 300)
expect_equal(
rope_range(model),
list(
mpg = c(-0.602694, 0.602694),
disp = c(-12.393869, 12.393869)
),
tolerance = 0.01
)
})
}