R/plot_antibody_model.R
plot_estimated_antibody_model.RdPlots the posterior antibody kinetics implied by the fitted model, optionally including prediction intervals for observed measurements.
plot_estimated_antibody_model(
chain,
antibody_data = NULL,
demographics = NULL,
antigenic_map = NULL,
possible_exposure_times = NULL,
par_tab = NULL,
nsamp = 1000,
measurement_bias = NULL,
solve_times = seq(1, 30, by = 1),
data_type = 1,
settings = NULL,
by_group = TRUE,
add_prediction_intervals = FALSE,
exponential_waning = NULL,
set_infections = NULL,
verbose = FALSE
)the full MCMC chain to generate antibody level trajectories from, usually `chains$theta_chain`
the antibody data frame, with one row per measurement
optional data frame identifying the demographic group for each individual. This is used when model parameters are stratified by demographics. See the [demographic stratification and covariate vignette](https://seroanalytics.github.io/serosolver/articles/demographics_covariates.html).
(optional) a data frame of antigenic x and y coordinates. Must have column names: x_coord; y_coord; inf_times. The `inf_times` column identifies the circulation or exposure time represented by each map entry. See example_antigenic_map
(optional) if no antigenic map is specified, this argument gives the vector of times at which individuals can be infected
the model control table specifying the parameters in the MCMC chain
number of draws to take from the posterior
default NULL, optional data frame mapping each `biomarker_id` and `biomarker_group` combination to the `rho_index` of the measurement-shift parameter that it uses. See the [advanced features vignette](https://seroanalytics.github.io/serosolver/articles/advanced_features.html).
vector of times to solve model over
numeric or text value: `1` or `"discrete"` for discrete, bounded data; `2` or `"continuous"` for continuous, bounded data; or `3` or `"false_positive"` for continuous data with the false-positive observation model. Supply one value per biomarker group, or one value to use for all groups. For bounded data, the limits are given by `min_measurement` and `max_measurement` in par_tab.
if not NULL, list of serosolver settings as returned from the main serosolver function, such as `res$settings`
if TRUE, plots separate trajectories for each biomarker ID; otherwise combines the trajectories
if TRUE, adds intervals for predicted observations as well as the underlying antibody model
Deprecated compatibility argument. Prefer a fixed `exponential_waning` row in `par_tab`, with `values = 1` and `par_type = 0`.
numeric vector giving the corresponding times in `possible_exposure_times` to simulate infections
if TRUE, prints messages when settings are used or predictions are prepared
a ggplot2 object giving model-predicted antibody level and predicted observations over time since infection
Other infection_history_plots:
calculate_infection_history_statistics(),
plot_antibody_data(),
plot_antibody_predictions(),
plot_cumulative_infection_histories(),
plot_individual_number_infections(),
plot_infection_history_chains_indiv(),
plot_infection_history_chains_time(),
plot_infection_history_posteriors(),
plot_model_fits(),
plot_total_number_infections()