tests/testthat/test-goodness.of.fit.R

context("Check goodness.of.fit function")

theta <- rtheta()
u <- Uhat(SimulateGMCMData(theta = theta)$u)

test_that("goodness.of.fit is working as intended", {

  goodness.of.fit(theta, u) %>%
    expect_length(1) %>%
    expect_type("double")

  goodness.of.fit(theta, u, method = "AIC", k = 3) %>%
    expect_length(1) %>%
    expect_type("double")

  goodness.of.fit(theta, u, method = "BIC") %>%
    expect_length(1) %>%
    expect_type("double")
})

Try the GMCM package in your browser

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

GMCM documentation built on Nov. 6, 2019, 1:08 a.m.