How do I complete a Visual Predictive Check in Simbiology PopPK sbionlmefitsa

84 views (last 30 days)
Hi Simbiology Team:
I wanted to complete a visual predictive check (VPC) following a popPK analysis using the sbionlmefitsa. I brought this up to the Simbiology team some years ago and explained that it is generally standard practice to complete a VPC following NLME population pharmacokinetics.
I thought to adapt this example that used sbiofit - the nonlinear least-squares regression - for the sbionlmefitsa and it did not work:
https://www.mathworks.com/help/simbio/ref/simbiology.fit.parameterconfidenceinterval.html
ci = sbioparameterci(fitResults)
ci_results= sbiopredictionci(ci);
Plot Confidence Intervals for Model Predictions
plot(ci_results)
I understand there is a SimFunction tool as well. Is there way, I can simply export Simbiology results or the results as fitResults.m to do a VPC from a PopPK Example in Matlab Simbiology?
Thank you.

Accepted Answer

Sietse Braakman
Sietse Braakman on 23 Sep 2019
Hi Andy,
Please excuse the late reply. Have you looked into using sbiosampleparameters? This function allows you to sample your covariate model with the thetas and etas you have estimated. The covariate model, the estimated thetas and etas can all be extracted from your Mixed effects fit results (NLMEresults object). In addition, you will need to create a dataset that contains the regressors for each subject that you want to simulate.
Once you have sampled your covariate model with the estimated thetas and etas, you can then simulate your model using the a simfunction. I recommend calling the simfunction with an outputTimes vector instead of a stopTime, in order to get homogeneous output vectors for each simulation. This is a requirement for calculating percentiles, see below.
Once you have simulated your samples, you can use the prctile function to calculate the percentiles. For the visualization of percentiles, you might want to have a look at visualization methods, perhaps on the MATLAB FileExchange here.
Let me know if this answers your question.
Best,
Sietse
  1 Comment
Andy
Andy on 30 Sep 2019
Edited: Andy on 2 Oct 2019
Hi Sietse,
Thank you for taking the time to answer this question. I was able to sample the thetas and omegas and completed the monte-carlo simulations to generate the VPC data. However, the visualization part was done using the 'vpc' package in R which was is found here: http://vpc.ronkeizer.com/
Thank you for the information Sietse.
Andy

Sign in to comment.

More Answers (1)

Sietse Braakman
Sietse Braakman on 9 Oct 2019
Hi Andy,
Thank you for the feedback. To support my suggested approach with a more concrete example, we have written a function (vpc.m) and driver script (vpcDriver.m) that generates the VPC plot. We used the model and dataset that is included in your FileExchange post, which is not saved in the loadme.mat file. An example of the output is shown below. The code is attached to this post.
Note that you might need to include additional functionality if you need to use binning, prediction correction or want to incorporate an error model.
Best,
Sietse
VPC.png
  1 Comment
Andy
Andy on 14 Oct 2019
Hi Sietse,
Thank you for taking the time to provide a clear answer to this question using the data from my uploaded Simbiology Project.
I re-ran the PopPK fit and completed the Visual Predictive Check and it worked well.
Here is an update figure:
VPC_fit_ok.jpg
This was outstanding support and I am sure a lot of Matlab Simbiology users will be grateful to finally have the Visual Predictive Check script.
Outstanding and thanks again.
Andy

Sign in to comment.

Communities

More Answers in the  SimBiology Community

Categories

Find more on Perform Sensitivity Analysis in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!