bayespk
An R package for Bayesian population pharmacokinetics without writing Stan: describe a 1- or 2-compartment model in one line with pk_model(), pass a NONMEM-style data set as it is, and get posterior summaries, convergence diagnostics and predictions for new regimens from bpk_fit(), summary() and predict().
Installation
install.packages("bayespk", repos = c("https://daikikumakura.r-universe.dev", "https://cloud.r-project.org"))install.packages("remotes")
remotes::install_github("DaikiKumakura/bayespk")Installing from GitHub compiles the Stan program once and needs a C++ toolchain.
Status
Precompiled Stan programs with closed-form solutions, so nothing is compiled when a model is fitted. Simulation-based calibration (three scenarios, 100 to 200 replicates) shows no miscalibration; on the public theophylline and warfarin data, typical values are within 1 to 10% of nlmixr2 FOCEI estimates. Fits are slower than FOCEI, and variance parameters mix slowly in sparse two-compartment oral designs. R CMD check passes on Linux, macOS and Windows in CI. Not on CRAN.
Cite this software
Kumakura, D. bayespk. Zenodo. https://doi.org/10.5281/zenodo.24325846