sensitivityanalysis forrisk-relateddecision-making...sensitivityanalysis:intuition...

39
Sensitivity analysis for risk-related decision-making Eric Marsden <[email protected]> What are the key drivers of my modelling results?

Upload: others

Post on 22-May-2020

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysisfor risk-related decision-making

Eric Marsden

<[email protected]>

What are the key drivers of my modelling results?

Page 2: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

X is a sensitiveparameter

Degree of sensitivity of X = Ī”Y/Ī”X

X is not a sensitiveparameter

2 / 32

Page 3: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

āˆ’2 āˆ’1 0 1 2 āˆ’2

0

20

5

š‘„š‘¦

š‘“ (š‘„, š‘¦) is sensitive in š‘„ and inš‘¦

3 / 32

Page 4: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

āˆ’2 āˆ’1 0 1 2 āˆ’2

0

20

2

4

š‘„š‘¦

š‘“ (š‘„, š‘¦) is sensitive in š‘„ butnot in š‘¦

4 / 32

Page 5: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

ā–· Consider a case where š‘Œ = š‘“ (š‘„) and thefunction š‘“ is a ā€œblack boxā€

ā–· We can sample š‘Œ for different values of š‘‹ toreassemble the relationship

ā–· Here: š‘‹ is a sensitive parameter

5 / 32

Page 6: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

ā–· Here, š‘‹ is not sensitive

ā–· Can be ā€œseenā€ visually

X

Y

6 / 32

Page 7: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: intuition

ā–· What can we say about the sensitivity of š‘‹?

ā–· No graphical interpretation

ā–· Consider also functions (or computer models,or spreadsheets) which have tens of inputs

ā€¢ you canā€™t draw graphs in dimension 23!

ā–· We need a more sophisticated method thanscatterplotsā€¦

7 / 32

Page 8: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

What is sensitivity analysis?

ā–· The study of how the variation (uncertainty) in the output of amathematical model can be apportioned, qualitatively or quantitatively, todifferent sources of variation in the model inputs

ā–· Answers the question ā€œWhat makes a difference in this decision problem?ā€

ā–· Can be used to determine whether further research is needed to reduceinput uncertainty before making a decisionā€¢ information is not free

8 / 32

Page 9: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

Start with a simulation model thatyou want better to understand (oftena computer model). It may be a ā€œblackboxā€ (you donā€™t know how it worksinternally).

parameter 1

parameter 2

parameter 3

outputs

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 10: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

Start with a simulation model thatyou want better to understand (oftena computer model). It may be a ā€œblackboxā€ (you donā€™t know how it worksinternally).

parameter 1

parameter 2

parameter 3

Define which uncertain input parametersyou want to analyze.

Characterize their probabilitydistributions.

outputs

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 11: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

parameter 1

parameter 2

parameter 3

outputs

Propagate the input variability tothe output variability by running themodel a large number of times withinputs taken from the input probabilitydistributions.

(This is a ā€œMonte Carloā€ or ā€œstochasticsimulationā€ method.)

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 12: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

parameter 1

parameter 2

parameter 3

outputs

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 13: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

parameter 1

parameter 2

parameter 3

outputs

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis Sensitivity analysis: what is therelative contribution of the variabilityin each of the inputs to the total outputvariability?

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 14: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity and uncertainty analysis

simulationmodel

f

parameter 1

parameter 2

parameter 3

outputs

uncertainty analysis

Uncertainty analysis: how doesvariability in the inputs propagatethrough the model to variability in theoutputs?

sensitivity analysis

feedback on modelinputs & model structure

Insights gained from the sensitivityanalysis may help to

ā–· prioritize effort on reducing inputuncertainties

ā–· improve the simulation model

Adapted from figure by A. Saltelli

9 / 32

Page 15: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Applications of sensitivity analysis

ā–· Risk communicationā€¢ how much of my output uncertainty is irreducible (caused by aleatory

uncertainty in input parameters)?

