tests/testthat/test-crps_mixnorm.R

context("CRPS for mixture of normal distributions")

test_that("computed values are correct", {
  expect_equal(crps_mixnorm(-1,
                            matrix(-1.4, 1, 1),
                            matrix(.9, 1, 1),
                            matrix(1, 1, 1)),
               crps_norm(-1,-1.4, .9))
  expect_equal(crps_mixnorm_int(-1,
                                matrix(-1.4, 1, 1),
                                matrix(.9, 1, 1),
                                matrix(1, 1, 1),
                                rel_tol = 1e-10),
               crps_norm(-1,-1.4, .9))
})

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.