Extracts and formats posterior summary statistics from a fitted in-season STAN model. Converts the STAN output into a long-format table suitable for downstream use.

extract_inseason_estimates(inputs, fit)

Arguments

inputs

A list of inputs produced by prepare_inseason_inputs().

fit

A fitted stanfit model object returned by fit_inseason_model().

Value

A tibble in long format with columns:

parameter

Name of the parameter (e.g., lambda, phi, cp, muRT_log_lambda).

statistic

Summary statistic (e.g., mean, sd, 2.5, 97.5, Rhat).

value

Numeric value of the summary statistic.

year, week

Optional indices matched to corresponding dimensions.

model_name, site, stream

Metadata from the model inputs.

srjpedata_version

Version of the SRJPEdata package used.

Details

The function computes summaries for all monitored parameters, including population-level effects (e.g., phi, lambda), year- and week-specific estimates (cp, RTpars), and covariate or autocorrelation parameters (e.g., bCov, rho_pro).

Indexing from STAN arrays is decoded and matched to human-readable variables such as year or week. Warnings are issued if convergence diagnostics (Rhat) exceed 1.05 for any parameter.

See also

fit_inseason_model(), rstan::summary()