Extract posterior distributions of spatially-varying coefficients (SVCs) from a fitted ratio model with SVC specification.
Value
A ratiod_svc_posterior object containing:
draws: Array of posterior draws (draws x locations x terms)coords: Coordinate matrixterm_names: Names of SVC terms
Examples
if (FALSE) { # \dontrun{
# Generate synthetic spatial data (not run - SVC not fully supported)
set.seed(303)
n <- 40
df <- data.frame(
lon = runif(n, 0, 10),
lat = runif(n, 0, 10),
depth = rnorm(n),
count = rpois(n, 20),
effort = rgamma(n, shape = 4, rate = 1)
)
# Fit model with SVC
fit <- tratio(
count | effort ~ depth,
data = df,
family = ratiod_poisson_gamma(),
svc = spatial_svc(~ lon + lat, terms = c(1, 2)),
control = list(iter = 200, warmup = 100, chains = 1)
)
# Extract SVC posteriors
svc_post <- svc(fit)
summary(svc_post)
} # }