File: test-proportionBF.R

package info (click to toggle)
r-cran-bayesfactor 0.9.12-4.7%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,492 kB
  • sloc: cpp: 1,555; sh: 16; makefile: 7
file content (30 lines) | stat: -rw-r--r-- 731 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

context("proportionBF")

test_that("bad p values are handled correctly", {
    expect_error(
        proportionBF(0, N=0, p=0),
        'p must be between 0 and 1',
        fixed=TRUE)
    expect_error(
        proportionBF(0, N=0, p=1),
        'p must be between 0 and 1',
        fixed=TRUE)
    expect_error(
        proportionBF(0, N=0, p=-100),
        'p must be between 0 and 1',
        fixed=TRUE)
    expect_error(
        proportionBF(0, N=0, p=12),
        'p must be between 0 and 1',
        fixed=TRUE)
})

test_that("no samples is handled correctly", {
    proportionBF(0, N=0, p=0.5)
})

test_that("floor/ceiling values behave correctly", {
  proportionBF(  0, N=100, p=0.5)
  proportionBF(100, N=100, p=0.5)
})