Scenarios#
This class is the base class for all scenario classes. It contains the common methods for all scenario classes.
Constructor#
|
Scenarios class for the MacroStat model. |
Initialization and Loading#
|
Initialize the scenarios from a JSON file. |
|
Initialize the scenarios from an Excel file. |
Scenario Management#
|
Add a scenario to the model. |
|
Return the default scenario variable in vectorized form. |
|
Return the default scenario values. |
|
Get the index of a scenario by name. |
|
Verify that the scenario info is consistent: 1. |
Serialization / IO#
|
Save the scenarios to a JSON file. |
|
Save the scenarios to an Excel file. |
Notes#
The Scenarios class provides a uniform interface for handling scenarios, particularly for exogenous shocks. It supports both user-specified scenarios and calibration scenarios, and includes methods for loading and saving scenarios in various formats.
Example#
A typical workflow for scenarios might look like:
>>> scenarios = Scenarios(parameters)
>>> scenarios.add_scenario({'shock': 0.1}, name='shock_scenario')
>>> scenarios.to_json('scenarios.json')