Main Content

Sensitivity analysis lets you explore the effects of variations in model
quantities (species, compartments, and parameters) on a model response. You can use
the analysis to validate preexisting knowledge or assumption about influential model
quantities on a model response or to find such quantities. You can use the
information from sensitivity analysis for decision making, designing experiments,
and parameter estimation. SimBiology^{®} supports two types of sensitivity analyses: local sensitivity analysis
and global sensitivity analysis.

Global sensitivity analysis uses Monte Carlo simulations, where a representative
(*global*) set of parameter sample values are used to explore
the effects of variations in model parameters of interest on the model response. GSA
provides insights into relative contributions of individual parameters that
contribute most to the overall model behavior.

On the other hand, local sensitivity analysis is derivative based. This technique analyzes the effect of one model parameter at a time, keeping the other parameters fixed. Local sensitivities are dependent on a specific choice of parameter values at a time point where the analysis is performed and do not capture how parameters interact with each other during simulation when they are varied jointly.

In GSA, model quantities are varied together to simultaneously evaluate the relative contributions of each quantity with respect to a model response. SimBiology provides two ways to perform GSA.

In this approach, SimBiology performs a decomposition of the model output (response) variance by calculating the first- and total-order Sobol indices [1]. The first-order Sobol indices give the fractions of the overall response variance that can be attributed to variations in an input parameter alone. The total-order Sobol index gives the fraction of the overall response variance that can be attributed to joint parameter variations. For details, see Saltelli Method to Compute Sobol Indices.

Use `sbiosobol`

to compute the Sobol indices. The function requires
Statistics and Machine Learning Toolbox™.

MPGSA lets you study the relative importance of parameters with respect to a classifier defined by model responses. SimBiology implements the MPSA method proposed by Tiemann et. al. [2]. For details, see Multiparametric Global Sensitivity Analysis (MPGSA).

Use `sbiompgsa`

to perform MPGSA. The function requires Statistics and Machine Learning Toolbox.

In this analysis, SimBiology calculates the time-dependent sensitivities of all the species states with respect to species initial conditions and parameter values in the model.

Thus, if a model has a species `x`

, and two parameters
`y`

and `z`

, the time-dependent sensitivities
of `x`

with respect to each parameter value are the time-dependent derivatives

$$\frac{\partial x}{\partial y},\frac{\partial x}{\partial z}$$

where, the numerator is the sensitivity output and the denominators are the sensitivity inputs to sensitivity analysis. For more information on the calculations performed, see [3][4][5].

LSA is supported only by the ordinary differential equation (ODE) solvers.
SimBiology calculates local sensitivities by combining the original ODE system
for a model with the auxiliary differential equations for the sensitivities. The
additional equations are derivatives of the original equations with respect to
parameters. This method is sometimes called *forward sensitivity
analysis* or *direct sensitivity analysis*.
This larger system of ODEs is solved simultaneously by the solver.

SimBiology sensitivity analysis calculates derivatives by using a technique
called complex-step approximation. This technique yields accurate results for
the vast majority of typical reaction kinetics, which involve only simple
mathematical operations and functions. However, this technique can produce
inaccurate results when analyzing models that contain mathematical expressions
that involve nonanalytic functions, such as `abs`

. In this case, SimBiology
either disables the sensitivity analysis or warns you that the computed
sensitivities may be inaccurate. If sensitivity analysis gives questionable
results for a model with reaction rates that contain unusual functions, you may
be running into limitations of the complex-step technique. Contact MathWorks Technical Support for additional information.

**Note**

Models containing the following active components do not support sensitivity analysis:

Nonconstant compartments

Algebraic rules

Events

**Note**

You can perform sensitivity analysis on a model containing repeated assignment rules, but only if the repeated assignment rules do not determine species or parameters used as inputs or outputs in sensitivity analysis.

SimBiology always uses the SUNDIALS solver to perform
sensitivity analysis on a model, regardless of what you have selected as the `SolverType`

in the configuration set.

In addition, if you are estimating model parameters using
`sbiofit`

or the Fit Data program with one of these gradient-based estimation
functions: `fmincon`

, `fminunc`

,
`lsqnonlin`

, or `lsqcurvefit`

, SimBiology uses the
SUNDIALS solver by default to calculate sensitivities and use them to improve fitting. If you
are using `sbiofit`

