[dfe06d]: / man / create_param.Rd

Download this file

114 lines (83 with data), 3.6 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/create_param.R
\name{create_param}
\alias{create_param}
\alias{outbreaker_store}
\alias{outbreaker_param}
\title{Initializes outputs for outbreaker}
\usage{
create_param(data = outbreaker_data(), config = create_config())
}
\arguments{
\item{data}{A list of data items as returned by \code{outbreaker_data}, or
arguments passed to this function.}
\item{config}{A list of settings as returned by \code{create_config}, or
arguments passed to this function.}
}
\value{
A list containing two components \code{$store} and
\code{$current}. \code{store} is a list with the class
\code{outbreaker_store}, used for storing 'saved' states of the
MCMC. \code{current} is a list with the class \code{outbreaker_param}, used
for storing 'current' states of the MCMC. \cr \cr
\code{outbreaker_store} class content:
\itemize{
\item \code{size}: The length of the list, corresponding to the number of
samples saved from the MCMC.
\item \code{step}: A vector of integers of length \code{size}, storing the
steps of the MCMC corresponding to the saved samples.
\item \code{post}: A numeric vector of length \code{size}, storing
log-posterior values.
\item \code{like}: A numeric vector of length \code{size}, storing
log-likelihood values.
\item \code{prior}: A numeric vector of length \code{size},
storing log-prior values.
\item \code{alpha}: A list of length \code{size}. Each item of the list is
an integer vector of length \code{data$N}, storing indices (from 1 to N) of
infectors for each case.
\item \code{t_inf}: A list of length \code{size}. Each item of the list is
an integer vector of length \code{data$N}, storing dates of infections for
each case.
\item \code{mu}: A numeric vector of length \code{size}, storing values of
the mutation rate.
\item \code{kappa}: A list of length \code{size}. Each item of the list is
an integer vector of length \code{data$N}, storing the number of generations
before the last sampled ancestor for each case.
\item \code{pi}: A numeric vector of length \code{size}, storing values of
the reporting probability.
\item \code{eps}: A numeric vector of length \code{size}, storing values of
the contact reporting coverage.
\item \code{lambda}: A numeric vector of length \code{size}, storing values of
the non-infectious contact rate.
\item \code{counter}: A counter used to keep track of the current iteration
of the MCMC (used internally).
}
\code{outbreaker_param} class content:
\itemize{
\item \code{alpha}: An integer vector of length \code{data$N}, storing
indices (from 1 to N) of infectors for each case.
\item \code{t_inf}: An integer vector of length \code{data$N}, storing dates
of infections for each case.
\item \code{mu}: The value of the mutation rate.
\item \code{kappa}: An integer vector of length \code{data$N}, storing the
number of generations before the last sampled ancestor for each case.
\item \code{pi}: The value of the reporting probability.
\item \code{eps}: The value of the contact reporting coverage.
\item \code{lambda}: The value of the non-infectious contact rate.
}
}
\description{
This function creates initial outputs and parameter states for outbreaker.
}
\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)
}
\author{
Thibaut Jombart (\email{thibautjombart@gmail.com})
}