Extract posterior distributions of temporal effects from a fitted tulpaRatio model with temporal specification.
Arguments
- object
A
ratiod_fitobject fitted withtemporalargument- component
Which component to extract for multi-scale models:
"all"(default),"trend","seasonal", or"short_term".- summary
Logical; if TRUE, return summary statistics instead of full posterior draws.
- probs
Quantiles to compute if
summary = TRUE.- ...
Ignored
Examples
if (FALSE) { # \dontrun{
# Fit model with multi-scale temporal effects (not run - experimental)
set.seed(131)
df <- data.frame(
year = 1:40,
x = rnorm(40),
count = rpois(40, lambda = 22),
effort = rgamma(40, shape = 4.5, rate = 1)
)
fit <- tratio(
count | effort ~ x,
data = df,
family = ratiod_poisson_gamma(),
temporal = temporal_multiscale("year", trend = "rw2", seasonal = 12),
control = list(iter = 200, warmup = 100, chains = 1)
)
# Extract all temporal effects
temp_post <- temporal(fit)
summary(temp_post)
} # }