Learn R Programming

SimInf (version 11.1.0)

as.data.frame.SimInf_pmcmc: Coerce a SimInf_pmcmc object to a data.frame

Description

Extract the posterior samples from the MCMC chain stored in a SimInf_pmcmc object and convert them into a data.frame.

Usage

# S3 method for SimInf_pmcmc
as.data.frame(x, ...)

Value

A data.frame where rows represent MCMC iterations and columns represent the posterior samples of the parameters.

Arguments

x

A SimInf_pmcmc object.

...

Additional arguments (currently ignored).

Details

The resulting data.frame contains one row per MCMC iteration and one column per parameter. These samples represent the joint posterior distribution of the parameters. This format is convenient for post-processing and visualization.

See Also

pmcmc for running the PMCMC analysis, SimInf_pmcmc for the class definition, and continue_pmcmc for continuing an existing PMCMC run.