Overall model function, fast implementation

titre_data_fast(
  theta,
  infection_history_mat,
  circulation_times,
  circulation_times_indices,
  sample_times,
  rows_per_indiv_in_samples,
  cum_nrows_per_individual_in_data,
  nrows_per_blood_sample,
  measurement_strain_indices,
  antigenic_map_long,
  antigenic_map_short,
  antigenic_distances,
  mus,
  boosting_vec_indices,
  boost_before_infection = FALSE
)

Arguments

theta

NumericVector, the named vector of model parameters

infection_history_mat

IntegerMatrix, the matrix of 1s and 0s showing presence/absence of infection for each possible time for each individual.

circulation_times

NumericVector, the actual times of circulation that the infection history vector corresponds to

circulation_times_indices

IntegerVector, which entry in the melted antigenic map that these infection times correspond to

sample_times

NumericVector, the times that each blood sample was taken

rows_per_indiv_in_samples

IntegerVector, one entry for each individual. Each entry dictates how many indices through sample_times to iterate per individual (ie. how many sample times does each individual have?)

cum_nrows_per_individual_in_data

IntegerVector, How many cumulative rows in the titre data correspond to each individual?

nrows_per_blood_sample

IntegerVector, one entry per sample taken. Dictates how many entries to iterate through cum_nrows_per_individual_in_data for each sampling time considered

measurement_strain_indices

IntegerVector, the indices of all measured strains in the melted antigenic map, with one entry per measured titre

antigenic_map_long

NumericVector, the collapsed cross reactivity map for long term boosting, after multiplying by sigma1 see create_cross_reactivity_vector

antigenic_map_short

NumericVector, the collapsed cross reactivity map for short term boosting, after multiplying by sigma2, see create_cross_reactivity_vector

antigenic_distances

NumericVector, the collapsed cross reactivity map giving euclidean antigenic distances, see create_cross_reactivity_vector

mus

NumericVector, if length is greater than one, assumes that strain-specific boosting is used rather than a single boosting parameter

boosting_vec_indices

IntegerVector, same length as circulation_times, giving the index in the vector mus that each entry should use as its boosting parameter.

boost_before_infection

bool to indicate if calculated titre for that time should be before the infection has occurred, used to calculate titre-mediated immunity

Value

NumericVector of predicted titres for each entry in measurement_strain_indices