ā€¢ how much is epistemic (related to lack of knowledge, could be reduced withmore research)?

ā–· Optimize research investment to improve risk analysisā€¢ which uncertain input parameters contribute the most to model output

uncertainty?

ā€¢ on which uncertain input parameters should I spend my research money togain the biggest reduction in uncertainty?

ā–· Model reductionā€¢ identify ineffective parameters

ā€¢ generate models with fewer parameters, but (almost) identical results(metamodels or response surfaces)

10 / 32

Page 16: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Application areas

The European Commission recommends sensitivityanalysis in the context of its impact assessmentguidelines (2009):

ā€˜ā€˜When the assumptions underlying the baseline scenariomight vary as a result of external factors, you need to doa sensitivity analysis to assess whether the impacts of thepolicy options differ significantly for different values ofthe key variables.

Source: EC guidance document at ec.europa.eu/smart-regulation/impact/

11 / 32

Page 17: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Application areas

Principles for Risk Analysis published by the US Office ofManagement and Budget:

ā€˜ā€˜ Influential risk assessments should characterize uncertainty with asensitivity analysis and, where feasible, through use of a numericdistribution.

[ā€¦] Sensitivity analysis is particularly useful in pinpointing whichassumptions are appropriate candidates for additional datacollection to narrow the degree of uncertainty in the results.Sensitivity analysis is generally considered a minimum, necessarycomponent of a quality risk assessment report.

Source: Updated principles for risk analysis, US OMB, whitehouse.gov/sites/default/files/omb/assets/regulatory_matters_pdf/m07-24.pdf

12 / 32

Page 18: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity analysis: the process

1 Specify the objective of your analysisā€¢ Example: ā€œWhich variables have the most impact on the level of risk?ā€

2 Build a model which is suitable for automated numerical analysisā€¢ Example: spreadsheet with inputs in certain cells and the output of interest in

another cell

ā€¢ Example: computer code that can be run in batch mode

3 Select a sensitivity analysis methodā€¢ most appropriate method will depend on your objectives, the time available for

the analysis, the execution cost of the model

4 Run the analysis

5 Present results to decision-makers

13 / 32

Page 19: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Step 2: build a model which can be run by a computer

A useful starting point is to buildan influence diagram of therelevant variables.

Use this diagram to build yourmodel (e.g. profit = revenue -expenses), or check that allrelevant variables are integratedin your existing numerical model.

It should be possible to run themodel in an automated way(called ā€œbatch modeā€).

Figure from Clemen, R. T., Making Hard Decisions: An Introduction to Decision Analysis, 1996

14 / 32

Page 20: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Aside: extracting a model from a spreadsheet

In some cases, the model you want to analyzewill already be implemented in a spreadsheetsuch as Microsoft Excel.

The free Trace plugin for Excel can extract adependency graphs that depict relationshipsbetween cells in your spreadsheet. This canhelp to build a model that is easy to run inbatch mode.

Trace tool can be downloaded for free from christopherteh.com/trace/

15 / 32

Page 21: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Step 3: sensitivity analysis methods

1 Basic approach: tornado diagram

2 Screening methods

3 oat ā€œone at a timeā€ methods

4 Local sensitivity analysis

5 Global sensitivity analysis

increasingsophistication

more informationavailable

16 / 32

Page 22: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Basic SA: tornado diagram

ā–· Tornado diagram: way of presenting basic sensitivity informationā€¢ mostly used for project risk management or net present value estimates

ā€¢ sometimes called ā€œwhat-ifā€ analysis

Market Size

Our Share

Selling Price

Fixed Costs

Variable Cost

0 100 200 300 400 500 600

the uncertain input parameters

parameter with large impact on the output

parameter with small impact on the output

output value when allinputs at their mean value

range of possibleoutput values

17 / 32

Page 23: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

How to produce a tornado diagram

