Skip to content

Commit

Permalink
adding another test
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyGelb committed May 13, 2024
1 parent 02b42e2 commit d0e1ed7
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/testthat/test_adaptive_bw_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,31 @@ test_that("Testing the adaptive_bw.mc function", {
check = FALSE
)

observed2 <- nkde.mc(
events = event,
w = event$w,
samples = event,
lines = all_lines,
adaptive = TRUE,
bw = 3,
trim_bw = 5,
method = "discontinuous",
kernel_name = "quartic",
max_depth = 8,
tol = 0.1,
digits = 2,
sparse = TRUE,
verbose = FALSE,
grid_shape = c(3,3),
check = FALSE
)

abws_2 <- observed$events$bw[match(event$sp_id, observed$events$spid)]
abws_3 <- observed2$events$bw[match(event$sp_id, observed2$events$spid)]

diff <- sum(round(abs(abws - abws_2),6))
expect_equal(diff, 0)
diff2 <- sum(round(abs(abws - abws_3),6))
expect_equal(diff, 0, diff2)
})


Expand Down

0 comments on commit d0e1ed7

Please sign in to comment.