pbs-assess / sdmTMB

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

Allow standard errors on overall predictions from delta models #174

Closed seananderson closed 1 year ago

seananderson commented 1 year ago

I've had a couple requests for this including from @maxlindmark. Presumably we'd calculate them in the 2nd model's link space. A current workaround is to use the 'nsim' argument and combine the two components.

I.e., enable SEs with predict(fit, re_form = NA, se_fit = TRUE, model = NA, type = "link") from a delta model.

seananderson commented 1 year ago

This should now be working. Let me know if anything seems off. Examples in this unit test: https://github.com/pbs-assess/sdmTMB/blob/main/tests/testthat/test-delta-population-predictions.R