STEM help / Model structure

9.3.8 Using formulae with scenario parameters and variants

In addition to the scenario management mechanism, STEM also provides a powerful facility to capture relationships between input data, as well as the actual values. Internal references can be used within formulae to make one field dependent on another – see 4.12.3 Internal references and reference mode. These two techniques can be used together with great effect.

Using formulae with scenario parameters

For example, you might make another service input conditional on the Penetration, perhaps imposing a reduced Rental Tariff below some threshold Penetration:

  1. Select Tariffs from the service icon menu. The Tariffs dialog is displayed.
  2. Select the Rental Tariff field by left-clicking with the mouse or using the cursor keys.
  3. Enter the formula if (Penetration.RefValue < 0.15, 25, 50) and press <Enter>. A Rental Tariff of 25 is levied when the Penetration is below 15%, rising to 50 above this level, modelling an initial marketing gambit for a new service.

Note: To save typing the Penetration reference in the formula, you can click on the Penetration button after entering the if( part to pick up the reference text directly, and then add the ) – see 4.12.3 Internal references and reference mode. This formula would also be more elegant if the threshold and upper/lower values were entered as User Data – see 9.1 Extending the STEM data model with user data.

Applying alternative variants to the Penetration allows you to see how the Rental Tariff will be levied in the various scenarios – try it! You should find that, with the variant values suggested above, the Rental Tariff only rises to 50 in the Optimistic scenario, and then only after six years.

Figure 1: Applying scenario data to an invariant relationship

Although it would be possible to identify the Rental Tariff as an additional scenario parameter in its own right, the advantage of this formulaic approach is that the policy to raise the Rental Tariff at 15% Penetration becomes part of the common model structure, which does not vary between scenarios.

Using formulae to link variant data

The scenario mechanism in STEM allows you to define alternative values for key parameters of a model, and sometimes it may be helpful to set up a dependency between these variants, e.g., three variants ±10% around a middle value, or the Pessimistic value for service Penetration defined as 70% of its Probable value:

  1. Select the Penetration field in the service Demand dialog.
  2. Select View Variant Data… from the Variants menu. The Variant Data dialog is displayed, showing 0.07 and 0.1 for the Pessimistic and Probable variants, respectively.
  3. Select the Pessimistic button by left-clicking with the mouse or using the cursor keys.
  4. Enter the formula 0.7* Probable."Service1.Penetration.RefValue" on the button and press <Enter>. The value on the button is now displayed in red, indicating the presence of the formula, and that the value for the Pessimistic variant is now dependent on the Probable variant. Now, whenever you change the Probable value, the Pessimistic value will automatically follow suit.

Figure 2: Linking Variant Data

Note: To save typing the Probable Penetration reference in the formula, you can click on the Probable Penetration button after entering the 0.7* part to pick up the reference text directly – see 4.12.3 Internal references and reference mode.

You could employ the same technique to link the Optimistic variant too, so that all three variants would be controlled by the single Probable input. Factors of 0.9 and 1.1 for the respective multiplications would give you variants ±10%, which would be an efficient way to test the sensitivity of the results to this parameter.

Using formulae to link variant data from other applications

Another reason for using formulae to define variant data, and in fact a key factor which led to the implementation of variants as model elements, is that you can link individual time-series data within a Variant Data dialog from an Excel spreadsheet, or from a database. More generally, you can link default values for all the parameters in a variant through a single formula, by selecting Defaults from the variant icon menu – see 4.14.3 Linking default values for model elements.

 

       Buy SSL

© Implied Logic Limited