setup_antibody_data_for_posterior_func: Setup antibody data indices

View source: R/helpers.R

setup_antibody_data_for_posterior_funcR Documentation

Setup antibody data indices

Description

Sets up a large list of pre-indexing and pre-processing to speed up the model solving during MCMC fitting. Note that this should be 'antibody_data' after subsetting to only 'run==1', as we will figure out elsewhere which solves to use as repeats

Usage

setup_antibody_data_for_posterior_func(
  antibody_data,
  antigenic_map = NULL,
  possible_exposure_times = NULL,
  age_mask = NULL,
  n_alive = NULL,
  verbose = FALSE
)

Arguments

antibody_data

the data frame of data to be fitted. Must have columns: group (index of group); individual (integer ID of individual); samples (numeric time of sample taken); virus (numeric time of when the virus was circulating); biomarker_group (integer of the observation group type, using a unique value for each distinctive type of observation underpinned by the same generative model); titre (integer of titre value against the given virus at that sampling time). See example_antibody_data

antigenic_map

(optional) a data frame of antigenic x and y coordinates. Must have column names: x_coord; y_coord; inf_times. See example_antigenic_map

possible_exposure_times

(optional) if no antigenic map is specified, this argument gives the vector of times at which individuals can be infected

age_mask

see create_age_mask - a vector with one entry for each individual specifying the first epoch of circulation in which an individual could have been exposed

n_alive

if not NULL, uses this as the number alive in a given year rather than calculating from the ages. This is needed if the number of alive individuals is known, but individual birth dates are not

verbose

if TRUE, brings warning messages

Value

a very long list. See source code directly.

See Also

create_posterior_func


adamkucharski/serosolver documentation built on April 13, 2024, 10:24 a.m.