Skip to content

Commit

Permalink
test that dgg poisson link works
Browse files Browse the repository at this point in the history
  • Loading branch information
Jillian Dunic committed Feb 14, 2024
1 parent b6dbe00 commit 1c1107b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-delta.R
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,18 @@ test_that("Delta-Gengamma family fits", {
expect_equal(sr_gengamma$ln_tau_E, sr_dgg$ln_tau_E[2], tolerance = 1e-4)
expect_equal(sr_gengamma$ln_kappa[1,1], sr_dgg$ln_kappa[1,2], tolerance = 1e-4)
expect_equal(sr_bin$ln_kappa[1,1], sr_dgg$ln_kappa[1,1], tolerance = 1e-4)
})

test_that("delta_gengamma() Poisson-link family fits", {
skip_on_cran()
skip_on_ci()

fit_pgg <- sdmTMB(density ~ 1,
data = pcod, mesh = pcod_spde,
spatial = "off",
family = delta_gengamma(link1 = 'log', link2 = 'log', type = "poisson-link")
)
fit_pgg$sd_report
s <- as.list(fit_pgg$sd_report, "Std. Error")
expect_true(sum(is.na(s$b_j)) == 0L)
})

0 comments on commit 1c1107b

Please sign in to comment.