Skip to main content

Run the microsimulation model EUROMOD. The latest model and software versions of EUROMOD are available at https://euromod-web.jrc.ec.europa.eu/download-euromod .

Project description

Euromod Connector

python Static Badge Documentation Status

What is Euromod?

The Euromod Connector for Python is built to facilitate and simplify the usage of the EUROMOD microsimulation model for research and analysis purposes.

EUROMOD is a tax-benefit microsimulation model for the European Union that enables researchers and policy analysts to calculate, in a comparable manner, the effects of taxes and benefits on household incomes and work incentives for the population of each country and for the EU as a whole. It is a static microsimulation model that applies user-defined tax and benefit policy rules to harmonised microdata on individuals and households, calculates the effects of these rules on household income.

Installation

Install via PyPi using pip:

$ pip install euromod

Requirements

The Euromod Connector requires two EUROMOD components: 1) the model (coded policy rules) , and 2) the input microdata with the variables that respect the EUROMOD naming conventions. For more information, please, read the sections "Model" and "Input microdata" on the Download Euromod web page.

Run simulation

Importing and loading the model:

In[1]: from euromod import Model
In[2]: mod=Model(r"C:\EUROMOD_RELEASES_I6.0+")

Loading the dataset using pandas:

In[3]: import pandas as pd
In[4]: data = pd.read_csv(r"C:\EUROMOD_RELEASES_I6.0+\Input\sl_demo_v4.txt",sep="\t")

Running a simulation on system 'SL_1996' of the country Simpleland 'SL' (Note: this country model is provided by default with the EUROMOD project):

In[5]: out=mod.countries['SL'].systems['SL_1996'].run(data,'sl_demo_v4')
In[6]: out.outputs[0]
Out[6]:
       idhh  idperson  idmother  ...    ils_dispy  il_taxabley  il_bsa_base
0       1.0     101.0       0.0  ...   807.018500      0.00000    807.01850
1       1.0     102.0       0.0  ...     0.000000      0.00000      0.00000
2       1.0     103.0     102.0  ...     0.000000      0.00000      0.00000
3       1.0     104.0     102.0  ...   934.294772    149.54786    149.54786
4       2.0     201.0       0.0  ...  1337.268280   1421.58535   1337.26828
    ...       ...       ...  ...          ...          ...          ...
1255  500.0   50003.0   50002.0  ...     0.000000      0.00000      0.00000
1256  500.0   50004.0   50002.0  ...     0.000000      0.00000      0.00000
1257  500.0   50005.0   50002.0  ...     0.000000      0.00000      0.00000
1258  500.0   50006.0       0.0  ...   839.845300      0.00000    839.84530
1259  500.0   50007.0       0.0  ...     0.000000      0.00000      0.00000

[1260 rows x 43 columns]

Checking the policies for country Simpleland 'SL':

In[7]: mod.countries['SL'].policies
Out[7]:
0: Uprate_sl            |    DEF: UPRATING FACTORS 
1: ILsDef_sl            |    DEF: STANDARD INCOME CONCEPTS 
2: ILDef_sl             |    DEF: SPECIFIC INCOME CONCEPTS 
3: TUDef_sl             |    DEF: ASSESSMENT UNITS 
4: yem_sl               |    DEF: Minimum Wage 
5: neg_sl               |    DEF: recode negative self-employment income to zer ... 
6: sic_sl               |    SIC: Social Insurance Contributions 
7: bch_sl               |    BEN: Child Benefit 
8: tin_sl               |    TAX: Income Tax 
9: bsa_sl               |    BEN: Social Assistance 
10: output_std_sl       |    DEF: STANDARD OUTPUT INDIVIDUAL LEVEL 
11: output_std_hh_sl    |    DEF: STANDARD OUTPUT HOUSEHOLD LEVEL 

Checking the policies for country Simpleland 'SL' in system 'SL_1996':

In[8]: mod.countries['SL'].systems['SL_1996'].policies
Out[8]:
0: Uprate_sl             | on        |    DEF: UPRATING FACTORS 
1: ILsDef_sl             | on        |    DEF: STANDARD INCOME CONCEPTS 
2: ILDef_sl              | on        |    DEF: SPECIFIC INCOME CONCEPTS 
3: TUDef_sl              | on        |    DEF: ASSESSMENT UNITS 
4: yem_sl                | on        |    DEF: Minimum Wage 
5: neg_sl                | on        |    DEF: recode negative self-employment income to zer ... 
6: sic_sl                | on        |    SIC: Social Insurance Contributions 
7: bch_sl                | on        |    BEN: Child Benefit 
8: tin_sl                | on        |    TAX: Income Tax 
9: bsa_sl                | on        |    BEN: Social Assistance 
10: output_std_sl        | on        |    DEF: STANDARD OUTPUT INDIVIDUAL LEVEL 
11: output_std_hh_sl     | off       |    DEF: STANDARD OUTPUT HOUSEHOLD LEVEL 

Getting information about a specific policy, e.g. "sic_sl", at a country level:

In[9]: mod.countries['SL'].policies[6]
Out[9]:
------------------------------
Policy
------------------------------
	 ID: '20901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 comment: 'SIC: Social Insurance Contributions'
	 extensions: 0 elements
	 functions: SchedCalc, SchedCalc, SchedCalc
	 name: 'sic_sl'
	 order: '7'
	 private: 'no'
	 spineOrder: '7'

Getting information about a specific policy, e.g. "sic_sl", at a system level:

In[9]: mod.countries['SL'].systems['SL_1996'].policies[6]
Out[9]:
------------------------------
PolicyInSystem
------------------------------
	 ID: 'F7E5CACE-CECC-4BB6-9841-A936D097548120901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 comment: 'SIC: Social Insurance Contributions'
	 extensions: 0 elements
	 functions: SchedCalc, SchedCalc, SchedCalc
	 name: 'sic_sl'
	 order: '7'
	 polID: '20901CF5-0A2A-4BA8-A18A-7092CD6A182D'
	 private: 'no'
	 spineOrder: '7'
	 switch: 'on'
	 sysID: 'F7E5CACE-CECC-4BB6-9841-A936D0975481'

License

© Copyright 2024 European Commission. EUROMOD is licensed under the EUPL, Version 1.2. See the documentation for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

euromod-0.2.13-py3-none-win_amd64.whl (1.4 MB view details)

Uploaded Python 3Windows x86-64

euromod-0.2.13-py3-none-manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded Python 3

File details

Details for the file euromod-0.2.13-py3-none-win_amd64.whl.

File metadata

  • Download URL: euromod-0.2.13-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for euromod-0.2.13-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 66b1ea80b7b05fafc2c39943f59b143efababbb64436ccc8f67e83956c7cfb0e
MD5 4b6ba885a3e3037081367d905b7e6c18
BLAKE2b-256 df5d9d2f5d1c38f06e0ae67995a7d7f0cbd80cb7a36f3bdc7e1f8d633650505b

See more details on using hashes here.

File details

Details for the file euromod-0.2.13-py3-none-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for euromod-0.2.13-py3-none-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7077663ab9442d73187222f539f0858bdfc77150ec3fcb5d6dee62b2ff42ac7b
MD5 a42e6642bd3db9c66160e83ccd2b309d
BLAKE2b-256 ccecaabae498713e9b319d3275f6864489acd925fd87b2852c2a905f5f68ddf2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page