create_param: Initializes outputs for outbreaker

View source: R/create_param.R

create_paramR Documentation

Initializes outputs for outbreaker

Description

This function creates initial outputs and parameter states for outbreaker.

Usage

create_param(data = outbreaker_data(), config = create_config())

Arguments

data

A list of data items as returned by outbreaker_data, or arguments passed to this function.

config

A list of settings as returned by create_config, or arguments passed to this function.

Value

A list containing two components $store and $current. store is a list with the class outbreaker_store, used for storing 'saved' states of the MCMC. current is a list with the class outbreaker_param, used for storing 'current' states of the MCMC.

outbreaker_store class content:

  • size: The length of the list, corresponding to the number of samples saved from the MCMC.

  • step: A vector of integers of length size, storing the steps of the MCMC corresponding to the saved samples.

  • post: A numeric vector of length size, storing log-posterior values.

  • like: A numeric vector of length size, storing log-likelihood values.

  • prior: A numeric vector of length size, storing log-prior values.

  • alpha: A list of length size. Each item of the list is an integer vector of length data$N, storing indices (from 1 to N) of infectors for each case.

  • t_inf: A list of length size. Each item of the list is an integer vector of length data$N, storing dates of infections for each case.

  • mu: A numeric vector of length size, storing values of the mutation rate.

  • kappa: A list of length size. Each item of the list is an integer vector of length data$N, storing the number of generations before the last sampled ancestor for each case.

  • pi: A numeric vector of length size, storing values of the reporting probability.

  • eps: A numeric vector of length size, storing values of the contact reporting coverage.

  • lambda: A numeric vector of length size, storing values of the non-infectious contact rate.

  • counter: A counter used to keep track of the current iteration of the MCMC (used internally).

outbreaker_param class content:

  • alpha: An integer vector of length data$N, storing indices (from 1 to N) of infectors for each case.

  • t_inf: An integer vector of length data$N, storing dates of infections for each case.

  • mu: The value of the mutation rate.

  • kappa: An integer vector of length data$N, storing the number of generations before the last sampled ancestor for each case.

  • pi: The value of the reporting probability.

  • eps: The value of the contact reporting coverage.

  • lambda: The value of the non-infectious contact rate.

Author(s)

Thibaut Jombart (thibautjombart@gmail.com)

Examples


## load data
x <- fake_outbreak
data <- outbreaker_data(dates = x$sample, dna = x$dna, w_dens = x$w)

## modify config settings
config <- create_config(move_alpha = FALSE, n_iter = 2e5, sample_every = 1000)

## create param object
param <- create_param(data = data, config = config)


thibautjombart/outbreaker2 documentation built on July 6, 2022, 11:10 p.m.