ā–· Determine lower bound, upper bound and best estimate of each uncertaininput parameterā€¢ = 10%, 90% and 50% quantiles of parameterā€™s probability distribution

ā–· For each uncertain parameter, calculate model output for lower and upperbounds, while taking best estimate for all other uncertain parameters

ā–· Draw a horizontal bar for each uncertain parameter between value forlower bound and value for upper bound

ā–· Vertical order of uncertain parameters given by width of the barā€¢ parameters which lead to large output ā€œspreadā€ (have more impact) at top

ā–· Draw a vertical line at position of the expected valueā€¢ calculated using best estimate for each uncertain parameter

Market Size

Our Share

Selling Price

Fixed Costs

Variable Cost

0 100 200 300 400 500 600

18 / 32

Page 24: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Tornado diagram example: profit calculation

Profit = (SellingPrice - VariableCost) Ɨ MarketSize Ɨ MarketShare - FixedCosts

Parameter Lower Expected Upper

Selling price 140 175 200

Market size 8 12 20

Our share 0.18 0.25 0.35

Variable cost 30 40 60

Fixed costs 150 180 300

Market Size

Our Share

Selling Price

Fixed Costs

Variable Cost

0 100 200 300 400 500 600

Interpretation: given these assumptions, the market size parameter hasmost influence on profitability.

Plot generated with free Excel plugin by home.uchicago.edu/ rmyerson/addins.htm

19 / 32

Page 25: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Relevant commercial tools

Example tools with Excel integration:

ā–· Palisade TopRankĀ®

ā–· Oracle Crystal BallĀ®

Typically quite expensiveā€¦

20 / 32

Page 26: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Screening methods

ā–· ā€œScreeningā€ is a preliminary phase that is useful when the model has alarge number of parametersā€¢ allows the identification, with a limited number of calculations, of those

parameters that generate significant variability in the modelā€™s output

ā–· Simple ā€œoatā€ (one at a time) screening method: change one factor at atime and look at effect on outputā€¢ while keeping other factors at their nominal value

, Intuitive approach, can be undertaken by hand

, If model fails, you know which factor is responsible for the failure

/ Approach does not fully explore input space, since simultaneousvariations of input variables are not studied

/ Cannot detect the presence of interactions between input variables

21 / 32

Page 27: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

OAT screening method: example

Rosenbrock function: š‘“ (š‘„1, š‘„2) = 100(š‘„2 āˆ’ š‘„21)2 + (1 āˆ’ š‘„1)2

over [-2, 2]Ā²

āˆ’2 āˆ’1.5 āˆ’1 āˆ’0.5 0 0.5 1 1.5 2āˆ’2

āˆ’1

0

1

2

1

101

100

š‘„1

š‘„ 2

Both š‘„1 and š‘„2 seem to be sensitive variables in thisexample

> def rosenbrock(x1, x2):return 100*(x2-x1**2)**2 + (1-x1)**2

> rosenbrock(0, 0)1> rosenbrock(1, 0)100> rosenbrock(0, 1)101> rosenbrock(1, 1)0> rosenbrock(-1, -1)404

Real modelling situations

have many more than two

variables, so output cannot

be plotted

22 / 32

Page 28: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

The Elementary Effects screening method

ā–· The elementary effect for the š‘–-th input variable at x āˆˆ [0, 1]š‘˜ is the firstdifference approximation to the derivative of š‘“ (Ā·) at x:

šøšøš‘–(x) = š‘“ (x + āˆ†eš‘–) āˆ’ š‘“ (x)āˆ†

where eš‘– is the unit vector in the direction of the š‘–-th axis

ā–· Intuition: itā€™s the slope of the secant line parallel to the input axis

ā–· Average šøšøš‘–(x) for various points x in the input domain to obtain ameasure of the relative influence of each factor

šœ‡š‘– = 1š‘Ÿ

š‘Ÿāˆ‘š‘—=1

āˆ£šøšøš‘–(š‘„š‘—)āˆ£

23 / 32

