tests/testthat/test-MAD.R

test_that("correspondence_MAD_deviation_vs_envelope", {
  cset <- create_curve_set(list(obs=runif(10), sim_m=matrix(runif(10*99), ncol=99)))
  res1 <- global_envelope_test(cset, type="unscaled")
  res2 <- deviation_test(cset, scaling = 'none', measure = 'max', savedevs=TRUE)
  expect_equal(attr(res1, "p"), res2$p)
  expect_equal(attr(res1, "M"), res2$devs)
  res1 <- global_envelope_test(cset, type="st")
  res2 <- deviation_test(cset, scaling = 'st', measure = 'max', savedevs=TRUE)
  expect_equal(attr(res1, "p"), res2$p)
  expect_equal(attr(res1, "M"), res2$devs)
  res1 <- global_envelope_test(cset, type="qdir")
  res2 <- deviation_test(cset, scaling = 'qdir', measure = 'max', savedevs=TRUE)
  expect_equal(attr(res1, "p"), res2$p)
  expect_equal(attr(res1, "M"), res2$devs)
})

Try the GET package in your browser

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

GET documentation built on Sept. 11, 2024, 5:46 p.m.