Model#
This class is the base class for all model classes. It contains the common methods for all model classes.
Constructor#
|
A general class to represent a macroeconomic model. |
Initialization and Loading#
|
Class method to load a model instance from a pickled file. |
Simulation and Behavior#
|
Simulate the model. |
Serialization / IO#
|
Save the model object as a pickled file |
|
Convert the model to a JSON file split into parameters, scenarios, and variables. |
Notes#
The Model class is designed to be a flexible wrapper that allows users to implement their own model behavior while maintaining a consistent interface. The key method that users need to implement is simulate(), which should return a pandas DataFrame containing the simulation results.
Example#
A general workflow for a model might look like:
>>> model = Model(parameters, hyperparameters)
>>> output = model.simulate()
>>> model.save()