Introduction to PmxStan: An R Library to Facilitate PKPD Modeling with Stan

Title: Introduction to PmxStan, An R Library to Facilitate PKPD Modeling with Stan
Date: 6 May 2016, 12:00:00 PM EST
Presenter(s): Yuan Xiong
Skill Level: (Intermediate)

Pharmacometrics Study Group Link:
Study Group Materials: PMXStan_ISoP_webinar.pdf (1.2 MB)
Calendar Addition (ics file) : invite.ics (1.2 KB)

ACOP6 Poster available by clicking below

Continuing the discussion from Introduction to PmxStan: An R Library to Facilitate PKPD Modeling with Stan:

Background: Using a Bayesian approach for making statistical inferences has been gaining popularity in recent years. Stan ( is a Bayesian probabilistic programming language that implements an efficient Hamiltonian Monte Carlo method suitable for fitting larger and more complex models, and these capabilities are attracting more and more users, pharmacometricians in particular.

Currently, two hurdles have largely limited a broad application of Stan in pharmacometrics: 1) a steep learning curve for pharmacometricians to write PKPD model-specific C+±like Stan code; 2) no efficient solvers to work seamlessly with Stan’s No-U-Turn Sampler (NUTS) for ordinary differential equations (ODEs) that are able to handle stiff ODE systems, often encountered in PKPD modeling.
Here we provide an R package called PMXStan to facilitate practical Bayesian PKPD modeling and simulation using Stan.

About the ISOP Pharmacometrics Study Group

  • Do you have lab-meetings and learning tutorials in-house in your academic group, company or your neighborhood?
  • Do you know that not all institutes have the same critical mass of pharmacometric experts as yours?
  • Pharmacometrics Study Groups is a platform to share your learning experiences with peers all around the world. Turn those in-house lab meetings to global knowledge and skill sharing opportunities! .

How it Works: All events will be broadcast live via “Google Hangouts” and detailed notes will be uploaded to the ISOP github site.

Discussion and Questions During the Meeting: You can ask questions by using the Reply Button below here in the Discuss Forum. The presenter will check back to the page during and at the end of the presentation to address questions.

Duration: Generally the study groups are of about 20-40 minute duration. if you need longer, consider having two study group sessions!

Where to Sign up or Suggest an Event Topic:

1 Like

@Brian @isoplinks you posted rxode links for the pmxstan webinar. are these the intended files?

@vijay, I removed them. Will await new files

Hi Yuan, there may be an issue with the sound. I can see your slides but cannot hear.

excellent, thank you for correcting. I can hear now!

is the sound working now?

yes, sounds great! thank you

I am less familiar with Stan. How similar or different are the dataset requirements for Stan vs. something like NONMEM?

1 Like

NONMEM data is a table, Stan data is a list. We’ll come back to this Q at the end

1 Like

it seems to force the diagnostics output only as a pdf, what if I am using something like rmarkdown and I want to print the results inline in a html document?

What are the requirements to need to recompile a model - how much can you change without going through recompilation? Eg at least can you change parameter estimates etc? I assume that changing the model structure would require a recompilation?

How do you cache models between R sessions, so don’t have to recompile each time you start again?

1 Like

if your model does not change, you do not need to recompile. you can also save your workspace, and later use the compiled model, perhaps with different initials and/or data.

you can use it with .Rmd and/or Jupyter notebook. either one can give you an .html file

So priors can be only updated in the generated stand code and not input via the R function?

I think my question relating to dataset structure was just answered for me…it automates the conversion from NONME like dataset if I understand correctly

you are correct, Vijay. further improvement is needed here.

you are correct: data conversion is automatic.

This looks very promising - but where is the code available for everyone else to use? Is there a timeline on release?


will release via github soon


that is great news! I think this would be a great open source addition to our community