sdmTMB icon indicating copy to clipboard operation
sdmTMB copied to clipboard

Add support for logit-normal distribution

Open ericward-noaa opened this issue 2 years ago • 1 comments

PFMC SSC comment regarding H&L data, though this may already be possible in sdmTMB with observation-specific random effects, e.g.

y ~ year + (1|obs_id)

Need to validate against Tanya's code?

ericward-noaa avatar Jun 22 '22 16:06 ericward-noaa

Confirming that using the individual random effect is probably not a good way to go, and not identifiable. Checking with assessors on how their model differs

data("pcod_2011")
mesh <- make_mesh(pcod_2011, c("X", "Y"), cutoff = 20)
prob <- plogis(rnorm(nrow(pcod_2011),0,0.3)) # known deviation
pcod_2011$pres <- rbinom(nrow(pcod_2011), size=1, prob = prob)
pcod_2011$id <- as.factor(seq(1,nrow(pcod_2011)))
fit <- sdmTMB(
  pres ~ 1 + (1|id),
  data = pcod_2011, mesh = mesh,
  spatial="on",
  family = binomial(link = "logit")
)

ericward-noaa avatar Jun 29 '22 16:06 ericward-noaa