tests/testthat/test-crps_lapl.R

context("CRPS for Laplace distribution")

FF <- function(x) {
  0.5 + 0.5 * sign(x) * pexp(abs(x))
}

test_that("computed values are correct", {
  const <- 2.29978707
  expect_equal(crps_lapl(-3), const)
  expect_equal(crps_lapl(-3 + .1, location = .1), const)
  expect_equal(crps_lapl(-3 * .9, scale = .9), .9 * const)
})

Try the scoringRules package in your browser

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

scoringRules documentation built on May 31, 2023, 6:06 p.m.