{"title":"Within-chain parallelization-Giving Stan Jet Fuel for population modeling in pharmacometrics.","authors":"Casey Davis, Pavan Vaddady","doi":"10.1002/psp4.13238","DOIUrl":null,"url":null,"abstract":"<p><p>Stan is a powerful probabilistic programming language designed mainly for Bayesian data analysis. Torsten is a collection of Stan functions that handles the events (e.g., dosing events) and solves the ODE systems that are frequently present in pharmacometric models. To perform a Bayesian data analysis, most models in pharmacometrics require Markov Chain Monte Carlo (MCMC) methods to sample from the posterior distribution. However, MCMC is computationally expensive and can be time-consuming, enough so that people will often forgo Bayesian methods for a more traditional approach. This paper shows how to speed up the sampling process in Stan by within-chain parallelization through both multi-threading using Stan's reduce_sum() function and multi-processing using Torsten's group ODE solver. Both methods show substantial reductions in the time necessary to sufficiently sample from the posterior distribution compared with a basic approach with no within-chain parallelization.</p>","PeriodicalId":10774,"journal":{"name":"CPT: Pharmacometrics & Systems Pharmacology","volume":" ","pages":""},"PeriodicalIF":3.1000,"publicationDate":"2024-10-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"CPT: Pharmacometrics & Systems Pharmacology","FirstCategoryId":"3","ListUrlMain":"https://doi.org/10.1002/psp4.13238","RegionNum":3,"RegionCategory":"医学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q2","JCRName":"PHARMACOLOGY & PHARMACY","Score":null,"Total":0}
引用次数: 0
Abstract
Stan is a powerful probabilistic programming language designed mainly for Bayesian data analysis. Torsten is a collection of Stan functions that handles the events (e.g., dosing events) and solves the ODE systems that are frequently present in pharmacometric models. To perform a Bayesian data analysis, most models in pharmacometrics require Markov Chain Monte Carlo (MCMC) methods to sample from the posterior distribution. However, MCMC is computationally expensive and can be time-consuming, enough so that people will often forgo Bayesian methods for a more traditional approach. This paper shows how to speed up the sampling process in Stan by within-chain parallelization through both multi-threading using Stan's reduce_sum() function and multi-processing using Torsten's group ODE solver. Both methods show substantial reductions in the time necessary to sufficiently sample from the posterior distribution compared with a basic approach with no within-chain parallelization.
Stan 是一种功能强大的概率编程语言,主要用于贝叶斯数据分析。Torsten 是一组 Stan 函数,用于处理事件(如用药事件)和解决药物计量学模型中经常出现的 ODE 系统。要进行贝叶斯数据分析,药物计量学中的大多数模型都需要用马尔可夫链蒙特卡罗(MCMC)方法从后验分布中采样。然而,MCMC 的计算成本很高,而且非常耗时,因此人们往往会放弃贝叶斯方法,转而采用更传统的方法。本文展示了如何通过使用 Stan 的 reduce_sum() 函数进行多线程处理和使用 Torsten 的组 ODE 求解器进行多进程处理,在 Stan 中通过链内并行化加速采样过程。与没有链内并行化的基本方法相比,这两种方法都显示出从后验分布中充分采样所需的时间大幅减少。