Two-process model where the numerator follows a Poisson distribution and the denominator (effort/exposure) follows a Gamma distribution. This is the natural family for CPUE-type data.
Use cases:
Catch per unit effort (CPUE)
Observations per hour
Events per continuous exposure
Examples
# Create family object
fam <- ratiod_poisson_gamma()
print(fam)
#> tulpaRatio family: poisson_gamma
#> Poisson numerator, Gamma denominator (CPUE-type)
#>
#> Numerator: poisson(log)
#> Denominator: gamma (log)
# Simulate CPUE data
set.seed(123)
n <- 60
df <- data.frame(
catch = rpois(n, lambda = 8),
effort_hours = rgamma(n, shape = 4, rate = 1),
depth = rnorm(n),
season = factor(rep(c("spring", "summer", "fall"), each = n/3)),
vessel = factor(rep(1:6, each = n/6))
)
if (FALSE) { # \dontrun{
# Fit model (slow, not run on CRAN)
fit <- tratio(
catch | effort_hours ~ depth + season + (1 | vessel),
data = df,
family = ratiod_poisson_gamma(),
control = list(iter = 200, warmup = 100, chains = 1)
)
} # }