tests/testthat/test-pit.R

 test_that("the probability integral transform works", {
   x1 <- c(1, 1, 3, 4, 6)
   expect_equal(pit(x1), c(0.3, 0.3, 0.5, 0.7, 0.9))
   expect_equal(pit(x1, c(0, 2, 2, 5.9, 7, 8)), c(0.15, 0.4, 0.4, 0.8, 28/30, 29/30))
 })

Try the smoothemplik package in your browser

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

smoothemplik documentation built on Aug. 22, 2025, 1:11 a.m.