, you can turn off this sensitivity
calculation feature by setting the 'SensitivityAnalysis' name-value pair argument to
`false`

. However, if you are using the Fit Data program, you cannot turn
off this feature. It is recommended that you keep the sensitivity analysis feature on whenever
possible for more accurate gradient approximations and better parameter fits.

Set the following properties of the `SolverOptions`

property of your
`configset`

object, before running the
`sbiosimulate`

function:

`SensitivityAnalysis`

— Set to`true`

to calculate the time-dependent sensitivities of all the species states defined by the`Outputs`

property with respect to the initial conditions of the species and the values of the parameters specified in`Inputs`

.`SensitivityAnalysisOptions`

— An object that holds the sensitivity analysis options in the configuration set object. Properties of`SensitivityAnalysisOptions`

are:`Outputs`

— Specify the species and parameters for which you want to compute the sensitivities. This is the numerator as described in Sensitivity Analysis.`Inputs`

— Specify the species and parameters with respect to which you want to compute the sensitivities. Sensitivities are calculated with respect to the`InitialAmount`

property of the specified species. This is the denominator, described in Sensitivity Analysis.`Normalization`

— Specify the normalization for the calculated sensitivities:`'None'`

— No normalization`'Half'`

— Normalization relative to the numerator (species output) only`'Full'`

— Full dedimensionalization

For more information about normalization, see

`Normalization`

.

After setting `SolverOptions`

properties, calculate the
sensitivities of a model by providing the `model object`

as an
input argument to the `sbiosimulate`

function.

The `sbiosimulate`

function returns a `SimData object`

containing the
following simulation data:

Time points, state data, state names, and sensitivity data

Metadata such as the types and names for the logged states, the configuration set used during simulation, and the date of the simulation

A `SimData object`

is a convenient way of keeping time data,
state data, sensitivity data, and associated metadata together. A
`SimData object`

has properties and methods associated with
it, which you can use to access and manipulate the data.

For illustrated examples, see:

Create a `SimFunctionSensitivity object`

using the `createSimFunction`

specifying
the `'SensitivityOutputs'`

and
`'SensitivityInputs'`

name-value pair arguments. Then
execute the object. For an illustrated example, see Calculate Sensitivities Using SimFunctionSensitivity Object.

For a workflow example using the app, see Find Important Parameters with Sensitivity Analysis Using SimBiology Model Analyzer App.

[1] Saltelli, Andrea, Paola Annoni, Ivano Azzini, Francesca Campolongo, Marco Ratto, and Stefano Tarantola. “Variance Based Sensitivity Analysis of Model Output. Design and Estimator for the Total Sensitivity Index.” *Computer Physics Communications* 181, no. 2 (February 2010): 259–70. https://doi.org/10.1016/j.cpc.2009.09.018.

[2] Tiemann, Christian A., Joep Vanlier, Maaike H. Oosterveer, Albert K. Groen, Peter A. J. Hilbers, and Natal A. W. van Riel. “Parameter Trajectory Analysis to Identify Treatment Effects of Pharmacological Interventions.” Edited by Scott Markel. *PLoS Computational Biology* 9, no. 8 (August 1, 2013): e1003166. https://doi.org/10.1371/journal.pcbi.1003166.

[3] Martins, Joaquim,
Ilan Kroo, and Juan Alonso. “An Automated Method for Sensitivity Analysis Using
Complex Variables.” In *38th Aerospace Sciences Meeting
and Exhibit*. Reno,NV,U.S.A.: American Institute of Aeronautics
and Astronautics, 2000.
https://doi.org/10.2514/6.2000-689.

[4] Martins, J., Peter
Sturdza, and Juan Alonso. “The Connection between the Complex-Step Derivative
Approximation and Algorithmic Differentiation.” In *39th
Aerospace Sciences Meeting and Exhibit*. Reno,NV,U.S.A.: American
Institute of Aeronautics and Astronautics, 2001.
https://doi.org/10.2514/6.2001-921.

[5] Ingalls, Brian P.,
and Herbert M. Sauro. “Sensitivity Analysis of Stoichiometric Networks: An
Extension of Metabolic Control Analysis to Non-Steady State Trajectories.”
*Journal of Theoretical Biology* 222, no. 1
(May 2003): 23–36.
https://doi.org/10.1016/S0022-5193(03)00011-0.