pbs-assess / sdmTMB

:earth_americas: An R package for spatial and spatiotemporal GLMMs with TMB
https://pbs-assess.github.io/sdmTMB/
182 stars 26 forks source link

Fix prediction with newdata = NULL for non-delta models with extra_time #335

Closed seananderson closed 3 months ago

seananderson commented 3 months ago
library(sdmTMB)
pcod_mod <-
  sdmTMB(
    formula = density ~ 1,
    data = pcod,
    spatial = "off",
    spatiotemporal = "off",
    time = "year",
    # family = delta_gamma(),
    family = tweedie(),
    extra_time = 2018:2020,
    silent = FALSE)

# predict(pcod_mod) # broken, will fix
predict(pcod_mod, newdata = pcod) # this will work