Welcome to ModelFlow’s documentation!
A Python toolkit to manage models
The Pandas library is a great library to handle all kinds of datamanipulation and transformations.
However when it comes to models which contains lags or models which requires solving simultanous equations, Pandas is not quite helpful.
ModelFlow extends Pandas to handle a range of such models. And they can be large.
It requires you to specify the model specified as equations (the business logic) and place the data in a Pandas DataFrame. ModelFlow allows the model to meet the data and return the result as a new DataFrame.
A number of analytical tools for model and result analytic helps to understand the model and its results.
The user can extend and modify the tools to her or his needs.
Onboarding models and combining models from different sources. Creating a Macro prudential model often entails recycling several models specified in different ways: Excel, Latex, Dynare, Python or other languages. Python’s ecosystem makes it possible to transform many different models into ModelFlow models or to wrap them into functions which can be called from ModelFlow models.
Models can be specified in a high level Business logic language (a Domain Specific language). This allows the formulation of a model in a concise and expressive language which is close to the economic of the model. The user can concentrate on the economic or financial content - not the coding of the solution. The code for solving the model is generated by the tool. Then you can solve the simultaneous (or non-simultaneous model) in an efficient way.
If you need a feature or have a model which can’t be handled in ModelFlow, you are encouraged to improve ModelFlow. Please share the improvement, other users may have the same need, or can be inspired by your work.
Bear in mind that ModelFlow is experimental. It is provided ”as is”, without any representation or warranty of any kind either express or implied.
You will find a tutorial here: https://ibhansen.github.io/index.html
Indices and tables
Modules
content:
- Introduction
- Installation
- Core Modules, creates and solves model instances
- modelclass module
BaseModelOrg_model_MixinModel_help_MixinDekomp_MixinDescription_MixinModify_MixinGraph_MixinGraph_Draw_MixinDisplay_MixinJson_MixinZip_MixinExcel_MixinSolver_MixinDash_MixinFix_MixinStability_MixinReport_Mixinmodelupdnodettimer()create_model()get_a_value()set_a_value()insertModelVar()lineout()dfout()upddfold()upddf()randomdf()join_name_lag()timer_old()
- modelnewton module
- modelpattern module
- modelBLfunk module
- modeluserfunk module
- modelclass module
- Processing model specification
- Attribution
- Quick result visualization
meltdim()DummyVisvisvis.explain()vis.draw()vis.dekomp()vis.heat()vis.plot()vis.plot_alt()vis.box()vis.violin()vis.swarm()vis.dfvis.basevis.pctvis.growthvis.year_pctvis.yoy_growthvis.qoq_arvis.frmlvis.desvis.eviewsvis.difvis.difpctlevelvis.difpctvis.difgrowthvis.exovis.printvis.showvis.rename()vis.endovis.mul()vis.mul100
compviscontainervarvisvis_alt()plotshow()melt()heatshow()attshow()attshowone()water()waterplot()
- Report writing
track_fields()DatatypeAccessorDisplayDefLatexRepoDisplayVarTableDefDisplayVarTableDef.make_var_df()DisplayVarTableDef.df_str_oldDisplayVarTableDef.df_strDisplayVarTableDef.df_str_dispDisplayVarTableDef.df_str_disp_transposeDisplayVarTableDef.showDisplayVarTableDef.sheetwidgetDisplayVarTableDef.out_htmlDisplayVarTableDef.htmlwidget_oldDisplayVarTableDef.htmlwidgetDisplayVarTableDef.latexDisplayVarTableDef.latex_straightDisplayVarTableDef.latex_transpose_oldDisplayVarTableDef.latex_transposeDisplayVarTableDef.make_html_style()
DisplayKeepFigDefDisplayTextDefDisplayContainerDefDisplayContainerDef.mmodelDisplayContainerDef.reportsDisplayContainerDef.nameDisplayContainerDef.optionsDisplayContainerDef.set_name()DisplayContainerDef.set_scenarios()DisplayContainerDef.latexDisplayContainerDef.pdf()DisplayContainerDef.spec_listDisplayContainerDef.save_specDisplayContainerDef.to_json()DisplayContainerDef.reports_restore()DisplayContainerDef.showDisplayContainerDef.sheetwidgetDisplayContainerDef.out_html
DisplayFigWrapDefHtmlSplitTableHTMLSplitDatacenter_title_under_years()create_instance_from_json()create_column_multiindex()center_multiindex_headers()create_column_multiindex__()format_list_with_numbers()add_footer_to_styler()split_text_html_latex()split_text()get_DisplayTextDef()insert_centered_row()SplitTextResultOptionsLineDisplaySpec
- Dashboard
- Jupyter Stuff
- Targets and instruments
- Enrich dataframes with modelflow
- Convex optimization
- Template for a user defined model class based on the model class