sample_reporting: Draw reporting parameter values either by sampling or by...

View source: R/sampling.R

sample_reportingR Documentation

Draw reporting parameter values either by sampling or by maximising

Description

Draw reporting parameter values either by sampling or by maximising

Usage

sample_reporting(
  snapshot_with_true_cases_df,
  current_reporting_parameters,
  logp_current,
  prior_parameters,
  metropolis_parameters,
  maximise = FALSE,
  ndraws = 1
)

Arguments

snapshot_with_true_cases_df

a tibble with four columns: time_onset, time_reported, cases_reported, cases_true

current_reporting_parameters

a tibble with column names: "reporting_piece_index", "mean", "sd"

logp_current

the value of the log-probability at the current parameter values

prior_parameters

named list with elements 'mean_mu', 'mean_sigma', 'sd_mu', 'sd_sigma' representing the gamma prior parameters for the mean and sd parameters of the reporting parameters (itself described by a gamma distribution)

metropolis_parameters

named list of 'mean_step', 'sd_step' containing step sizes for Metropolis step

maximise

if true choose reporting parameters by maximising log-probability; else (default) use Metropolis MCMC to draw parameters

ndraws

number of iterates of the Markov chain to simulate

Value

a named list with two elements: 'reporting_parameters', a tibble with four columns: "reporting_piece_index", "draw_index", "mean, "sd"; and 'logp' a value of the log-probability for the current parameter values (which is NULL when maximising since this is not used)


ben18785/incidenceinflation documentation built on Feb. 8, 2024, 2:36 a.m.