You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similarly, I was wondering if it'd be worth throwing a warning for spatiotemporal delta models in cases where there's no variation in the data. Especially for rare species, some time slices might not have any variation. Example:
mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 20)
pcod$density[which(pcod$year==2005)] = 0
# model fits fine
fit <- sdmTMB(
density ~ s(depth),
data = pcod, mesh = mesh,
family = delta_gamma(),
time="year",
spatiotemporal = "iid"
)
pred <- predict(fit, pcod) # predict all
The presence-absence field is shifted down (and unclear why there's any variation)
# plot spatial fields of presence-absence --
dplyr::filter(pred, year < 2009) %>%
ggplot(aes(X,Y,col=est_rf1)) +
geom_point() +
facet_wrap(~year) +
scale_color_gradient2()
And as expected the positive model is ~ 0 with little variation compared to other years
Might need options:
Warn user if it happens.
The text was updated successfully, but these errors were encountered: