Learn R Programming

EpiNow2 (version 1.8.0)

get_samples: Get posterior samples from a fitted model

Description

[Stable] Extracts posterior samples from a fitted model, combining all parameters into a single data.table with dates and metadata.

Usage

get_samples(object, ...)

# S3 method for estimate_infections get_samples(object, ...)

# S3 method for epinow get_samples(object, ...)

# S3 method for forecast_infections get_samples(object, ...)

# S3 method for estimate_secondary get_samples(object, ...)

# S3 method for forecast_secondary get_samples(object, ...)

# S3 method for estimate_truncation get_samples(object, ...)

Value

A data.table with columns: date, variable, strat, sample, time, value, type. Contains all posterior samples for all parameters.

Arguments

object

A fitted model object (e.g., from estimate_infections())

...

Additional arguments (currently unused)

Examples

Run this code
if (FALSE) {
# After fitting a model
samples <- get_samples(fit)
# Filter to specific parameters
R_samples <- samples[variable == "R"]
}

Run the code above in your browser using DataLab