This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Pharmacokinetic Modeling Functionality


SimBiology® software extends the MATLAB® computing environment for analyzing pharmacokinetic (PK) data using models. The software lets you do the following:

  • Create models — Use a model construction wizard. Alternatively, extend any model with pharmacodynamic (PD) model components, or build higher fidelity models. See Model for more information.

  • Fit data — Fit nonlinear, mixed-effects models to data, and estimate the fixed and random effects, or fit the data using nonlinear least squares. For more information, see Analyze Data Using Models.

  • Generate diagnostic plots — For more information, see Analyze Data Using Models.

The software lets you work with different model structures, thus letting you try multiple models to see which one produces the best results.

Required and Recommended Software for Pharmacokinetic Modeling

Required Software


Provides a command-line interface and an integrated software environment. For instructions, see the MATLAB installation documentation for your platform.

If you have installed MATLAB and want to check which other MathWorks® products are installed, enter ver in the MATLAB Command Window.

Statistics and Machine Learning Toolbox™ (Version 7.3 (R2010a) or greater)

Provides fitting tools including functions used to analyze nonlinear mixed effects.

Recommended Software

C CompilerRequired to prepare the model for accelerating simulations. For list of supported compilers, see Supported and Compatible Compilers.

Optimization Toolbox™

Optimization Toolbox extends the MATLAB technical computing environment with tools and widely used algorithms for standard and large-scale optimization. These algorithms solve constrained and unconstrained, continuous and discrete problems. If the Optimization Toolbox product is installed, you can specify additional methods for likelihood maximization. If you do not have this product, SimBiology uses fminsearch provided by MATLAB for likelihood maximization.

How SimBiology Supports Pharmacokinetic Modeling

Import and Work with Data

You can import tabular data into the SimBiology desktop or the MATLAB Workspace. The supported file types are .xls, .csv, and .txt. You can specify that the data is in a NONMEM® formatted file. The import process interprets the columns according to the NONMEM definitions.

From the SimBiology desktop, you can filter the raw data to suppress outliers, visualize data using common plots (such as plot, semilog, scatter, or stairs), and perform basic statistical analysis. You also can use functions to process and visualize the data at the command line.


SimBiology provides an extensible modeling environment. You can do any of the following:

  • Create a PK model using a model construction wizard to specify the number of compartments, the route of administration, and the type of elimination.

  • Extend any model with pharmacodynamic (PD) model components, or build higher fidelity models.

  • Build or load your own SimBiology, or SBML model.

For more information on building SimBiology models, see What is a Model?.

Analyze Data Using Models

Perform both individual and population fits to grouped longitudinal data:

  • Individual fit — Fit data using nonlinear least-squares method, specify parameter transformations, estimate parameters, and calculate residuals and the estimated coefficient covariance matrix.

  • Population fit — Fit data, specify parameter transformations, and estimate the fixed effects and the random sources of variation on parameters using nonlinear mixed-effects models.

    You can use the following methods to estimate the fixed effects:

    • LME — Linear mixed-effects approximation

    • RELME — Restricted LME approximation

    • FO — First-order estimate

    • FOCE — First-order conditional estimate

    For more information about each of these methods, see nlmefit.

  • Population fit using a stochastic algorithm — Fit data, specify parameter transformations, and estimate the fixed effects and the random sources of variation on parameters, using the Stochastic Approximation Expectation-Maximization (SAEM) algorithm. SAEM is more robust with respect to starting values. This functionality relaxes assumption of constant error variance.

    For more information, see nlmefitsa.

In addition, you can generate diagnostic plots that show:

  • The predicted time courses and observations for an individual or the population

  • Observed versus predicted values

  • Residuals versus time, group, or predictions

  • Distribution of the residuals

  • A box-plot for random effects or parameter estimates from individual fitting

Using the Command Line Versus the SimBiology Desktop

SimBiology extends MATLAB and lets you access pharmacokinetic modeling functionality at the command line and in the graphical SimBiology desktop.

Use the command line to write and save scripts for batch processing and to automate your workflow.

Use the SimBiology desktop to interactively change and iterate through the model workflow. The SimBiology desktop lets you encapsulate models, data, tasks, task settings, and diagnostic plots into one convenient package, namely a SimBiology project.

Furthermore, if you are using the SimBiology desktop and want to learn about using the command line, the MATLAB code capture feature in the desktop lets you see the commands and export files for further scripting in the MATLAB editor.

Pharmacokinetic Modeling Example

For an example showing pharmacokinetic modeling functionality at the command line, see Modeling the Population Pharmacokinetics of Phenobarbital in Neonates.

Acknowledgements: Tobramycin Data Set

Acknowledgements for data in the tobramycin.txt file are located in the /matlab/toolbox/simbio/simbiodemos folder. Data set is provided by Dr. Leon Aarons (

The data in the tobramycin.txt file were downloaded from the Web site of the Resource Facility for Population Kinetics (no longer active). Funding source: NIH/NIBIB grant P41-EB01975.

The original data set was modified as follows:

  • Header comments were removed.

  • The file was converted to a tab-delimited format.

  • Missing values in the HT column were denoted with "." instead of 100000000.000.


[1] Original Publication: Aarons L, Vozeh S, Wenk M, Weiss P, and Follath F. "Population pharmacokinetics of tobramycin." Br J Clin Pharmacol. 1989 Sep;28(3):305–14.

Was this topic helpful?