Closed seananderson closed 1 year ago
Cross validation is now working with delta models:
library(sdmTMB)
future::plan(future::multisession)
out_dg <- sdmTMB_cv(
density ~ depth_scaled,
data = pcod_2011,
mesh = make_mesh(pcod_2011, c("X", "Y"), cutoff = 10),
family = delta_gamma(),
k_folds = 5
)
#> Running fits with `future.apply()`.
#> Set a parallel `future::plan()` to use parallel processing.
out_dg$fold_loglik
#> [1] -531.3995 -702.3048 -591.7539 -608.1418 -611.2388
out_dg$sum_loglik
#> [1] -3044.839
I think this should be relatively straightforward to implement. https://github.com/pbs-assess/sdmTMB/discussions/111#discussioncomment-6439110
Created on 2023-07-13 with reprex v2.0.2