Open-Source Tax Analyzer Framework
The open-source Tax Analyzer Framework is a software framework for developing tax microsimulation models with minimal coding. Development of a model involves defining parameters and variables in seven JSON files and preparing tax-filing-unit data in three CSV files. The logic of tax calculation is written in code that is very simple and would be easy to write for anyone with experience in any programming language.
The Tax Analyzer Framework grew out of the experience beginning in late 2018 of converting an income tax microsimulation model for the US into one for India. While the conversion was viewed as a success by the World Bank staff in Washington and the Ministry of Finance staff in New Delhi, the initial conversion and ongoing development of the model was hampered by a number of problems. After getting expressions of interest for such a model from a number of other governments, World Bank staff expressed interest in a framework that would be easier to adapt to a different country or a different kind of tax, and a framework whose derived tax models would be easier to use (for government staff that have data analysis skills, but little or no computer programming experience). The Tax Analyzer Framework, which has been developed by Martin Holmer of the Policy Simulation Group (PSG), is the result of that expression of interest.
The following features of the Framework, and models derived from it, are notable:
The Framework supports rapid development of tax microsimulation models by providing the generic microsimulation logic and allowing model developers to specify just the features of their country and type of tax in a number of JSON parameter files and in a few CSV data files. The actual logic of the country's tax is described in one file using a very simple programming language that consists mostly of if-then-else statements and assignment statements that use basic arithmetic and min and max functions.
Framework-derived models are easy to use because the full range of their capabilities are accessible by simply executing commands at the command prompt, relieving users from any computer programming and leaving them to concentrate on how best to tabulate and visualize model results in the data analysis software of their own choice. Users simply tell the model what kind of analysis they want to do and the model figures out how to do the specified analysis.
Framework-derived models are full-featured: they conduct static analysis of a tax reform by default, but they have an option for conducting analysis that includes one or more partial-equilibrium responses to the reform using user-specified, non-linear elasticities. The models also have an option for analyzing the implications of the growth effects of a reform using user-specified growth differences that can be developed from a general-equilibrium model or specified as what-if assumptions.
The Framework was used to develop a US wealth tax model as described here. Developing that model served as a test of the design of the Framework. And the code of this Framework-derived model serves as a template for new tax microsimulation models for other countries or other tax types. Read the USW-Tax-Analyzer documentation about using that model as a template to create a new model.
The Framework is extensively tested and Framework-derived models have been validated against other models. The test suite for the Framework itself has complete code coverage. The Framework-derived USI-Tax-Analyzer, which simulates US federal income and payroll taxes and is privately maintained by the Policy Simulation Group, has been extensively validated against the NBER TAXSIM35 model. And the privately maintained MAI-Tax-Analyzer, which simulates Massachusetts income tax policy, has also been validated against TAXSIM35.
Experience developing models for several countries led to the addition of new features: several standard graphs and the SQLite dump output option were added in Framework versions 2.x, a model run specification language was added in Framework versions 3.x, and a graphical user interface (GUI) was added in Framework versions 4.x.
The run specification language is easy to learn, has a number of special features making it easy to specify a policy reform or behavior response or growth difference, puts all the details of a model run in one file, makes it easy to include comments in the run specification file, eliminates the need for model users to write JSON files, and produces model output files that have simple names. The parser and interpreter for this run specification language is implemented using Lark.
The graphical user interface guides a user through the specification of a model run (automatically generating a run specification file), executes the run, and provides easy viewing of all resulting text output and graphs in the user's default web browser.
Several tools for preparing model input data are also provided by the Framework. Descriptions of the tools and examples of their use are provided in the data-preparation tools documentation.
The source code is free and open-source, being distributed under the 2-clause BSD license.
Latest Release: Version 4.21.0 (2022-05-12)
A summary of changes in the latest source code release (and in all prior releases) can be found in the change log.
A detailed history of source code changes is available via the timeline.
Instructions on how to download the code and install the Tax-Analyzer-Framework package are provided in the installation guide.