Page 29: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Elementary effects method: example

ā–· Consider š‘¦(x) = 1.0 + 1.5š‘„2 + 1.5š‘„3 + 0.6š‘„4 + 1.7š‘„24 + 0.7š‘„5 + 0.8š‘„6 + 0.5(š‘„5š‘„6)

whereā€¢ x = (š‘„1, š‘„2, š‘„3, š‘„4, š‘„5, š‘„6)

ā€¢ 0 ā‰¤ š‘„1, š‘„2, š‘„4, š‘„5, š‘„6 ā‰¤ 1

ā€¢ 0 ā‰¤ š‘„3 ā‰¤ 5

ā–· Note:ā€¢ š‘¦(Ā·) is functionally independent of š‘„1

ā€¢ š‘¦(Ā·) is linear in š‘„2 and š‘„3 and non-linear in š‘„4

ā€¢ š‘¦(Ā·) contains an interaction in š‘„5 and š‘„6

ā–· Sensitivity results:ā€¢ šœ‡1 = 0 as expected

ā€¢ influence of š‘„4 is highest

ā€¢ influence of š‘„2 and š‘„3 is equal, as expected

Download full details as a

Python notebook at

risk-engineering.org

0.0 0.5 1.0 1.5 2.0 2.5 3.0Relative sensitivity

Ī¼_1

Ī¼_2

Ī¼_3

Ī¼_4

Ī¼_5

Ī¼_6

Elementary effects

24 / 32

Page 30: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Local sensitivity analysis methods

ā–· Local sensitivity analysis: investigation of response stability over a smallregion of inputs

ā–· Local sensitivity with respect to a factor is just the partial derivative wrtthat factor, evaluated at that location

ā–· Simple example: Rosenbrock functionā€¢ š‘“ (š‘„1, š‘„2) = 100(š‘„2 āˆ’ š‘„2

1)2 + (1 āˆ’ š‘„1)2, š‘„1, š‘„2 āˆˆ [āˆ’2, 2]

ā€¢ šœ•š‘“šœ•š‘„1

= āˆ’400š‘„1(āˆ’š‘„21 + š‘„2) + 2š‘„1 āˆ’ 2

ā€¢ šœ•š‘“šœ•š‘„2

= āˆ’200š‘„21 + 200š‘„2

25 / 32

Page 31: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Rosenbrock example

š‘“ (š‘„1, š‘„2) = 100(š‘„2 āˆ’ š‘„21)2 + (1 āˆ’ š‘„1)2, š‘„1, š‘„2 āˆˆ [āˆ’2, 2]

āˆ’2āˆ’1

01

2 āˆ’2

āˆ’1

0

1

2

0

2,000

(-1.5,2)

š‘„1

š‘„2

šœ•š‘“šœ•š‘„1

= -155

šœ•š‘“šœ•š‘„2

= -50

Local sensitivity is low

26 / 32

Page 32: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Rosenbrock example

š‘“ (š‘„1, š‘„2) = 100(š‘„2 āˆ’ š‘„21)2 + (1 āˆ’ š‘„1)2, š‘„1, š‘„2 āˆˆ [āˆ’2, 2]

āˆ’2āˆ’1

01

2 āˆ’2

āˆ’1

0

1

2

0

2,000

(-2,-2)

š‘„1

š‘„2

šœ•š‘“šœ•š‘„1

= -4806

šœ•š‘“šœ•š‘„2

= -1200

Local sensitivity is high

26 / 32

Page 33: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Rosenbrock example

š‘“ (š‘„1, š‘„2) = 100(š‘„2 āˆ’ š‘„21)2 + (1 āˆ’ š‘„1)2, š‘„1, š‘„2 āˆˆ [āˆ’2, 2]

āˆ’2āˆ’1

01

2 āˆ’2

āˆ’1

0

1

2

0

2,000(1,1)

š‘„1

š‘„2

šœ•š‘“šœ•š‘„1

= 0

