• No results found

Modelling biological systems

3.4 Sensitivity analysis

Techniques for sensitivity analysis can be thought of as either local or global. Local techniques usually involve calculating derivatives at a given point in parameter space.

Global techniques aim to evalue the effects of a parameter over the whole of parameter space, i.e. all parameters are varied simultaneously within their given ranges. This is important when the model is non-linear and involves significant interactions between parameters, which is usually the case for large complex models such as the ones used in this work. The difficulty with global methods, is that they require a large number of model evaluations, and are therefore computationally expensive compared with local methods. Techniques have been developed which aim to estimate global effects with a minimal number of function evaluations. One of these techniques is explained below.

Morris’ method

The method of Morris [206] is a widely used method in situations where there are a large number of parameters and the cost of model evaluation is high. It is a simple method, but effective as a tool for screening parameters. For a function of k parameters f(p), p= (p1, p2, . . . , pk) (3.14) a maximum (pi,max) and minimum (pi,min) are defined for each parameter. The parameter space is divided into a grid such that each parameter can take n possible values given by

pi,min+ mpi,max− pi,min

n −1 (3.15)

where m is an integer between 0 and n − 1. The jump∆ is defined as an integer number of steps on the parameter grid i.e.

i = mpi,max− pi,min

n −1 (3.16)

where mis a fixed integer between 0 and n − 1. An elementary effect is defined as di(p)= f(p1, . . . , pi+ ∆i, . . . , pk) − f (p)

i (3.17)

i.e. it is the overall gradient of f between pi and pi + ∆i with all the other parameters held constant. There are a total of n(k−1)(n − m) elementary effects. If n is chosen to be even, and mto be n/2 (as they are in the implementations in this thesis) the number of elementary effects becomes nk/2.

The Morris method consists of sampling from these elementary effects, and calculating the sample mean µ (or more commonly the mean of the absolutes µ?) and the standard deviation σ for each parameter. To implement the method, a base point p0 is chosen at random. From these base points, a sequence of k+ 1 values of p are generated by incrementing each parameter pi by ±∆i in turn. For the case of m = n/2 the step ∆i

can only be taken in one direction from each point whilst still remaining in the allowed parameter range. Since each value of p differs from the previous value in only one parameter, the method is known as the Morris one at a time (OAT) method. The k+ 1 values of p define a trajectory in parameter space with k steps of length∆. The value of the function at these points is used to calculate the elementary effects. Each point (except the first and last) is involved in the calculation of two elementary effects. This + 1) function evaluations. Although the

effect from each of the r trajectories, and is therefore made up of independent points.

The calculated values µ, µ?and σ can be used to assess the importance of the parame-ters on the output. The mean of the absolutes µ?is used to allow for parameters which have non-linear effects, or strong interactions with other parameters. To make it easier to compare these values, the parameters are scaled to lie between 0 and 1 before cal-culating the elementary effects. Parameters with a large µ? can be considered to have an important effect on the output, whilst those with a small µ? are unimportant. The standard deviation σ can be used to distinguish between parameters which have a linear independent effect (small σ) and those which have a non-linear effect or interact with other parameters (large σ). The main limitation of this method is that it only gives qualitative results.

Other methods

Techniques for quantitative global sensitivity analysis are usually based on the variance of the model output. These requires a greater number of model evaluations. However, there are methods (for example the Sobol’ method [207]) which can estimate quantita-tive sensitivity indices with fewer computations. These methods generally require that the input parameters are independent, and that the function is solvable over the whole of the parameter space defined by the inner product of the individual parameter intervals.

This is not the case in the BrainPiglet model; at many points in this space, the model fails to give a solution. For the Morris method, undefined results are simply excluded from the calculations of µ?and σ.

Implementation

Sensitivity analyses were carried out using the R sensitivity package [208]. Firstly, the R functions are used to generate the complete list of parameter values for which simulations should be run. These values are saved in a simple database. Multiple simulations are then run in parallel, until all the simulations are completed. Around 200 000 simulations are run for each of the sensitivity analyses in this work. The results of each simulation are saved to an HDF5 file, which can be used by the R algorithm to calculate the relevant sensitivity indices.

3.5 Summary

The BRAINCIRC modelling environment has been used to implement the model. This software was developed to simulate biological systems and it was previously used to develop the BrainSignals model. BRAINCIRC allows a model to be specified in an easy to read text format, and can simulate systems of DAEs. A new SBML exporter has been developed, which can be used to export the BrainPiglet model. This allowed the libSBML library to be used to check the consistency of the units.

Several improvements have been made to the BRAINCIRC environment to increase the speed of simulations, and extensions have been added using the Python programming language to perform parameter optimisation and sensitivity analysis. The SciPy Pow-ell’s method and the PSwarm method were used for parameter optimisations to attempt to minimise the mean square error or root mean square error between measured and (po-tentially scaled and/or offset) modelled data. Sensitivity analyses to determine the most influential parameters were carried out using the Morris method, implemented with the R sensitivity package.

Chapter 4