simulate_individual_faster: Simulate individual data quickly

View source: R/simulate_data.R

simulate_individual_fasterR Documentation

Simulate individual data quickly

Description

FOR USERS: USE simulate_individual. This function does the same thing, but with a few short cuts for speed. Simulates a full set of antibody data for an individual with known theta and infection_history.

Usage

simulate_individual_faster(
  theta,
  unique_theta_indices = NULL,
  infection_history,
  infection_history_mat_indices,
  antigenic_map_long,
  antigenic_map_short,
  antigenic_distances = NULL,
  unique_biomarker_groups = seq_len(ncol(antigenic_map_long)),
  sampling_times,
  possible_exposure_times,
  measured_biomarker_ids,
  measurement_bias = NULL,
  measurement_indices = NULL,
  data_type = NULL,
  repeats = 1,
  DOB = NULL
)

Arguments

theta

the named parameter vector

infection_history

the vector of 1s and 0s giving presence/absence of infections

antigenic_map_long

the long term antigenic cross reactivity map generated from create_cross_reactivity_vector

antigenic_map_short

the short term antigenic cross reactivity map generated from create_cross_reactivity_vector

antigenic_distances

(optional) same dimensions as antigenic_map_long and antigenic_map_short, but gives the raw euclidean antigenic distances

unique_biomarker_groups

vector of unique measured biomarker types

sampling_times

vector of times at which blood samples were taken

possible_exposure_times

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

measured_biomarker_ids

vector of which biomarker IDs had measurements in 'possible_exposure_times'

measurement_indices

default NULL, optional vector giving the index of ‘measurement_bias' that each antigen/biomarker ID uses the measurement shift from from. eg. if there’s 6 circulation years and 3 strain clusters, then this might be c(1,1,2,2,3,3)

data_type

if not NULL, then a vector of data types to use for each biomarker_group

repeats

number of repeat observations for each year

Value

a data frame with columns samples, virus and titre of simulated data

See Also

Other simulation_functions: simulate_attack_rates(), simulate_data(), simulate_group(), simulate_individual(), simulate_infection_histories()


seroanalytics/serosolver documentation built on April 10, 2024, 3:28 p.m.