setup_infection_histories: Propose initial infection histories

View source: R/mcmc_help.R

setup_infection_historiesR Documentation

Propose initial infection histories

Description

Given a matrix of antibody data, proposes plausible initial infection histories from which to begin MCMC sampling. The idea is to move along time in the context of antigenic drift and look at an individual's antibody level against each biomarker ID Where antibody levels are raised, we suggest an infection. However, to avoid suggesting multiple infections for regions of high antigenic similarity, we place a necessary gap (defined by 'space') between proposed infection times.

Usage

setup_infection_histories(
  antibody_data,
  possible_exposure_times,
  space = 5,
  antibody_cutoff = 2,
  sample_prob = 0.9
)

Arguments

antibody_data

the matrix of titres data with columns for individual, sample, and antibody level

possible_exposure_times

vector of real times for all strains

space

how many epochs must separate proposed infections

antibody_cutoff

specifies how high the antibody level must be to imply an infection

sample_prob

if antibody levels suggest an infection, then add an infection with 1 minus this probability

Value

an nxm matrix of infection histories containing 1s and 0s, where n is the number of individuals and m is the number of time periods for potential infection

See Also

Other setup_infection_histories: setup_infection_histories_antibody_level()

Examples

data(example_antibody_data)
data(example_antigenic_map)
start_inf <- setup_infection_histories(example_antibody_data, example_antigenic_map$inf_times)

seroanalytics/serosolver documentation built on Dec. 14, 2024, 5:33 a.m.