Sampling Parameters from Covariate Models in SimBiology | SimBiology Tutorials for QSP, PBPK, and PK/PD Modeling and Analysis
From the series: SimBiology Tutorials for QSP, PBPK, and PK/PD Modeling and Analysis
Learn how to sample parameter values from covariate models in SimBiology™. Covariate models are used for nonlinear mixed-effect modeling. They allow you to see population-wide parameters while considering individual variations by including fixed parameter-covariate relationships and random effects.
Published: 24 Dec 2019
In this short video, we will see how to sample parameter values from a covariate model. This can be achieved using the function as per the simple parameters from the common line or in a script. Let's first have a look at a small example before diving into matter.
So here, we would like to sample parameter k using an exponential parameter covariate relationship that depends on weight and as random effects. So first we need to define the expression as a matter of string. A description of the supported expression format can be found in the documentation.
Then we need to define two tables, one for thetas, the fixed effects, and another one for omega, the covariance matrix of random effects. Then we define a data set that contains the covariate values for each group you would like to simulate. We can now pass all those variables to us by simple parameters. And here, in our example, you will return phi, a row vector that has a row for each group in our data set, ds.
Let's now have a look at the implementation in MATLAB. We start by creating one compartment PK model using the PK model design helper object. Next, we'll create a covariate model. In this example, we'd like to sample two different parameters, V, the volume of the central compartment that depends on weight, and k the absorption parameter that depends on APGAR. Both have random effect.
To achieve this, we instantiate a covariate model object and define those expressions as matter of string. Symbology would then extract information from the strings, like the covariate labels or the transformations needed. Here, weight it will be centered by its mean, for instance.
Next, we define the fixed and random effect in two different tables. Thetas, we have one data for each fixed effect in the model and omega, the covariance matrix of random effects. Here, there would be some correlation between both random effects.
Next, we load the covariate data. Our data set, ds, contains value for all covariates, weight and APGAR, for each group you would like to simulate. In this data set, we have a total of 16 groups. We also extract the dosing information we are going to use for simulation later.
So now, we're ready to sample the parameters using sbio sample parameters. This returns a metrics phi that contains two columns, one for each parameter, and 16 rows, one for each group in our data set, ds. Phi is now a matrix that we can use in conjunction with a SimFunction to simulate all groups.
So I would create a SimFunction, f, that takes as input all parameters used in the current models and return to concentration of the drug in the central compartment. The drug is also dosed. So here, with one line of code, I'm able to simulate the 16 groups with the dosing information we extracted from the data set and using the values we've just sampled.
Now you can use this on your data set. And please feel free to ask any question you would have on the community website.