Skip to contents

An S3 class representing the output of a Bayesian MCMC model fitted by run_mod(). The sr_model object is a subclass of tibble::tbl_df containing MCMC samples from the joint posterior distribution of host-specific antibody kinetic parameters, conditional on the provided input data.

Each row represents one posterior draw for one parameter, one antigen-isotype combination, one subject, and one stratification level.

Data columns

Iteration

integer MCMC sampling iteration index.

Chain

integer MCMC chain index (between 1 and the number of chains specified in run_mod()).

Parameter

character name of the antibody dynamic curve parameter. One of:

  • y0 – baseline antibody concentration

  • y1 – peak antibody concentration

  • t1 – time to peak

  • shape – shape parameter

  • alpha – decay rate

Iso_type

character antibody/antigen isotype combination being evaluated (e.g., "HlyE_IgA", "HlyE_IgG").

Stratification

character the level of the stratification variable used when fitting the model, or "None" if no stratification was specified.

Subject

character identifier of the subject. Includes observed subjects as well as "newperson", which represents the posterior predictive distribution for a hypothetical new individual with no observed data.

value

numeric posterior sample value of the parameter.

Attributes

In addition to the standard tibble::tbl_df attributes (names, row.names, class), an sr_model object carries the following custom attributes:

nChains

integer number of MCMC chains run.

nParameters

integer number of parameters estimated in the model.

nIterations

integer total number of MCMC iterations specified.

nBurnin

integer number of burn-in iterations discarded before sampling.

nThin

integer thinning interval (ratio of total iterations to retained samples, i.e., niter / nmc).

population_params

(optional) a tibble::tbl_df of modeled population-level parameters, included when with_pop_params = TRUE in run_mod(). Indexed by Iteration, Chain, Parameter, Iso_type, and Stratification. Contains the following population parameters:

  • mu.par – the population means of the host-specific model parameters (on logarithmic scales).

  • prec.par – the population precision matrix of the hyperparameters (with diagonal elements equal to inverse variances).

  • prec.logy – a vector of population precisions (inverse variances), one per antigen/isotype combination.

priors

a list summarizing the input priors used in the model, with the following elements:

  • mu_hyp_param – prior means for y0, y1, t1, shape, and alpha.

  • prec_hyp_param – precision hyperparameters (inverse variances).

  • omega_param – Wishart hyperprior diagonal entries.

  • wishdf – degrees of freedom for the Wishart distribution.

  • prec_logy_hyp_param – log-scale precision hyperparameters.

fitted_residuals

a data.frame containing fitted values and residuals for all observations, with columns:

  • Subject – subject identifier.

  • Iso_type – antigen-isotype combination.

  • t – time since infection.

  • fitted – fitted value calculated from posterior parameter estimates.

  • residual – residual (observed minus fitted).

jags.post

(optional) a list of raw runjags::run.jags() output objects, one per stratification level. Included when with_post = TRUE in run_mod(). These objects can be large.

Construction

sr_model objects are created by run_mod() and should not normally be constructed directly.

Inheritance

The class hierarchy is sr_model > tbl_df > tbl > data.frame, so standard dplyr::dplyr-package and tibble::tibble-package operations work on sr_model objects.

See also