Skip to content

Parsing EpiFusion Outputs

Ciara Judge edited this page Dec 20, 2023 · 12 revisions

What is in the output?

For each MCMC chain, EpiFusion will give you the following output files:

  • betas: csv file where each row is a trajectory of rate beta sampled from the MCMC
  • trajectories: csv file where each row is a daily infection trajectory sampled from the MCMC
  • rt: csv file where each row is a daily Rt trajectory sampled from the MCMC
  • params: txt file where each column is an MCMC parameter, and each row is an MCMC sample
  • likelihoods: txt file of the posterior likelihoods from each MCMC step
  • acceptance: txt file where each line logs if the MCMC step was accepted (1) or rejected (0)

How do I interpret the output?

We have a number of useful R functions for parsing through the output which are in the 'EpiFusion_utilities.R' script, to load these just run

source('EpiFusion_utilities.R')

in an R session where your working directory has this script. Someday we hope to package these functions in an R package, but for now the script has everything you should need.

EpiFusion_utilities.R Functions

Here's a guide to all the functions in EpiFusion_utilities.R.

loadlikelihoods()

Description: Loads the log likelihood values for each MCMC sample on each chain. Input: A filepath to an EpiFusion outputs folder -Output:_ A list of length (number of chains), of vectors of length (number of MCMC samples per chain). The values of these vectors are the log likelihood of that chain at that MCMC sample.

Clone this wiki locally