SimBiology^{®} lets you perform individual and population fitting on grouped data. This functionality uses Statistics and Machine Learning Toolbox™ features (Version 7.3 or later).
Individual fit — Fit data separately for each individual using the nonlinear least squares method, estimate parameters, and calculate residuals and the estimated coefficient covariance matrix.
Population fit — Estimate the fixed effects and the random sources of variation on parameters, using nonlinear mixedeffects models.
You can use the following methods to estimate the fixed effects:
LME
— Linear mixedeffects
approximation
RELME
— Restricted LME approximation
FO
— Firstorder estimate
FOCE
— Firstorder conditional
estimate
The following results are returned for population fitting:
The maximized loglikelihood for the fitted model
The estimated error variance for the fitted model
The Akaike information criterion for the fitted model
The Bayesian information criterion for the fitted model
The standard errors for the estimates of the fixed effects
The error degrees of freedom for the model
The weighted residuals for the fitted model
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
Weighted residuals versus time, group, or predictions
Distribution of the weighted residuals
A boxplot for random effects or parameter estimates from individual fitting
Before you fit parameters, the SimBiology desktop or the MATLAB^{®} Workspace must contain the following:
Data to use in the fitting (See Importing Data — Supported Files and Data Types for more information.)
A model to fit (See Create Pharmacokinetic Models for more information.)
If you plan to use the command line, see the following for more information:
Perform Data Fitting with PKPD Models 
If you created a PK model using either the PKModelDesign
object's construct
method
at the command line or the wizard in the SimBiology desktop,
you can skip this section. This section provides information about
working with a custom SimBiology model.
When using a custom model, you must provide information about
whether dosing is applicable and define which components of the SimBiology model
represent the observed response, the dose, and the estimated parameters.
Use the PKModelMap
object to define these settings
as shown in Defining Model Components for Observed Response, Dose, Dosing
Type, and Estimated Parameters.
The PKModelMap
object holds information about
the dosing type and defines which components of the SimBiology model
represent the observed response, the dose, and the parameters to be
estimated.
If you are using a custom SimBiology model that you did
not create using either the PKModelDesign
object's construct
method
or the wizard, you must create a PKModelMap
object
to define these relationships.
Consider the following regression function, y = f(k,u)
,
where y
is the measured or observed response, given
values of an input u
, and parameter values k
.
In SimBiology, the model represents f
, which
is used to generate the regression function, if y
, k
,
and u
are identified in the model. You must, therefore,
use the PKModelMap
object to define which components
of the model represent y
, k
,
and u
. If applicable, the PKModelMap
object
also needs information on the type of dosing or input being given
to the model.
Import an SBML model:
modelObj = sbmlimport('lotka');
Create a PKModelMap
object:
PKModelMapObj = PKModelMap;
Use the name of the model component to specify the
corresponding property in the PKModelMap
object.
Model Component Represents  PKModelMap Object Property 

Object being driven by an input  Dosed 
Measured response  Observed 
Parameters to be estimated  Estimated 
For example:
set(PKModelMapObj, 'Observed', 'unnamed.y1'); set(PKModelMapObj, 'Estimated', {'Reaction1.c1', 'Reaction2.c2'});
Note:
When specifying species names, qualify the name with the compartment
name in the form 
Use the DosingType
property to
specify the type of dosing, if applicable. The allowed types are ''
, 'Bolus'
, 'Infusion'
, 'FirstOrder'
,
and 'ZeroOrder'
.
For example:
set(PKModelMapObj, 'DosingType', 'Bolus');
Note:
When using custom models with 
The previous example sets the observed response to a species y1
,
contained by a compartment (unnamed
), and sets
the parameters to be estimated to the parameters c1
and c2
that
are scoped to the reactions, Reaction1
and Reaction2
,
respectively.
For information on ...  See ... 

PKModelMap object properties and allowed
values 

Allowed dosing types  Dosing Types 
Parameter scoping  When Reactions, Rules, and Events Specify Parameters 
Parameter fitting  Perform Data Fitting with PKPD Models 
Use the name of the model component to specify the Dosed
property
in the PKModelMap
object.
For example, assume that a model contains two compartments named Central
and Peripheral
.
Specify the species names in the dosed compartments. For example:
set(PKModelMapObj, 'Dosed, {'Central.Drug_Central', ... 'Peripheral.Drug_Peripheral'});
Use the DosingType
property to
specify the type of dosing if applicable. The allowed types are ''
, 'Bolus'
, 'Infusion'
, 'FirstOrder
',
and 'ZeroOrder'
. When specifying dosing for multiple
compartments, the order in the Dosed
property is
the order in which the dosing type is applied.
For example, if Central
takes zeroorder
dosing and Peripheral
takes a firstorder dosing
enter:
set(PKModelMapObj, 'DosingType', {'ZeroOrder', 'FirstOrder'});
Because the model includes zeroorder
as
a DosingType
, you must include a parameter that
represents the duration of drug absorption and is used when simulating
the model with dosing information or during fitting. Set the ZeroOrderDurationParameter
property
of the PKModelMap
object to the name of the duration
parameter. For example,
set(PKModelMapObj, 'ZeroOrderDurationParameter', {'Kdo', ''})
Specify the parameters in the same order as the species in the Dosed
property.