Skip to contents

Fit the model

Top-level fitting functions

mbmm()
Fit a bank-based MBMM analysis
mbmm_fit_gate()
Fit the MBMM gate model
mbmm_abc_fit()
Fit an ABC rejection-sampling posterior for one subject

ABC reference banks

Build and pool Approximate Bayesian Computation banks

mbmm_abc_bank()
Fit ABC posteriors for multiple subjects or donors
mbmm_pool_bank()
Pool per-donor ABC particles into a mechanistic reference bank
mbmm_predict_bank()
Predict mechanistic bank trajectories at required observation times
mbmm_join_targets()
Join target-specific particle banks into complete multitarget bundles

Gate model

Covariate-linked latent-class gate

mbmm_gate_threshold()
Fitted MBMM gate threshold for a continuous covariate
mbmm_bootstrap_gate_threshold()
Bootstrap an MBMM gate threshold
mbmm_backtransform_threshold()
Back-transform an MBMM gate threshold
mbmm_predict_gate()
Predict fitted MBMM gate probabilities
summary(<mbmm_gate>)
Summarize an mbmm_gate object
print(<mbmm_gate>)
Print an mbmm_gate object
plot(<mbmm_gate>)
Plot a fitted MBMM gate curve against one continuous covariate

Scoring and thresholds

mbmm_score_subjects()
Score every subject against class-specific reference banks
mbmm_class_loglik()
Reference-bank class-conditional log-likelihood for one subject
mbmm_noise_floor_loglik()
Analytic non-establishment class likelihood for COVID5001-style analyses
summary(<mbmm_threshold_summary>)
Summarize an MBMM threshold summary
print(<mbmm_threshold_summary>)
Print an MBMM threshold summary

Simulation and demo data

Simulate trajectories and example datasets used in the vignettes

mbmm_simulate_demo_antibody()
Simulate a fully synthetic baseline antibody measurement
mbmm_simulate_abortive_pattern()
Simulate one transient or abortive detection pattern
mbmm_simulate_cop_demo()
Simulate a synthetic correlate-of-protection cohort
mbmm_simulate_manuscript_demo()
Simulate a reduced manuscript-style MBMM dataset
mbmm_example_eclipse_simulate()
Example mechanistic trajectory model: eclipse-phase viral kinetics
mbmm_example_eclipse_prior()
Example ABC prior sampler for the eclipse-phase model
mbmm_demo_visit_schedules()
Public visit schedules for the reduced MBMM simulation
mbmm_demo_scenario_grid()
Create the default reduced manuscript-style scenario grid
mbmm_run_simulation_grid()
Run a manuscript-style simulation grid
mbmm_productive_infection()
Fit a productive-infection MBMM analysis

Model fit objects

summary(<mbmm_fit>)
Summarize an mbmm_fit object
print(<mbmm_fit>)
Print an mbmm_fit object
plot(<mbmm_fit>)
Plot the bank log-likelihood-ratio diagnostic for an MBMM fit

Numerical utilities

mbmm_rk4_solve()
Fixed-step 4th-order Runge-Kutta ODE integrator (base R, no dependencies)
mbmm_logsumexp()
Numerically stable log-sum-exp
mbmm_logmeanexp()
Numerically stable log-mean-exp
mbmm_logit()
Logit
mbmm_inv_logit()
Inverse logit
mbmm_safe_log10()
Safe log10 with a positive floor
mbmm_dnorm_censored()
Gaussian log-density with optional left censoring at an LOD
mbmm_default_distance()
Default ABC discrepancy: censoring-aware weighted RMSE on the log10 scale