šœ•š‘“šœ•š‘„2

= 0

Local sensitivity is zero

26 / 32

Page 34: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Local sensitivity analysis methods

ā–· The calculation of partial derivatives can be automated for softwarepackages using automatic differentiation methodsā€¢ the source code must be available

ā€¢ ā†’ autodiff.org

ā–· This method does not allow you to detect interaction effects betweenthe input variables

ā–· Method cannot handle correlated inputs

ā–· Widely used for optimization of scientific software

27 / 32

Page 35: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Global sensitivity analysis methods

ā–· Examine effect of changes to all input variables simultaneouslyā€¢ over the entire input space you are interested in (for example the uncertainty

distribution of each variable)

ā–· Methods based on analysis of variance (often using Monte Carlo methods)

ā–· Typical methods that are implemented in software packages:ā€¢ Fourier Analysis Sensitivity Test (fast), based on a multi-dimensional Fourier

transform

ā€¢ the method of Sobolā€™

ā–· In general, this is the most relevant method for risk analysis purposesā€¢ allows the analysis of interactions between input variables

28 / 32

Page 36: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Sensitivity indices

ā–· The sensitivity index of a parameter quantifies its impact on outputuncertaintyā€¢ measures the part of output variance which can be attributed to variability in

the parameter

ā–· Properties:ā€¢ š‘†š‘– āˆˆ [0,1]

ā€¢ āˆ‘š‘– š‘†š‘– = 1

ā–· First-order index: š‘†š‘— = Var(š”¼[š‘§|š‘„š‘—])Var(š‘§)

ā€¢ measures ā€œmain effectā€

ā–· Total effect index: š‘‡š‘— = š”¼[Var(š‘§|š‘„š‘—)]Var(š‘§)

ā€¢ measures residual variability due to interactions between š‘„š‘– and otherparameters

29 / 32

Page 37: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Estimating sensitivity indices using SciPy and SALib

import numpyfrom SALib.sample import saltellifrom SALib.analyze import sobol

def rosenbrock(x1, x2):return 100 * (x2 - x1**2)**2 + (1 - x1)**2

problem = {"num_vars": 2,"names": ["x1", "x2"],"bounds": [[-2, 2], [-2, 2]]

}sample = saltelli.sample(problem, N, calc_second_order=True)Y = numpy.empty([sample.shape[0]])for i in range(len(Y)):

x = sample[i]Y[i] = rosenbrock(x[0], x[1])

Si = sobol.analyze(problem, Y, calc_second_order=True)

Download full details as a

Python notebook at

risk-engineering.org

The SALib python library is free software available from github.com/SALib/SALib

30 / 32

Page 38: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Further

reading

ā–· Appendix on sensitivity analysis of the epa guidance on risk assessment,epa.gov/oswer/riskassessment/rags3adt/pdf/appendixa.pdf

ā–· OpenTURNS software platform for uncertainty analysis (free software),openturns.org

ā–· Dakota software platform for uncertainty analysis (free software),dakota.sandia.gov

ā–· Case study: Using @RISK for a Drug Development Decision: a ClassroomExample, from palisade.com/cases/ISU_Pharma.asp

For more free content on risk engineering,visit risk-engineering.org

31 / 32

Page 39: Sensitivityanalysis forrisk-relateddecision-making...Sensitivityanalysis:intuition Consideracasewhereš‘Œ=š‘“(š‘„)andthe functionš‘“isaā€œblackboxā€ Wecansampleš‘Œfordifferentvaluesofš‘‹to

Feedback welcome!

Was some of the content unclear? Which parts were most useful toyou? Your comments to [email protected](email) or @LearnRiskEng (Twitter) will help us to improve thesematerials. Thanks!

@LearnRiskEng

fb.me/RiskEngineering

This presentation is distributed under the terms of theCreative Commons Attribution ā€“ Share Alike licence

For more free content on risk engineering,visit risk-engineering.org

32 / 32