euromod_linking.methods.lma_labour_alignment.targets

Target construction: shock-table rows -> per-cell weighted targets.

Cells are built from whatever dimensions appear in the shock groups: region x education, age x gender, or any other combination of input variables works identically. The region dimension is collapsed to the level the dataset actually supports (drgn2 -> drgn1 -> country) by truncating shock region codes to the data’s code length and averaging growth-type shock values within the collapsed cell — an equal-weight average, since the microdata by definition cannot weight a level it does not resolve.

Attributes

Functions

build_targets(→ tuple[pandas.DataFrame, list[str]])

Per-cell current weighted counts + targets for employment/unemployment.

cell_report(→ list[dict])

Per-cell baseline, resolved target, implied change and feasibility.

feasibility_warnings(→ list[str])

Warnings for cells whose shock consumes an implausible share of the pool.

totals(→ dict)

Scenario-wide sums over the shocked cells (unshocked cells contribute 0).

Module Contents

euromod_linking.methods.lma_labour_alignment.targets.build_targets(df: pandas.DataFrame, shocks_period: pandas.DataFrame, used: dict[str, list[str]], eligible: pandas.Series) tuple[pandas.DataFrame, list[str]][source]

Per-cell current weighted counts + targets for employment/unemployment.

The macro model’s numbers are anchored on the survey’s own baseline: a growth-rate shock becomes target = current_weighted_count * (1+rate), so only the macro model’s projected change is imposed — any level disagreement between the macro model’s employment stock and the weighted survey count (different definitions, reference periods) is deliberately not “corrected”, which would move thousands of people for purely statistical reasons.

Cells without a shock for a metric keep target = current: no shock, no artificial churn. Shock cells matching no data cell are reported as warnings (the macro model may cover regions the survey lacks).

euromod_linking.methods.lma_labour_alignment.targets.cell_report(cell_targets: pandas.DataFrame) list[dict][source]

Per-cell baseline, resolved target, implied change and feasibility.

The baseline is the number the alignment will actually move people away from, so a caller can check its own arithmetic against it before running: a growth rate derived from some other population count shows up here as a change that does not match what was asked for.

change is reported in people, in percent, and in percentage points of the participation and inactivity rates — the last of these is usually the unit the request was phrased in (“inactivity down 3.5pp”), even when the shock itself was expressed as a level.

Rates use the cell’s working-age population as denominator; it and the shielded other state are invariant under the alignment (only the inactive <-> active margin moves), so the rates are directly comparable before and after. inactivity_rate is the conventional complement of the participation rate — everyone of working age who is neither employed nor unemployed, students and pensioners included — which is wider than the inactive_recruitable pool the methodology is able to move.

euromod_linking.methods.lma_labour_alignment.targets.feasibility_warnings(report: list[dict]) list[str][source]

Warnings for cells whose shock consumes an implausible share of the pool.

Only the inactive state can be moved, so a target derived from a broader notion of inactivity (one counting students, pensioners or everyone without employment income) asks for people who are not there to be moved.

euromod_linking.methods.lma_labour_alignment.targets.totals(cell_targets: pandas.DataFrame, accuracy: list[dict] | None = None) dict[source]

Scenario-wide sums over the shocked cells (unshocked cells contribute 0).

euromod_linking.methods.lma_labour_alignment.targets.ALL_METRICS
euromod_linking.methods.lma_labour_alignment.targets.LEVEL_CURRENT
euromod_linking.methods.lma_labour_alignment.targets.MARGIN_OF
euromod_linking.methods.lma_labour_alignment.targets.POOL_WARN_PCT = 25.0
euromod_linking.methods.lma_labour_alignment.targets.RATE_METRICS
euromod_linking.methods.lma_labour_alignment.targets.RATE_NUMERATOR