Skip to content

Commit

Permalink
Add test to check for index bias, WIP #108
Browse files Browse the repository at this point in the history
  • Loading branch information
pratikunterwegs committed Nov 20, 2023
1 parent 6d356ac commit d0e149d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/testthat/test-estimate_time_varying.R
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,18 @@ test_that("cfr_rolling and cfr_time_varying have similar returns", {
colnames(cfr_rolling(covid_uk))
)
})

# Expect that index shifting does not lead to biases
test_that("cfr_rolling does not introduce bias due to index shifting", {
expect_identical(
cfr_time_varying(
data = covid_uk,
delay_density = function(x) ifelse(x == 0, 1, 0),
burn_in = 7L
),
cfr_time_varying(
data = covid_uk,
burn_in = 7L
)
)
})

0 comments on commit d0e149d

Please sign in to comment.