Skip to content

Fix coef() to work with delta models #351

@ericward-noaa

Description

@ericward-noaa

I think the solution here is just modifying coef()to take model as an argument

library(dplyr)
library(tidyr)
library(sdmTMB)

set.seed(1)

# Build a mesh to implement the SPDE approach:
mesh <- make_mesh(pcod_2011, c("X", "Y"), cutoff = 20)

# Quick mesh plot:
plot(mesh)

# Fit a Tweedie spatial random field GLMM with a smoother for depth:
fit <- sdmTMB(
  density ~ s(depth),
  data = pcod_2011, mesh = mesh,
  family = delta_gamma()
)

coef(fit)
#> (Intercept) 
#>  -0.7903428

Created on 2024-06-14 with reprex v2.1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions