Difference between revisions of "Tornado charts"
Line 16: | Line 16: | ||
There are several options for selecting low and high values, including: | There are several options for selecting low and high values, including: | ||
− | * Selecting the same absolute low and high levels for every input. This usually only makes | + | * Selecting the same absolute low and high levels for every input. This usually only makes sense if inputs are very homogeneous with identical nominal values. |
− | sense if inputs are very homogeneous with identical nominal values. | ||
* Selecting absolute low and high values separately for each input variable. | * Selecting absolute low and high values separately for each input variable. | ||
− | * Varying all inputs by the same relative amount, e.g., low=90% of nominal, high=110% of | + | * Varying all inputs by the same relative amount, e.g., low=90% of nominal, high=110% of nominal. |
− | nominal. | ||
* Varying all inputs between two given fractiles. This only makes sense if your inputs are | * Varying all inputs between two given fractiles. This only makes sense if your inputs are | ||
− | uncertain variables. Example: Low=10% fractile, High=90% fractile, nominal=50% fractile. | + | uncertain variables. '''Example:''' Low=10% fractile, High=90% fractile, nominal=50% fractile. |
− | '''Implementing a tornado analysis:''' | + | '''Implementing a tornado analysis:''' |
− | # Create an index variable containing a list of input variable identifiers. Suppose this is called Vars. | + | ''For this example, assume we vary all inputs by the same amount.'' |
− | # Create a variable, Level, and define it as a self-indexed table. (To do this, select Table from | + | |
− | the expr menu, and select self as an index.) From the edit table, set the self-index labels to | + | # Create an index variable containing a list of input variable identifiers. Suppose this is called <code>Vars</code>. |
− | read low and high. Set the value corresponding to low to 90%, and set the value corresponding to high to 110%. | + | # Create a variable, <code>Level</code>, and define it as a self-indexed table. (To do this, select '''Table''' from the '''expr''' menu, and select self as an index.) From the edit table, set the self-index labels to read low and high. Set the value corresponding to low to 90%, and set the value corresponding to high to 110%. |
#: | #: | ||
− | #:[[File:Chapter16_6.png]] | + | #: [[File:Chapter16_6.png]] |
#: | #: | ||
− | #Create a node, Tornado_Analysis. Assume that the output variable is Net_value. Define | + | #Create a node, <code>Tornado_Analysis</code>. Assume that the output variable is <code>Net_value</code>. Define <code>Tornado_Analysis</code> as: |
− | Tornado_Analysis as: | + | #: <code>WhatIfAll(X, Vars, Level*Vars)</code> |
− | + | #Create a node, <code>Input_Vars</code>, defined as: | |
− | #Create a node, Input_Vars, defined as: | + | #: <code>sortIndex(-abs(Tornado_Analysis[Level = 'high'] - Tornado_Analysis[Level = 'low']))</code> |
− | + | # Create a node, <code>Net_value_range</code>, to hold the final graph, defined as: | |
− | + | #: <code>Tornado_Analysis[Vars = Input_Vars]</code> | |
− | # Create a node, Net_value_range, to hold the final graph, defined as: | ||
− | |||
− | Steps 4 and 5 are not necessary if you do not require your bars to be displayed from largest to smallest. If you do include steps 4 and 5, Net_value_range contains the results of the tornado analysis, otherwise the result is Tornado_Analysis. | + | Steps 4 and 5 are not necessary if you do not require your bars to be displayed from largest to smallest. If you do include steps 4 and 5, <code>Net_value_range</code> contains the results of the tornado analysis, otherwise the result is <code>Tornado_Analysis</code>. |
It is possible in Analytica to use array abstraction to produce a set of tornado diagrams, with each tornado itself indexed by an additional dimension. Additional dimensions are already included if your output variable is itself an array result, in which case you have a tornado diagram for each element in the output value’s array value. This flexibility is unique to Analytica; however, you should note that having multiple tornados in a single result complicates the problem of sorting the bars, since the sort order is, in general, different for the different bars. If you have extra indexes in your tornado analysis, you need to either skip steps 4 and 5 above, and display non-sorted Tornados, or select a single sort order based on whatever criteria fits your needs, realizing that not all tornados display in sorted order. | It is possible in Analytica to use array abstraction to produce a set of tornado diagrams, with each tornado itself indexed by an additional dimension. Additional dimensions are already included if your output variable is itself an array result, in which case you have a tornado diagram for each element in the output value’s array value. This flexibility is unique to Analytica; however, you should note that having multiple tornados in a single result complicates the problem of sorting the bars, since the sort order is, in general, different for the different bars. If you have extra indexes in your tornado analysis, you need to either skip steps 4 and 5 above, and display non-sorted Tornados, or select a single sort order based on whatever criteria fits your needs, realizing that not all tornados display in sorted order. | ||
− | The WhatIfAll() function typically provides the easiest method for implementing a tornado analysis in Analytica. Note that the third parameter to WhatIfAll() controls the method by which inputs are varied for the analysis. For example: | + | The '''[[WhatIfAll]]()''' function typically provides the easiest method for implementing a tornado analysis in Analytica. Note that the third parameter to '''WhatIfAll()''' controls the method by which inputs are varied for the analysis. For example: |
− | * For the case where you select the same absolute low and high levels for every input, Level | + | * For the case where you select the same absolute low and high levels for every input, <code>Level</code> would be set to the absolute low and high values, and the third parameter to '''WhatIfAll()''' would be simply <code>Level</code>. |
− | would be set to the absolute low and high values, and the third parameter to WhatIfAll() | + | * For the case where you select absolute low and high values separately for each input variable, you would index <code>Level</code> by <code>Vars</code>, fill in <code>Level</code>’s table appropriately, then set the third parameter to be just <code>Level</code>. |
− | would be simply Level. | + | * And for the case where you vary all inputs between two given fractiles, you would set <code>Level</code> to the desired fractiles, and use the expression <code>getFract(Net_value, Level)</code> as the third parameter. |
− | * For the case where you select absolute low and high values separately for each input | ||
− | variable, you would index Level by Vars, fill in | ||
− | third parameter to be just Level. | ||
− | * And for the case where you vary all inputs between two given fractiles, you would set Level to the desired fractiles, and use the expression getFract(Net_value,Level) as the | ||
− | third parameter. | ||
'''Graphing a tornado:''' It’s customary to graph a tornado with the names of the input variables are listed down the vertical axis, and the bars displaying the effect on the output horizontally: | '''Graphing a tornado:''' It’s customary to graph a tornado with the names of the input variables are listed down the vertical axis, and the bars displaying the effect on the output horizontally: | ||
− | # Select Show Result for the Tornado_Analysis or Sorted_Tornado variable. Press the | + | # Select '''Show Result''' for the <code>Tornado_Analysis</code> or <code>Sorted_Tornado</code> variable. Press the '''Graph''' button if necessary. |
− | Graph button if necessary. | + | # Pivot the index order (if necessary) so that <code>Vars</code> is on the X-axis and '''L''' is the <code>Key</code>. |
− | # Pivot the index order (if necessary) so that Vars is on the X-axis and L is the Key. | + | # Select '''Graph Setup''' and the '''Chart Type''' tab. |
− | # Select Graph Setup and the Chart Type tab. | + | # Set the ''Line Style'' to the filled bar setting and check the ''Variable origin'' checkbox. This will also set ''Bar Overlap'' = 100% and ''Swap horizontal and vertical'' for you. Click '''Apply'''. |
− | # Set the Line Style to the filled bar setting and check the Variable origin checkbox. This will also set Bar Overlap=100% and Swap horizontal and vertical for you. Click Apply. | + | # Next, we want to compare to the baseline value of <code>Net_Value</code>. Click the '''XY''' button to open the '''XY Comparison Sources''' dialog, check ''Use another variable'', press '''Add...''', and in the '''Object Finder''' select the variable <code>Net_Value</code>. Press OK twice. |
− | # Next, we want to compare to the baseline value of Net_Value. Click the XY button to open | + | # In the Bar Origin pulldown, select <code>Net_value</code>. |
− | the XY Comparison Sources dialog, check Use another variable, press Add..., and in the Object Finder select the variable Net_Value. Press OK twice. | ||
− | # In the Bar Origin pulldown, select Net_value. | ||
==See Also== | ==See Also== | ||
<footer>Sensitivity analysis functions / {{PAGENAME}} / X-Y plots</footer> | <footer>Sensitivity analysis functions / {{PAGENAME}} / X-Y plots</footer> |
Revision as of 02:39, 18 December 2015
A tornado diagram is a common tool used to depict the sensitivity of a result to changes in
selected variables. It shows the effect on the output of varying each input variable at a time, keeping all the other input variables at their initial (nominal) values. Typically, you choose a “low” and a “high” value for each input. The result is then displayed as a special type of bar graph, with bars for each input variable displaying the variation from the nominal value. It is standard practice to plot the bars horizontally, sorted so that the widest bar is placed at the top. When drawn in this fashion, the diagram takes on the appearance of a tornado, hence its name. The figure below shows a typical tornado diagram.
Create a tornado analysis: To perform a tornado analysis, you must:
- Select the result or output variable to perform the analysis on.
- Select the input variables that might affect the output.
- Decide what the low and high values are to be for each input variable.
Note: The input variables do not need to be chance variables. In fact, tornado analysis is often applied to models with no chance variables.
There are several options for selecting low and high values, including:
- Selecting the same absolute low and high levels for every input. This usually only makes sense if inputs are very homogeneous with identical nominal values.
- Selecting absolute low and high values separately for each input variable.
- Varying all inputs by the same relative amount, e.g., low=90% of nominal, high=110% of nominal.
- Varying all inputs between two given fractiles. This only makes sense if your inputs are
uncertain variables. Example: Low=10% fractile, High=90% fractile, nominal=50% fractile.
Implementing a tornado analysis:
For this example, assume we vary all inputs by the same amount.
- Create an index variable containing a list of input variable identifiers. Suppose this is called
Vars
. - Create a variable,
Level
, and define it as a self-indexed table. (To do this, select Table from the expr menu, and select self as an index.) From the edit table, set the self-index labels to read low and high. Set the value corresponding to low to 90%, and set the value corresponding to high to 110%. - Create a node,
Tornado_Analysis
. Assume that the output variable isNet_value
. DefineTornado_Analysis
as:WhatIfAll(X, Vars, Level*Vars)
- Create a node,
Input_Vars
, defined as:sortIndex(-abs(Tornado_Analysis[Level = 'high'] - Tornado_Analysis[Level = 'low']))
- Create a node,
Net_value_range
, to hold the final graph, defined as:Tornado_Analysis[Vars = Input_Vars]
Steps 4 and 5 are not necessary if you do not require your bars to be displayed from largest to smallest. If you do include steps 4 and 5, Net_value_range
contains the results of the tornado analysis, otherwise the result is Tornado_Analysis
.
It is possible in Analytica to use array abstraction to produce a set of tornado diagrams, with each tornado itself indexed by an additional dimension. Additional dimensions are already included if your output variable is itself an array result, in which case you have a tornado diagram for each element in the output value’s array value. This flexibility is unique to Analytica; however, you should note that having multiple tornados in a single result complicates the problem of sorting the bars, since the sort order is, in general, different for the different bars. If you have extra indexes in your tornado analysis, you need to either skip steps 4 and 5 above, and display non-sorted Tornados, or select a single sort order based on whatever criteria fits your needs, realizing that not all tornados display in sorted order.
The WhatIfAll() function typically provides the easiest method for implementing a tornado analysis in Analytica. Note that the third parameter to WhatIfAll() controls the method by which inputs are varied for the analysis. For example:
- For the case where you select the same absolute low and high levels for every input,
Level
would be set to the absolute low and high values, and the third parameter to WhatIfAll() would be simplyLevel
. - For the case where you select absolute low and high values separately for each input variable, you would index
Level
byVars
, fill inLevel
’s table appropriately, then set the third parameter to be justLevel
. - And for the case where you vary all inputs between two given fractiles, you would set
Level
to the desired fractiles, and use the expressiongetFract(Net_value, Level)
as the third parameter.
Graphing a tornado: It’s customary to graph a tornado with the names of the input variables are listed down the vertical axis, and the bars displaying the effect on the output horizontally:
- Select Show Result for the
Tornado_Analysis
orSorted_Tornado
variable. Press the Graph button if necessary. - Pivot the index order (if necessary) so that
Vars
is on the X-axis and L is theKey
. - Select Graph Setup and the Chart Type tab.
- Set the Line Style to the filled bar setting and check the Variable origin checkbox. This will also set Bar Overlap = 100% and Swap horizontal and vertical for you. Click Apply.
- Next, we want to compare to the baseline value of
Net_Value
. Click the XY button to open the XY Comparison Sources dialog, check Use another variable, press Add..., and in the Object Finder select the variableNet_Value
. Press OK twice. - In the Bar Origin pulldown, select
Net_value
.
Enable comment auto-refresher
Pdavis2