Torsten is a library of C++ functions that support applications of Stan in Pharmacometrics. The current version provides:
This prototype is still under development and has been uploaded to facilitate working with the community of Stan developers. The current version was written by Charles Margossian (@charlesm93), Yi Zhang (@yizhang-cae), Bill Gillespie (@billgillespie), and Metrum Research Group, LLC (@metrumresearchgroup. We have recieved extensive help from the Stan development team.
See the user manual (torstenManual.pdf
) for more information and guidance on the examples. If you have any questions, please raise an issue on GitHub or send us an e-mail at billg@metrumrg.com.
The Torsten library is open-source and licensed under the BSD 3-clause license.
To install CmdStan with Torsten, run the shell script script setupTorsten.sh
.
To install RStan with Torsten, install the R package TorstenHeaders
(https://github.com/metrumresearchgroup/TorstenHeaders) and run
install_torsten():
devtools::install_github('metrumresearchgroup/TorstenHeaders')
library(torstenHeaders)
install_torsten()
We are working with Stan's development team to create a system to add and share Stan packages. In the mean time, users can download a forked version of Stan with Torsten from GitHub. The latest version of Torsten (v0.84) is compatible with Stan v2.17.1. Torsten is agnostic to which Stan interface you use.
For each model, we provide the following files:
The simulation file can be used to create the data and initial estimate files.
There are three Stan files for the two compartment model: TwoCptModel
, LinTwoCptModel
, and GenTwoCptModel
. We also provide more sophisticated PK/PD examples. TwoCptModelPopulation
extends the two compartment model to the case where we have data from multiple patients with inter-individual variability.
See the manual for more assistance.
Under the R directory, we provide scripts to run the Stan models.
The C++ code for Torsten can be found on the following repos:
Math Library: https://github.com/metrumresearchgroup/math
Stan Grammar: https://github.com/metrumresearchgroup/stan