Scenario Analysis

After you have created good models, you can use them to conduct scenario analyses. If you create a scenario for how the input variables to the models will develop into the future, then the model can predict how the target variable is likely to develop, given that the input variables unfold as specified in the scenario.

Prognosis

The first step is to specify a scenario, by making a prognosis for how each of the input variables will develop. This is done with the extend function.

signal.extend(date, value)

Extend the signal into the future. The variable will be set to the given value at the given future date, and it will be linearly interpolated between the current value and that future value.

Parameters:
  • date (str) – The future date to make a prediction for

  • value (float) – The value the variable is predicted to have at the future date in the scenario

For example, to predict that Brent crude oil price will be $115 on December 31, 2019:

quandl("CHRIS/ICE_B28.4").extend('2019-12-31', 115)

A signal can be extended multiple times, to create a scenario with predictions at multiple future dates. For example, to predict that the oil price will be $115 on December 21, 2019 and then fall to $50 on August 15, 2020:

quandl("CHRIS/ICE_B28.4").extend('2019-12-31', 115).extend('2020-08-15', 50)

After creating the above prognosis, it can be saved as a new signal, say ‘oil_prognosis’. Then this signal can be used as input to a model, in order to see what the model predicts in the future, given this prognosis:

predict(close_price, [oil_prognosis], freq='B')

By evaluating this signal for say the company Equinor ASA, you can see how sensitive the model thinks that the stock price of Equinor is relative to changes in the oil price.