Performs Bayesian inference on an epidemiological model using MCMC sampling. This function generates a Turing.jl model from the EpiProblem specification, runs the specified inference method, and returns posterior samples with diagnostics.
fit(model, data, method = nuts_sampler(), ...)An EpiProblem object specifying the complete model.
A data frame or list containing observed data. Must have a
column/element named y_t or cases with case counts.
Optionally can include dates.
A sampler configuration object (e.g., from
nuts_sampler). Default: nuts_sampler().
Additional arguments (currently unused).
An S3 object of class epiaware_fit containing:
posterior::draws_df object with MCMC samples
tibble with parameter summaries
tibble with convergence diagnostics (Rhat, ESS)
List with generated quantities (Rt, infections, etc.)
The original EpiProblem
The data used for inference
The inference method used
if (FALSE) { # \dontrun{
# Load data
data <- read.csv("south_korea_data.csv")
training_data <- data[45:80, ]
# Fit model
results <- fit(
model = mishra_model,
data = training_data,
method = nuts_sampler(warmup = 1000, draws = 1000, chains = 4)
)
# Examine results
print(results)
summary(results)
plot(results, type = "Rt")
} # }