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(
  par_tab,
  antibody_data,
  antigenic_map = NULL,
  possible_exposure_times = NULL,
  age_mask = NULL,
  n_alive = NULL,
  verbose = FALSE,
  use_demographic_groups = NULL,
  timevarying_demographics = NULL
)

Arguments

par_tab

the parameter table controlling information such as bounds, initial values etc. See example_par_tab

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

use_demographic_groups

vector of variable names in 'antibody_data' which should form the stratification for the antibody kinetics model

timevarying_demographics

if not NULL, then calculates an individual's demographic group over the entire time period of the simulation rather than assuming fixed demographics

Value

a very long list. See source code directly.

See Also

create_posterior_func


seroanalytics/serosolver documentation built on Aug. 18, 2024, 12:46 p.m.