Simulates a full set of titre data for n_indiv individuals with known theta and infection_histories. Each individual gets nsamps random samples from sampleTimes, and infections can occur at any of strain_isolation_times

simulate_group(
  n_indiv,
  theta,
  infection_histories,
  strain_isolation_times,
  measured_strains,
  sample_times,
  nsamps,
  antigenic_map,
  repeats = 1,
  mus = NULL,
  mu_indices = NULL,
  measurement_bias = NULL,
  measurement_indices = NULL,
  add_noise = TRUE
)

Arguments

n_indiv

number of individuals to simulate

theta

the named parameter vector

infection_histories

the matrix of 1s and 0s giving presence/absence of infections for each individual

strain_isolation_times

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

measured_strains

vector of strains that have titres measured matching entries in strain_isolation_times

nsamps

the number of samples each individual has (eg. nsamps=2 gives each individual 2 random sampling times from sampling_times)

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

repeats

number of repeat observations for each year

mus

default NULL, optional vector of boosting parameters for each strain

mu_indices

default NULL, optional vector giving the index of `mus` that each strain uses the boosting parameter from. eg. if there are 6 circulation years in strain_isolation_times and 3 strain clusters, then this might be c(1,1,2,2,3,3)

measurement_indices

default NULL, optional vector giving the index of `measurement_bias` that each strain 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)

add_noise

if TRUE, adds observation noise to the simulated titres

Value

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

See also