Fit and simulate models

serosolver()

Run the serosolver model

simulate_data()

Simulate full data set

simulate_attack_rates()

Simulate attack rates

simulate_infection_histories()

Simulate infection histories

simulate_antibody_model()

Simulate the antibody model

Prepare and check inputs

check_data()

Checks the entries of data used in serosolver

check_demographics()

Checks the entries of demographics data frame used for parameter stratification

check_inf_hist()

Check infection history matrix

check_par_tab()

Check and prepare a model parameter table

check_attack_rates()

Checks the attack_rates supplied in simulate_data

generate_antigenic_map_flexible()

Generate antigenic map, flexible

load_antibody_data()

Load serological antibody data from CSV file

load_antigenic_map()

Load in antigenic map file from CSV

create_age_mask()

Create age mask

create_sample_mask()

Create sample mask

Model options and priors

create_start_level_data()

Generate starting antibody levels

add_rhos_par_tab()

Add measurement offset values to par_tab

extend_par_tab_biomarker_groups()

Extend parameter table for multiple biomarker_groups

generate_start_tab()

Generate starting parameter table

describe_priors()

Describe infection history priors

find_beta_prior_mode()

Find Beta distribution parameters with mode

find_beta_prior_with_mean()

Find beta parameters with maximum variance

find_beta_prior_with_mean_var()

Find beta parameters for mean and variance

MCMC output and summaries

load_start_tab()

Load a starting parameter table from file

load_theta_chains()

Load MCMC chains from CSV files for antibody kinetics parameters (theta)

load_infection_chains()

Load MCMC chains from CSV files for infection histories

load_mcmc_chains()

Load MCMC chains for the antibody kinetics parameters and infection histories from CSV outputs

get_antibody_level_predictions()

Generate antibody level credible intervals

calculate_infection_history_statistics()

Get posterior information for estimated infection histories

get_best_pars()

Best pars

get_best_draw()

Best infection history and theta parameters

get_index_pars()

Index pars

pad_inf_chain()

Pad infection history chain

get_n_alive()

Get number alive

get_n_alive_group()

Get number alive by population group

get_total_number_infections()

Get total number of infections

generate_quantiles()

Formatted quantiles

identify_run_lengths()

Identify runs of infections from posterior

summarize_run_lengths()

Summarize runs of infections from posterior

Plotting and diagnostics

plot_2d_density()

Plot joint posterior densities for two parameters

plot_antibody_data()

Plot raw data

plot_antibody_dependent_boosting()

Antibody dependent boosting relationship

plot_antibody_model()

Plot the antibody model

plot_antibody_predictions()

Plots model predicted titers against observations

plot_attack_rates()

Plot historical attack rates with pointrange plots

plot_cumulative_infection_histories()

Plot cumulative and per time posterior infection probability densities

plot_estimated_antibody_model()

Plots estimated antibody kinetics model

plot_individual_number_infections()

Plot point range number infections per individual

plot_infection_history_chains_indiv()

Plot MCMC trace for infections per individual

plot_infection_history_chains_time()

Plot MCMC trace for infections per year

plot_infection_history_posteriors()

Plot inferred posteriors infection histories

plot_mcmc_diagnostics()

Plot MCMC diagnostics

plot_model_fits()

Plots infection histories and antibody model

plot_posteriors_theta()

Plot posterior parameter traces and densities

plot_samples_distances()

Plot time between serum samples

plot_total_number_infections()

Total number of infections

Example data

example_antibody_data

Example antibody data

example_longitudinal_antibody_data

Example longitudinal antibody data

example_multiple_biomarker_groups_data

Example antibody data with multiple biomarker groups

example_antigenic_map

Example antigenic map

example_inf_chain

Example MCMC chain for infection histories

example_inf_hist

Example infection history matrix

example_par_tab

Example parameter table

example_theta_chain

Example MCMC chain for kinetics parameters