tests/testthat/test_model_performance.R

library(insurancerating)
context("model_performance")

test_that("check if object is of model_performance class", {
  m1 <- glm(nclaims ~ area, offset = log(exposure), family = poisson(),
            data = MTPL2)
  m2 <- glm(nclaims ~ area, offset = log(exposure), family = poisson(),
            data = MTPL2)
  x <- model_performance(m1, m2)
  expect_is(x, "model_performance")
})

Try the insurancerating package in your browser

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

insurancerating documentation built on Oct. 10, 2024, 1:07 a.m.