tests/testthat/test-crps_2pnorm.R

context("CRPS for two-piece-normal distribution")

test_that("computed values are correct", {
  const <- 2.80708311
  expect_equal(crps_2pnorm(-3, .7, 1.1), const)
  expect_equal(crps_2pnorm(-3 + .1, .7, 1.1, .1), const)
  
  const <- 2.17137978
  expect_equal(crps_2pnorm(3, .7, 1.1), const)
  expect_equal(crps_2pnorm(3 + .1, .7, 1.1, .1), 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.