Skip to contents

Main Entry Point

The function most users call directly. Expects preprocessed standards on the fitting scale (use curveRcore::preprocess_standards() upstream). Fits all curve_id values simultaneously via hierarchical Stan models and returns a calibration_result_multiplate.

fit_calibration_bayes()
Fit Bayesian Hierarchical Calibration Curves

Multi-Curve Helpers

Convenience extractors that operate on calibration_result_multiplate objects returned by fit_calibration_bayes(). Both functions also accept the legacy single-calibration_result format.

summary_table_bayes()
Extract a Per-Curve Summary Table from Bayesian Results
collect_samples_bayes()
Collect All Sample Predictions from Bayesian Results
collect_standards_bayes()
Collect All Standard Data from Bayesian Results
collect_blanks_bayes()
Collect All Blank Data from Bayesian Results

Stan Compilation and MCMC Fitting

Lower-level functions that compile Stan models and run HMC/NUTS sampling. Called internally by fit_calibration_bayes() but exported for users who need fine-grained control over model compilation, sampling parameters, or multi-step workflows.

compile_stan_model()
Compile a curveRbayes Stan Model (Cached)
fit_bayes_single()
Fit a Single Model Family via MCMC
extract_curve_params()
Extract Curve-Level Posterior Summaries

Stan Data and Priors

Functions that prepare inputs for Stan. compute_dynamic_priors() derives weakly informative hyperpriors from the preprocessed data range. build_stan_data() assembles all Stan inputs — observations, curve indices, and prior scalars — into the named list expected by the Stan data {} block.

compute_dynamic_priors()
Compute Data-Adaptive Priors for Stan Models
build_stan_data()
Build Stan Data List for a Model Family

LOO-CV Model Selection

PSIS-LOO cross-validation and Bayesian stacking weights. compute_loo() extracts the log_lik generated quantity and computes a loo object. compare_models_loo() runs LOO for every fitted model and returns the loo_compare() table plus stacking weights. Called automatically by fit_calibration_bayes() when more than one model is fitted.

compute_loo()
Compute LOO-CV for a Fitted Bayesian Model
compare_models_loo()
Compare Models via LOO-CV and Stacking Weights

Posterior Prediction and CDAN Precision

Posterior predictive grid construction and test-sample back-calculation. predict_grid_bayes() implements the three-step CDAN procedure (posterior draw, forward evaluation, Student-t noise injection, analytical inversion) to produce a full precision profile. predict_samples_bayes() back-calculates observed test-sample responses without noise injection, since the observed response is already the noisy measurement.

predict_grid_bayes()
Predict Grid Response from Posterior Draws (Bayesian)
predict_samples_bayes()
Back-Calculate Sample Concentrations from Posterior Draws

Example Datasets

Synthetic immunoassay datasets for testing and documentation.

bead_assay_example
Simulated Bead-Based Immunoassay Example Dataset
elisa_assay_example
Simulated ELISA Example Dataset