R/plot_infection_histories.R
plot_infection_history_chains_time.RdPlots the MCMC trace and posterior density of inferred infections for selected exposure times.
plot_infection_history_chains_time(
inf_chain,
burnin = 0,
times = NULL,
n_alive = NULL,
pad_chain = TRUE
)the infection-history chain returned by load_mcmc_chains, in long format
if not already discarded, discards rows with `samp_no <= burnin`
optional vector of `j` indices identifying the exposure times to plot
optional data frame containing `j` and `n_alive`. If supplied, infection counts are divided by the number alive to show attack rates.
if TRUE, adds zero-valued entries for infection events that are absent from the sparse chain
A list containing the MCMC trace plot and posterior density plot.
plot_infection_history_chains_indiv
Other infection_history_plots:
calculate_infection_history_statistics(),
plot_antibody_data(),
plot_antibody_predictions(),
plot_cumulative_infection_histories(),
plot_estimated_antibody_model(),
plot_individual_number_infections(),
plot_infection_history_chains_indiv(),
plot_infection_history_posteriors(),
plot_model_fits(),
plot_total_number_infections()
if (FALSE) { # \dontrun{
data(example_inf_chain)
data(example_antibody_data)
data(example_antigenic_map)
times <- example_antigenic_map$inf_times
n_alive_group <- get_n_alive_group(example_antibody_data, times,melt_data = TRUE)
n_alive_group$j <- times[n_alive_group$j]
plot_infection_history_chains_time(example_inf_chain, 0, sample(seq_along(times),10),n_alive_group,FALSE)
} # }