3. Installation#
At the World Bank, models built using the MFMod framework are developed in EViews. When disseminated to clients, the models are solved and simulated using EViews - often through the intermediary of an easy-to-use customized excel environment developed by the World Bank. That said, as systems of equations and associated data, the models can be solved and operated under any software capable of solving a system of simultaneous equations. ModelFlow is such a package that permits not only solving the models, but also provides a rich and powerful suite of tools for analyzing the model and reporting results.
ModelFlow is a python library that was developed by Ib Hansen over several years while working at the Danish Central Bank and the European Central Bank. The framework has been used both to port the U.S. Federal Reserve’s macro-structural model to python, but also been used to bring several stress-testing models developed by Central Banks into the python environment.
Beginning in 2019, Hansen has worked with the World Bank to develop additional features that facilitate working with models built using the Bank’s MFMod Framework, with the objective of creating an open source platform through which the Bank’s models can be made available to the public.
ModelFlow defines the model class, its methods and a number of other functions that extend and combine pre-existing python functions to allow the easy solution of complex systems of equations including macro-structural models like MFMod. To work with ModelFlow, a user needs to first install python (preferably the Anaconda or MiniConda variants). Then install the ModelFlow package and several supporting packages.
While ModelFlow can be run directly from the python command-line or IDEs (Interactive Development Environments) like Spyder or Microsoft’s Visual Code, it is suggested that users install the Jupyter notebook system. Jupyter Notebook facilitates an interactive approach to building python programs, annotating them and ultimately doing simulations using MFMod under ModelFlow. This entire manual, and the examples in it, was written and executed in the Jupyter Notebook environment using the Jupyter Book package.
To use the ModelFlow package First Python has to be installed. Then the ModelFlow package can be installed together with all the libraries on which it depends.
In this chapter - Installation
This chapter provides step-by-step instructions for setting up the ModelFlow framework to work with World Bank macroeconomic models. It provides both novice and experienced python users with clear instructions on the steps necessary to install a reliable and reproducible ModelFlow environment for advanced modeling tasks.
Key covered topics include:
Python Installation:
Using the
AnacondaorMiniCondaenvironments.A discussion of the benefits of each notes that Anaconda offers a comprehensive package ecosystem (perhaps best suited for newcomers to python, while
MiniCondais more lightweight and customizable and may be best suited for more experienced python users.
Installing the
ModelFlowEnvironment:Create a dedicated Python environment for
ModelFlowto avoid package conflicts.Install
ModelFlowand its dependencies using the provided commands.
System Compatibility:
Supported on Windows, MacOS, and Linux.
Installation is straightforward, with Windows being the primary platform tested.
Updating
ModelFlow:Using the
condacommand to updateModelFlowpackages within the created environment.