This example shows how to perform noncompartmental analysis to calculate NCA parameters and estimate the tumor growth model  parameters from experimental data using nonlinear regression in the SimBiology Model Analyzer app.
The model used in this example is a SimBiology implementation of the pharmacokinetic/pharmacodynamic (PK/PD) model by Simeoni et al. It quantifies the effect of anticancer drugs on tumor growth kinetics from in vivo animal studies. The drug pharmacokinetics are described by a two-compartment model with IV bolus dosing and linear elimination (ke) from the Central compartment. Tumor growth is described as a biphasic process with an initial exponential growth followed by linear growth. The growth rate of the proliferating tumor cells is described by
L1, and Ψ are tumor growth parameters,
x1 is the weight of the proliferating
tumor cells, and w is the total tumor weight. In the absence of any
drugs, tumor is comprised only of proliferating cells, that is,
x1. In the presence of an anticancer
agent, it is assumed that a fraction of the proliferating cells is transformed into
non-proliferating cells. The rate of this transformation is assumed to be a function of the
drug concentration in the plasma and an efficacy factor
k2. The nonproliferating cells,
x2, go through a series of transit stages (x3 and
x4) and are eventually cleared from the system. The flow through of
the transit compartments is modeled as a first-order process with the rate constant
Some adjustments were made to the pharmacodynamics of tumor growth.
Instead of defining the tumor weight as the sum of x1,
x2, x3, and x4, the
tumor weight is determined by the reaction named Increase,
null → tumor_weight, with the reaction rate .
tumor_weight is the total tumor weight, x1 is the weight of the proliferating tumor cells, and L0, and L1 are tumor growth parameters.
Similarly, the decrease in tumor weight is defined by the reaction named
tumor_weight → null, with the
k1 is the forward rate
parameter and x4 is the last species
in the series of transit reductions in tumor weight.
ke is defined as a function of the clearance and the volume
of the central compartment:
ke = Cl_Central/Central.
The experimental (synthetic) data contains measurements from eight patients for three responses: measured drug concentrations in the central compartment, in the peripheral compartment, and measured tumor weight. The data also contains the dosing information, and each patient receives an IV dose at day 7.
The data set contains the following columns.
ID — Patient IDs
Time — Times when measurements are taken
CentralConc — Drug concentration in the central compartment
PeripheralConc — Drug concentration in the peripheral compartment
Dose — Dosing information for each patient
NaN values are used whenever there is no measurement or no dose is
Open the SimBiology Model Analyzer app by typing
simBiologyModelAnalyzer at the command line or by clicking the app icon
on the Apps tab.
On the Home tab of the app, select Open.
Navigate to the folder
matlabroot is the folder where you have installed MATLAB. Select the
project file named
tumor_growth_fitPKPD.sbproj. In the
Browser pane, the Models folder contains the
Tumor Growth Model and the Data1 folder contains the
Classify the measured responses of the data as the dependent variables. In the Browser pane, click Documents and double-click Datasheet1.
In the Data1 table, double-click
Classification under CentralConc. Select
dependent. Repeat the same process for
PeripheralConc and TumorWeight. Now all the data
columns have proper classifications and the data is ready for use.
After you load the data, you can visualize the measured responses.
In the Browser pane, click Workspace.
On the Home tab, in the Plot section, click the time plot. The app generates a time plot of all three responses, namely: CentralConc, PeripheralConc, and TumorWeight.
In the default time plot, Responses correspond to the measured responses and are plotted using different line styles. Scenarios refers to different groups (eight patients) in the data and are plotted using different colors.
Plots are backed by data that are currently present in the app workspace. Plots are not snapshots. When the data (either experimental data or simulation results) is removed or changed, the plots are also updated according to the changes in the underlying data.
You can customize the plot to make it clearer. For example, you can plot the PD data (TumorWeight) on a different axis than the PK data (CentralConc and PeripheralConc). To do so, create two diffferent groups (sets) of responses, where the first set contains only TumorWeight and the second set contains CentralConc and PeripheralConc.
Right-click TumorWeight (gram) in the
Responses table (the middle table in the Property
Editor) and select
Create New Set. The app creates
Set 1 and Set 2. Set 1
contains only TumorWeight, which is now plotted on a different axis than
Set 2, which contains CentralConc and
You can create a set only if there are two or more responses.
The Slice table (the top table in the Property Editor) now contains Sets. This table is a summary table of all slicing variables that are currently present in the plot and their corresponding plot styles. In this current plot, the slicing variables are Sets, Responses, Scenarios, and Dose.
You can slice your data by using different slicing variables. Each slicing variable is shown in the plot using a different visual style (or channel) such as color, line style, and axes position. Slicing variables can represent attributes of data, such as responses or scenarios (that is, groups or simulation runs). Slicing variables can also be covariates or parameter values associated with a scenario or group. By default, the slicing variables are provided for different response variables and different scenarios in the plotted data. Additional visual styles (or channels) can be added for sets of responses and associated parameter or covariate variables.
You can also group the responses based on different dose amounts that the patients receive. There are three different dose groups: 30, 75, and 150 mg.
In the Slice table, at the Dose row,
double-click the empty cell and select
Color. A red indicator
appears because another slicing variable (Scenarios) has the same plot
style. Clear the style (visual channel) for Scenarios by selecting
In the Dose table (the bottom table), the app has automatically
binned the dose amounts. Set Number of Bins to
You can now see that the dose amount has an impact on the tumor size. The higher the dose
is, the smaller the tumor becomes.
You can also query the corresponding dose group from each line by showing its data tip. Press Ctrl and click a blue line to display its data tip. To remove it, Ctrl + Click again anywhere on the same line.
Using the drug pharmacokinetic data, you can estimate NCA parameters. NCA is model agnostic and can give insights into the drug pharmacokinetics without any underlying assumptions. You can use some of the NCA results as initial estimates when calibrating the model to the data, as discussed later in this example. For details on the list of available NCA parameters and their formulas, see Noncompartmental Analysis.
On the Home tab, select Program > Non-Compartmental Analysis. A new program (Program1) appears.
The Data setup step of the program defines the data set to use for the NCA analysis. In this example, the program automatically selects Data1.
execution step defines the data column associations and algorithm
details. In the Definition table, set
CentralConc. Leave the
other settings unchanged.
On the Home tab, click Run.
Once the NCA analysis is complete, the app saves the results in the LastRun folder of the program by default.
On the Home tab, select New Datasheet. A new datasheet (Datasheet2) opens on a new tab.
In the Browser pane, expand the Program1 folder. Then expand LastRun folder. The NCA results are stored in the table named results.
Drag results onto Datasheet2. The calculated NCA parameter values are now shown in the datasheet. Use the scroll bar at the bottom of the table to scroll and view the NCA data columns. For details about calculated NCA parameters, see Noncompartmental Analysis.
You can export the NCA results to the MATLAB® workspace and perform further data analyses at the command line.
Right-click results. Select Export Data to MATLAB Workspace.
The SimBiology Data Export dialog box opens. Change the name of the variable to ncatable. Click OK.
After you export the data to the MATLAB workspace, you can analyze the data at the command-line. For instance, you can calculate the average drug clearance from the NCA data and use it as the model parameter value.
SimBiology provides different regression techniques to estimate model parameters based on
experimental data. This example details the steps for using the nonlinear regression method
lsqnonlin (requires Optimization
Toolbox™) to fit the model to the data. If you do not have Optimization
Toolbox, the app uses
fminsearch instead. For the purposes of the
example, only some of the PK/PD model parameters are estimated, namely: k1,
L0, L1, Cl_Central,
k12, and k21.
From the Home tab, select Program > Fit Data. A new program (Program2) appears on a new tab. The Data and Model steps have been prepopulated with Data1 and Tumor Growth Model, respectively.
By default, the Fit step autogenerates plots after the fitting is complete. Disable the plot generation by clicking the plot icon at the top of the Fit program step for now. The plots will be explored later in the example.
Define the mapping between the model components and the data columns from the experimental data. Specifically, map CentralConc to the model species Drug in the central compartment (Central.Drug). Similarly, map PeripheralConc to Peripheral.Drug.
Map TumorWeight to [Tumor Growth Model].tumor_weight.
Map the Dose column to Central.Drug to indicate that the Drug species in the Central compartment is being dosed.
Define the model parameters to estimate in the Estimated
Parameters table. Double-click the empty cell in the Estimated
Parameters column and type k1. The app shows model components
with matching names. Select
k1 from the list.
By default, the parameter is log-transformed as indicated by the expression
exp(k1). You can change the expression to no transformation,
logit transformation. For this example,
keep the default log transform because it often improves the convergence. The
Initial Untransformed Value is automatically set to the model value
which is 0.5.
Enforce the biological parameters to stay positive by specifying the
Untransformed Lower Bound and Untransformed Upper
Similarly, add the following parameters: Cl_Central, L0, L1, k12, and k21.
Select Pooled fit to estimate one set of parameters for all patients (population fit). If you do not select Pooled fit, the app estimates one set of parameters for each patient (individual fit).
The default error model is the constant error model. SimBiology supports constant, proportional, exponential, and combined error models. For details, see Error Models. For now, use the constant error model.
Keep the rest of the fitting settings unchanged. These settings are
Estimation Method — The default method is
lsqnonlin if you have
Toolbox. If you do not, the app uses
For more information, see Supported Methods for Parameter Estimation.
Algorithm Settings — Most common options for the estimation method. Click to expand the section and see the options. To see the description of each option, click the info icon to the right of the header.
Advanced Algorithm Settings — Advanced settings for the estimation method. The table is empty by default.
After you set the fitting options, you can run the Fit step.
At the top of the Fit step, click the Run this program step button.
By default, the Fit step shows the progress of parameter estimation in a separate figure. The progress plot shows the live status of parameter estimation and fitting quality measures such as log likelihood. For details, see Progress Plot.
The progress plot shows that the fit converged. You can close the progress plot.
If you are using
fminsearch, the fit can fail to converge due to
reaching the maximum number of iterations. You can increase MaxIter in
the Algorithm Settings, but for the purposes of this example, you can
continue completing the steps without doing so.
Once the parameter estimation is complete, the fit results are stored in the LastRun folder of the program.
On the Home tab, select New Datasheet. A new datasheet opens in a new tab.
In the Browser pane, expand the Program2 folder. Then expand LastRun folder, which contains results and simdataI. results contains estimated parameter values and fit statistics. simdataI contains the simulated model responses for each individual (patient or group) using the estimated parameter values.
Drag results onto the new datasheet.
The Statistics table contains fit quality measures such as AIC, BIC, and log likelihood. These measures can be useful, for example, to compare the performance of different error models.
In addition to quality statistics, you can also view various fit plots, such as actual versus predicted plots and residual distribution plots. First, select results in the Browser pane. Available fit plots are automatically listed in the Plot section on the Home tab. Then select Act vs Pred from the list.
The actual versus predicted plot appears on a separate tab. The predicted responses are plotted on the x-axis and the observed (experimental) responses are plotted on the y-axis.
You can change the plot to other supported plots by selecting one of the plots from the Style section in the Property Editor. If you want the new plot on its own separate tab and you do not want to reuse the existing plot tab, select the plot from the Plot section on the Home tab.
Change the plot to a residual distribution plot by selecting Res Dist in the Style section.
The plot shows whether the residuals for each response are normally distributed. In an ideal normal probability plot of residuals, the residuals line up along the diagonal line across the plot and the histograms indicate a normal fit. However, from the plot, the residuals for all three responses, especially CentralConc and PeripheralConc, do not seem to be normally distributed. It could be an indication that the constant error model assumption is incorrect.
The following steps show how to change the error model to an exponential error model to fit the data again and compare the fit statistics of two different error models.
Save Fit Results. Before fitting the data again using the exponential error model, save the constant error model result in a separate folder. Otherwise, the program, by default, overwrites results from the LastRun folder every time you run the fit.
Right-click the LastRun folder of the fit program in the Browser pane.
In the Save Data dialog, enter
fit_constant as the data name.
Rerun Fit With Exponential Error Model. After you save the data, you can rerun the fit program with a different error model.
Return to the fit program by clicking the Program2 tab. In the Error Model section, select exponential.
At the top of the Fit step, click the Run this program step button.
Close the progress plot after the fit completes.
If you closed the datasheet (Datasheet3) that contains the fit statistics from the previous fit, reopen the datasheet. In the Browser pane, click Documents. Then double-click Datasheet3.
Click Workspace to go back to the fit program results. Expand LastRun folder of the fit program. Then drag results onto Datasheet3. New columns (Program2_LastRun) containing the latest fit results are added next to the previous fit results (Program2_fit_constant).
The Statistics table compares the fit quality measures. From the comparison, both the AIC and BIC of the fit using the exponential error model are smaller than those of the previous fit. This indicates that the exponential error model fits the data better than the constant error model. The larger log likelihood of the exponential error model also indicates it is a better fit.
Next, look at the residual distribution plot. Click results from the LastRun folder. Then click Residual Dist from the Plot section on the Home tab.
Compared to the residual distributions of the constant error model, the residual distributions from the exponential error model look more normal, indicating that the exponential error model indeed fits the data better.
Another way to assess the quality of fit results is to compute 95% confidence intervals for the estimated parameters and model predictions — that is, model simulation results using the estimated parameters. This step requires Statistics and Machine Learning Toolbox™.
Return to the fit program. Click the (+) icon at the upper left and select
Confidence Interval. A Confidence Interval
step appears following the Fit step.
At the top of the Confidence Interval step, disable the
autogeneration of plots by clicking the plot icon. For both Parameter Confidence
Intervals and Prediction Confidence Intervals, use the
confidence level. Click the Run this program step button to compute
Once completed, the results are stored as parameterCI and predictionCI in the LastRun folder of the program. parameterCI contains 95% confidence intervals for the estimated parameters. predictionCI contains 95% confidence intervals for the model predictions.
Plot 95% confidence intervals for the estimated parameters. Click parameterCI in the Browser pane and select Confidence in the Plot section.
The confidence interval for each estimated parameter is shown in a new plot. The plot indicates the successful computation of the confidence intervals for all estimated parameters.
Depending on the outcome (status) of the confidence interval estimation, the app plots the results differently.
If the status of confidence interval estimation is a success (as in the above plot), the app uses the first default color (blue) to plot a line and a centered dot for every parameter estimate. The app also plots a box to indicate the confidence intervals.
If the status is constrained or estimable, the app uses the second default color (red) and plots a line, centered dot, and box to indicate the confidence intervals.
If the status is not estimable, the app plots only a line and a centered cross in red.
If there are any transformed parameters with estimated values that are 0 (for the
log transform) and 0 or 1 (for the
logit transform), no confidence intervals are plotted for those
For more details on the definitions of different statuses, see Parameter Confidence Interval Estimation Status.
You can also change the Layout of the plot in Plot Settings.
'split' layout displays the confidence interval for each
parameter estimate on a separate axis.
'grouped' layout displays all confidence intervals on one
axis, grouped by parameter estimates. Each estimated parameter is separated by a vertical
In both cases, the parameter bounds defined in the original fit are marked by square brackets. The app uses vertical dotted lines to group confidence intervals of parameter estimates that have been computed in a common fit.
Similarly, plot 95% confidence intervals for the model predictions. Click predictionCI in the Browser pane and select Confidence in the Plot section.
In this plot, the confidence interval for each group is plotted in a separate column, and each response is plotted in a separate row. The plot indicates the successful computation of the confidence intervals.
The plotting behavior differs depending on the outcome (status) of the confidence interval calculation.
If the status is constrained or not estimable, the app uses the second default color (red) to plot the confidence intervals.
Otherwise, the app uses the first default color (blue) and plots the confidence intervals as shaded areas (as in the above plot).
Once the parameter estimation is complete, you can plot the simulation results on top of the experimental data. There are generally two ways to get the plot.
The first approach is to use the default Fit plot that shows the fitted results over experimental data for each group.
Click results from the LastRun folder of the fit program.
Select Fit in the Plot section on the Home tab.
The second approach is more customized and involved, but you have more control over how the plot looks like. The following steps show how to plot the tumor growth profiles of all groups on the same axes but use different line styles for experimental data and simulation data.
Click simdataI in the LastRun folder of the fit program.
Click time from the Plot section on the Home tab.
Drag Data1 (experimental data) on to the plot.
In the Property Editor of the plot, multiselect (Ctrl + Click) the first three rows (simulation data) of the Responses table and click Create Set.
In the Slice table, use no style for Scenarios by selecting empty.
Clear the first two rows from each set. Keep only the tumor growth data from each set.
Line Style for Sets and
Color for Response. Also set the
Marker of the simulation data (Program2) to
none. Set the Style of the experimental
data (Data1) to
o as the
After fitting to data, you can set the model values to the parameter estimates and perform other analyses. For instance, you can find out important model parameters using sensitivity analysis and vary the sensitive parameters to investigate model variability by using virtual patients.
 Simeoni, M., P. Magni, C. Cammia, G. De Nicolao, V. Croci, E. Pesenti, M. Germani, I. Poggesi, and M. Rocchetti. 2004. Predictive pharmacokinetic-pharmacodynamic modeling of tumor growth kinetics in xenograft models after administration of anticancer agents. Cancer Research. 64:1094-1101.