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.
Models built using the Tax Analyzer Framework are easy to use, giving users a choice of a point-and-click graphical user interface (GUI), a command line interface (CLI), or a Python application programming interface (API), all of which provide access to the full range of model capabilities.
In addition to building the microsimulation model itself, input data need to be prepared for the model. These input data typically consist of tax return samples or income survey samples that contain thousands of records containing information needed to calculate the tax liability for each record. Preparing input data suitable for a model is typically more time consuming than the construction of the model itself, and each country's data situation varies widely. A data preparation guide identifies a variety of problems that can arise in this process and describes ways to solve those data problems.
Several models have been built using the Framework, notable among which are:
INI-Tax-Analyzer, a personal income tax model for India, which is the the best Framework-derived model to use as a template for new tax microsimulation models for other countries or other tax types. The input data used by the model are not confidential, so this is a fully-operational model available to the public.
MYI-Tax-Analyzer, a personal income tax model for Malaysia. The tax return data used as input by the model are confidential, so model installation requires a password.
ETI-Tax-Analyzer, a personal income tax model for Ethiopia. The income survey data used as input by the model are confidential, so model installation requires a password.
Questions about the Framework or Framework-derived models can be addressed to Martin Holmer.
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 an early test of the design of the Framework.
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 and the PolicyEngine US models. And the privately maintained MAI-Tax-Analyzer, which simulates Massachusetts income tax policy, has also been validated against TAXSIM35 and PolicyEngine US.
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.28.0 (2023-07-21)
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.