tests/testthat/test-scaleThetaFromToInf.R

test_that("Scaling theta from inf. and back works", {
    expect_equal(scaleThetaFromInf(-5, 3, 0), -1)
    expect_equal(scaleThetaToInf(-10, 100, 45), 0)
    # back and forth since functions are inverses
    expect_equal(scaleThetaToInf(0, 100,
                                 scaleThetaFromInf(0, 100, c(1, 2, 3))),
                 c(1, 2, 3))
    expect_equal(scaleThetaFromInf(-50, -3.5,
                                   scaleThetaToInf(-50, -3.5, c(-10, -50, -8.5))),
                 c(-10, -50, -8.5))
})
joakimwallmark/PolyOptimalIRT documentation built on Dec. 21, 2021, 1:16 a.m.