tests/testthat/test-fit_beta_1exp.R

test_that("Beta fit for 1 expert works", {
  expect_equal(round(as.numeric(
    fit_beta_1exp(
      c(0, 0, 3, 2, 1, 2, 1, 1, 0, 0) %>%
        get_cum_probs_1exp() %>%
        get_model_input_1exp()
    )$par
  ), 6),
  c(2.088584, 2.816686))
})

# note:
# - "round" is because the result had a lot of decimals
# - "as.numeric" is because the first input has names and the second does not

Try the tipmap package in your browser

Any scripts or data that you put into this service are public.

tipmap documentation built on Dec. 8, 2022, 1:13 a.m.