Given outputs from an MCMC run and the data used for fitting, generates an NxM matrix of plots where N is the number of individuals to be plotted and M is the range of sampling times. Where data are available, plots the observed titres and model predicted trajectories
plot_infection_histories( chain, infection_histories, titre_dat, individuals, antigenic_map = NULL, strain_isolation_times = NULL, par_tab, nsamp = 100, mu_indices = NULL, measurement_indices_by_time = NULL )
chain | the full MCMC chain to generate titre trajectories from |
---|---|
infection_histories | the MCMC chain for infection histories |
titre_dat | the data frame of titre data |
individuals | the subset of individuals to generate credible intervals for |
antigenic_map | (optional) a data frame of antigenic x and y coordinates. Must have column names: x_coord; y_coord; inf_times. See |
strain_isolation_times | (optional) if no antigenic map is specified, this argument gives the vector of times at which individuals can be infected |
par_tab | the table controlling the parameters in the MCMC chain |
nsamp | number of samples to take from posterior |
mu_indices | vector of integers. for random effects on boosting parameter, mu. If random mus are included in the parameter table, this vector specifies which mu to use for each circulation year. For example, if years 1970-1976 have unique boosting, then mu_indices should be c(1,2,3,4,5,6). If every 3 year block shares has a unique boosting parameter, then this should be c(1,1,1,2,2,2) |
measurement_indices_by_time | 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 |
a ggplot2 object
Other infection_history_plots:
calculate_infection_history_statistics()
,
generate_cumulative_inf_plots()
,
plot_data()
,
plot_infection_history_chains_indiv()
,
plot_infection_history_chains_time()
,
plot_number_infections()
,
plot_posteriors_infhist()
,
plot_total_number_infections()