euromod_linking.methods.scale_variables¶
scale_variables — cell-level scaling of numeric input variables.
Consumes the scale channel: nominal wage changes, hours shocks, any income
component adjustment. metric = an input variable (e.g. yem) or an EUROMOD
income list (e.g. ils_udb_yem), which the orchestrator expands
extension-aware into its component input variables (ctx.metric_expansions).
Economic intuition¶
This is the price/income channel of model linking: a macro model projects nominal paths (wage growth by region/sector-proxy, hours adjustments) and the shock applies them heterogeneously across population cells — which is the entire point of pushing them through a microsimulation. A uniform +3% wage change has non-uniform disposable-income effects because tax brackets, benefit withdrawals and means tests bite differently along the distribution; EUROMOD supplies exactly that pass-through when the scaled inputs are simulated against unchanged (or separately shocked) policy parameters.
Income lists matter because “employment income” as an economic concept is not one variable: scaling the list scales every component the model itself counts under that concept (extension-aware: an extension can add or remove components), keeping the shock consistent with the model’s own accounting. Lists accept only mult/grow: a proportional factor distributes exactly over a sum, while an absolute add/set on an aggregate has no unique per-component allocation.
Purely arithmetic and deterministic: rows are matched per shock by its own
group keys (subset matching on derived dimension labels), ops apply in sorted
(metric, group) order, no rows are added or removed, and the baseline is the
untransformed run. Overlapping set shocks on one metric are rejected
(order-dependent); mult/grow compose commutatively.
Attributes¶
Classes¶
See module docstring. Instances are stateless between calls. |
Functions¶
|
Which components of each income list will actually be scaled, and a |
|
The |
|
|
Module Contents¶
- class euromod_linking.methods.scale_variables.ScaleVariables[source]¶
See module docstring. Instances are stateless between calls.
- apply(data: pandas.DataFrame, shocks: pandas.DataFrame, params: dict, ctx: euromod_linking.methods.base.MethodContext) euromod_linking.methods.base.MethodResult[source]¶
- check_dataset(columns, shocks: pandas.DataFrame) list[str][source]¶
- preview(data: pandas.DataFrame, shocks: pandas.DataFrame, params: dict, ctx: euromod_linking.methods.base.MethodContext) dict[source]¶
Which income-list components this scenario would actually scale.
Resolved the same way apply() resolves them, from the same columns, so the preview and the run cannot disagree.
- euromod_linking.methods.scale_variables.expansion_report(expansions: dict, columns) tuple[dict, list][source]¶
Which components of each income list will actually be scaled, and a warning naming the ones that will not.
A variable ending in
_sis a simulated output: EUROMOD computes it from the microdata during the run, so it is not a column of the input and cannot be scaled. Reporting a list’s full membership would promise a shock the run will not deliver —ils_udb_bunresolves to five components of which only two are input variables. The split is computed from the input’s own columns and used for both the preview and the run, so the two cannot disagree.
- euromod_linking.methods.scale_variables.income_lists() dict[source]¶
The
ils_udb_*catalogue as data, with usage notes. See INCOME_LISTS.
- euromod_linking.methods.scale_variables.resolve_income_lists(shocks: pandas.DataFrame, ctx: euromod_linking.methods.base.MethodContext) dict[source]¶
ils_*metrics -> their component input variables, from the live model.Extension-aware: which variables a list covers depends on which extensions are switched on, so this is resolved against the model rather than tabulated here. Returns {} when no shock names a list.
- euromod_linking.methods.scale_variables.INCOME_LISTS¶
- euromod_linking.methods.scale_variables.OP_FAMILY¶