euromod-linking¶
Connect external economic models to EUROMOD by transforming its input microdata and run parameters.
A macro model — a CGE model, a forecasting model, a policy scenario written by hand — projects changes: employment by region and education, nominal wages, price levels. EUROMOD simulates taxes and benefits on a household survey. This package is the layer between them. It takes those projected changes as data, rewrites the microdata and run parameters so the survey population matches them, and runs baseline and counterfactual simulations that differ only by the shock.
It is a standalone library, with no dependency on any agent, notebook or UI.
Important
This library targets the JRC’s EUROMOD model for the 27 EU member states, and only that model. It is not a general library for the EUROMOD software.
Other models are built on the same engine — SOUTHMOD, SWISSMOD, and national or regional models outside the EU — and this package will not work with them. It is written against EUROMOD’s own EU-27 conventions throughout, and those conventions are what a different model changes.
Install¶
pip install euromod-linking # or: pip install -e .
pip install euromod-linking[excel] # to ingest .xlsx/.xlsm/.xls model output
Python 3.11+, plus a local EUROMOD model and installation. Loading and running the model is the euromod connector’s job — this package sits on top of it, and the connector’s documentation is published alongside this site.
The model itself — the country parameter files and the software — is distributed by the JRC
and can be requested at
euromod-web.jrc.ec.europa.eu/download-euromod.
Point MODEL_PATH at the model folder you unpack; everything here resolves against that
installation rather than against anything shipped in this package.
What is assumed about the model¶
Every one of these is a EUROMOD EU-27 convention, and each is where a non-JRC model would break:
ils_udb_*income listsNaming for the income concepts a
scaleshock can address. These are EUROMOD’s User Database output lists, standardised across the EU-27 countries.les/les2labour statusThe code sets that decide who is employed, unemployed, inactive or shielded.
les2follows the EU-SILC/EMSD monthly-activity coding.drgn1/drgn2regionsThe
regiondimension resolves to these columns and reads their values as NUTS codes, so a coarser code covers its subregions.$lhw,dwt,idhh,idperson,dag,dgn,deh,yem,yivwgConstant and input-variable names taken as given, not discovered.
- The LMA add-on and the
LMA_transextension Required by
lma_labour_alignment, and maintained as part of the JRC model. See Model compatibility for how their presence is checked before a run.
Population cells and the shock table are the portable parts — they are written over whatever input variables a dataset has. The methods are where the EU-27 assumptions live.
The shape of it¶
import pandas as pd
from euromod import Model
from euromod_linking import apply_scenario, run_scenario
system = Model(r"C:\EUROMOD_RELEASES").countries["BE"].systems["BE_2025"]
scenario = {
"country_code": "BE",
"system_name": "BE_2025",
"shocks": {"inline": [
{"channel": "align", "metric": "employment", "group": "deh=0-3",
"period": "1", "op": "grow", "value": 0.0655},
]},
"params": {"period": "1"},
}
# Pure transform: the counterfactual input, a matched baseline, and diagnostics.
plan = apply_scenario(system, pd.read_csv(data_file, sep="\t"), scenario)
# Convenience: does the above and runs both simulations.
out = run_scenario(system, scenario, input_path=r"C:\EUROMOD_RELEASES\Input")
Four ideas carry the whole design, and the concept pages below take them in order: every external model’s output becomes one shock table; the people a shock applies to are named by a population cell written over real EUROMOD variables; a scenario document binds shocks to a country and system; and the methodology that does the transformation is resolved from the shocks rather than chosen by the caller.
Contents¶
Concepts
Methods
Guides
Reference