diff --git a/changelog.d/nz-transport-graph.added.md b/changelog.d/nz-transport-graph.added.md new file mode 100644 index 0000000000..18b7e3b4ef --- /dev/null +++ b/changelog.d/nz-transport-graph.added.md @@ -0,0 +1 @@ +Declare NZ transport and entitlement branches with independent calibration variants and an identity-factor hold-fixed sensitivity. Add a synthetic replay fixture, exact export and gate contracts, and positive-payment comparator inputs. A `money.minor_units@1` node rounds each weekly benefit net half-even to whole cents before its gross-up, and `geography.person_location@1`, in its own module, carries assigned household region codes to persons. The reg 17 base rate runs as one engine counterfactual and the reg 18 cutout as one zero-solve per population. The graph gates the Accommodation Supplement payment on the engine's non-rate judgment, excludes and counts superannuitant units outside S5, and pays them in S5 from NZ Superannuation before tax. Keep the package inactive while engine pins and money quantile producers remain open. diff --git a/docs/transport-entitlement.md b/docs/transport-entitlement.md index 46f3387db2..0fbf6315b7 100644 --- a/docs/transport-entitlement.md +++ b/docs/transport-entitlement.md @@ -177,16 +177,33 @@ comparing it with the hold-out reference. The toy graph does this with its invented family-credit engine. It supplies no real WFF inputs or statutory claim. -The committed `build/nz/as_rate_bridge.json` sole-parent declaration rules out -a `solve_zero` recipe for golden-08: no engine input combination reproduces -the harness's single-with-children gross rate paired with the Income Test 3 -slope. It instead declares three evaluations, `gross_rate`, -`reduction_at_anchor` and `reduction_after_step`, whose outputs recover the -slope and lower threshold before assembling the cutout. The resource declares -the overrides, anchor, step, composition and refusal conditions. The driver -executes declared kernel calls but does not assemble this nonlinear -composition. The approved executable golden-08 case and evaluation assembly -therefore remain unresolved; no golden-08 result is claimed. +`build/nz/as_rate_bridge.json` declares both NZ bridge outputs as kernel +calls, with no new kernel. On each population that runs the Accommodation +Supplement engine, a `calibration.prepare@1` node writes the family masks the +equality-only bridge masks compare, a `simulate.counterfactual@1` node writes +the reg 18(3)(b) sole-parent Jobseeker Support rate, and a +`simulate.solve_zero@1` node writes the reg 18 cutout: the zero of each +unit's Jobseeker Support residual over weekly income on [0, 5000]. A sole +parent's residual is the sole-parent rate minus the Income Test 3 reduction; +every other unit's residual is its own net payment. The resource keeps the +harness expressions as the statement of equivalence. Each branch runs its own +reg 17 base-rate counterfactual: zero-income Jobseeker Support once for a +single unit and twice for a partnered one, plus the eldest-child family tax +credit over 52 for a unit with a dependent child. The tests in +`test_nz_as_bridge.py` reproduce golden-08's base rate and cutout with a +labelled fixture engine; no real-engine result is claimed. + +rulespec-nz's rounded Accommodation Supplement payment never reads the +module's non-rate entitlement judgment, so the NZ graph gates the payment in +the host. Each branch's `positive_payment` node (`calibration.prepare@1`) +holds where the payment exceeds zero and the judgment reads "holds" (code 1; +undetermined fails), and, in every branch but S5, where the unit's receipt +group is not superannuitant (MC11's exclude-and-count). A +`simulate.counterfactual@1` node then writes +`accommodation_supplement_entitled_weekly_payment`, the rounded payment +masked on that indicator, which the dollar comparator, the reporting cells +and the gates read. S5 instead pays superannuitant units from a reg 17 base +rate that takes NZ Superannuation before tax. The hub can compare approved small cases and sampled-unit outputs without donor H5 I/O using the declared case format in diff --git a/packages/microcosm-build/src/microcosm/build/calibration_predicates.py b/packages/microcosm-build/src/microcosm/build/calibration_predicates.py index a1f0d8f4f6..40c0ff0f0a 100644 --- a/packages/microcosm-build/src/microcosm/build/calibration_predicates.py +++ b/packages/microcosm-build/src/microcosm/build/calibration_predicates.py @@ -81,6 +81,8 @@ def predicate_mask( part = values.eq(value) elif operator == "ge": part = values.ge(value) + elif operator == "gt": + part = values.gt(value) elif operator == "lt": part = values.lt(value) elif operator == "in" and isinstance(value, (list, tuple)) and value: @@ -165,6 +167,8 @@ def _validate_input(values: pd.Series, domain: Mapping[str, Any], name: str) -> _finite_number(value) and value >= 0 and value == int(value) for value in values.tolist() ) + elif kind == "nonnegative_number": + valid = all(_finite_number(value) and value >= 0 for value in values.tolist()) else: allowed = domain["values"] valid = all( @@ -178,7 +182,12 @@ def _validate_input(values: pd.Series, domain: Mapping[str, Any], name: str) -> def _input_domain_kind(domain: Mapping[str, Any], name: str) -> str: """Share domain-schema validation between activation and table validation.""" kind = domain.get("kind") - if kind in ("identity", "signed_integer", "nonnegative_integer"): + if kind in ( + "identity", + "signed_integer", + "nonnegative_integer", + "nonnegative_number", + ): return kind if isinstance(domain.get("values"), (list, tuple)) and domain["values"]: return "values" diff --git a/packages/microcosm-build/src/microcosm/build/nz/as_encoding.json b/packages/microcosm-build/src/microcosm/build/nz/as_encoding.json new file mode 100644 index 0000000000..b11221bae1 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/as_encoding.json @@ -0,0 +1,6 @@ +{ + "rent_allocation": "reference_unit", + "asset_test": true, + "area_column": "as_area", + "rent_factor": 1 +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/as_rate_bridge.json b/packages/microcosm-build/src/microcosm/build/nz/as_rate_bridge.json index 567a4e119b..f278805131 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/as_rate_bridge.json +++ b/packages/microcosm-build/src/microcosm/build/nz/as_rate_bridge.json @@ -2,8 +2,8 @@ "version": 1, "country": "nz", "method_card_row": "MC11", - "description": "Host bridge for the two law-derived Accommodation Supplement inputs that rulespec-nz takes as inputs \"for later cross-module wiring\": the Social Security Regulations 2018 reg 17 base rate and the reg 18 non-beneficiary income cutout. Every rate is to come from an engine evaluation of a bound rulespec-nz module; this resource declares only which outputs combine, with which coefficients, under which input overrides. No bridge graph node exists yet (package G7). It ports the statutory branch (treasury_host_aligned false) of the axiom-oracles IncomeExplorer conformance harness. Under method card amendment MC11a, which is proposed (awaiting D1), it would be the one sanctioned exception to \"real Axiom runtime only\"; it needs Max's MC11 ruling. When rulespec-nz encodes regs 17 and 18 (6 Oct plan B13), this resource and the bridge graph nodes are to be deleted, and only the Accommodation Supplement branches will re-run.", - "status": "awaiting D1 (MC11; amendment MC11a proposed)", + "description": "Host bridge for the two law-derived Accommodation Supplement inputs that rulespec-nz takes as inputs \"for later cross-module wiring\": the Social Security Regulations 2018 reg 17 base rate and the reg 18 non-beneficiary income cutout. Every rate comes from an engine evaluation of a bound rulespec-nz module; this resource declares only which outputs combine, with which coefficients and masks, under which input overrides, and the cutout's zero-solve. It ports the statutory branch (treasury_host_aligned false) of the axiom-oracles IncomeExplorer conformance harness. Method card MC11 makes it the one sanctioned exception to \"real Axiom runtime only\". When rulespec-nz encodes regs 17 and 18 (6 Oct plan B13), this resource and the bridge graph nodes are to be deleted, and only the Accommodation Supplement branches will re-run.", + "status": "MC11 adopted (d1043). The graph executes both outputs through simulate.counterfactual@1 and simulate.solve_zero@1 with no new kernel.", "source": { "repository": "TheAxiomFoundation/ops", "path": "nz-lane/emtr_reproduction/run.py", @@ -28,93 +28,392 @@ "id": "reg17_base_rate", "target_input": "accommodation_supplement_base_rate_weekly_amount", "legal_basis": "Social Security Regulations 2018 reg 17", - "graph_node": "nz.as.bridge.base_rate", + "graph_node": "{branch}.bridge.base_rate", + "placement": "Each scenario and variant branch runs its own base-rate node on its own population, so the S5 alternative owns its column without a rewrite.", "method": "counterfactual_sum", - "terms": [ + "kernel": "simulate.counterfactual@1", + "primary_binding": "main_benefits_rates", + "components": [ { - "binding": "main_benefits_rates", - "variable": "jobseeker_support_net_weekly_payment", - "engine_entity": "Person", - "coefficient": 1, - "multiplier": "adults_in_couple", - "multiplier_rule": "1 for a single unit, 2 for a partnered unit: the harness repeats the per-person zero-income amount for each partner (run.py:2017-2024) and aggregates the components to the family (run.py:2545-2554)", + "binding": "family_tax_credits", "input_overrides": [ { - "variable": "jobseeker_support_applicant_age", - "value": 25, - "value_source": "harness_constant", - "reason": "harness constant for IncomeExplorer stylized adults (run.py:1941); open item: whether reg 17 uses each adult's own age-dependent rate is unresolved (reg 17 text not read in this lane)" - }, - { - "variable": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1942)" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "unit_attribute": "family.n_dependent_children", - "value_source": "unit", - "reason": "harness: family_shape dependent_child_count (run.py:1937,1943)" - }, - { - "variable": "jobseeker_support_living_with_parent", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1944)" - }, - { - "variable": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1945)" - }, - { - "variable": "jobseeker_support_partner_receives_main_benefit", - "unit_attribute": "family.is_partnered", - "value_source": "unit", - "reason": "harness: family_shape partner_present (run.py:1946)" - }, - { - "variable": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1947); superannuitant units follow superannuitant_units below" - }, - { - "variable": "jobseeker_support_single", - "unit_attribute": "family.is_single", - "value_source": "unit", - "reason": "harness: not partner_present (run.py:1948)" - }, - { - "variable": "jobseeker_support_transferred_2013_no_dependent_children", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1950)" - }, - { - "variable": "jobseeker_support_youngest_dependent_child_age", - "unit_attribute": "family.youngest_dependent_child_age", - "value_source": "unit", - "reason": "harness: family_shape youngest_child_age (run.py:1938,1951)" + "variable": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1, + "value_source": "bridge_point", + "reason": "one eldest-child care unit, so the prescribed amount equals family_tax_credit_eldest_child_annual_amount (the parameter the harness reads, run.py:1525-1527)" }, { - "variable": "jobseeker_support_total_income", + "variable": "family_tax_credit_subsequent_dependent_child_care_units", "value": 0, "value_source": "bridge_point", - "reason": "zero-income Jobseeker Support (run.py:2021)" + "reason": "no subsequent-child amount enters reg 17" } ] + } + ], + "input_overrides": [ + { + "variable": "jobseeker_support_applicant_age", + "value": 25, + "value_source": "harness_constant", + "reason": "harness constant for IncomeExplorer stylized adults (run.py:1941); open item: whether reg 17 uses each adult's own age-dependent rate is unresolved (reg 17 text not read in this lane)" + }, + { + "variable": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1942)" + }, + { + "variable": "jobseeker_support_dependent_children_count", + "unit_attribute": "family.n_dependent_children", + "value_source": "unit", + "reason": "harness: family_shape dependent_child_count (run.py:1937,1943)" + }, + { + "variable": "jobseeker_support_living_with_parent", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1944)" + }, + { + "variable": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1945)" + }, + { + "variable": "jobseeker_support_partner_receives_main_benefit", + "unit_attribute": "family.is_partnered", + "value_source": "unit", + "reason": "harness: family_shape partner_present (run.py:1946)" + }, + { + "variable": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1947); superannuitant units follow superannuitant_units below" + }, + { + "variable": "jobseeker_support_single", + "unit_attribute": "family.is_single", + "value_source": "unit", + "reason": "harness: not partner_present (run.py:1948)" + }, + { + "variable": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1950)" + }, + { + "variable": "jobseeker_support_youngest_dependent_child_age", + "unit_attribute": "family.youngest_dependent_child_age", + "value_source": "unit", + "reason": "harness: family_shape youngest_child_age (run.py:1938,1951). The unit column is null for a childless family, and the engine adapter reads integer inputs as int64, so the override applies only where the unit has a dependent child; other rows keep the closure default 0.", + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "variable": "jobseeker_support_total_income", + "value": 0, + "value_source": "bridge_point", + "reason": "zero-income Jobseeker Support (run.py:2021)" + } + ], + "terms": [ + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_net_weekly_payment", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 1, + "mask": { + "unit_attribute": "family.is_partnered", + "equals": false + }, + "rule": "a single unit takes the per-person zero-income amount once (run.py:2017-2024, 2545-2554)" + }, + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_net_weekly_payment", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 2, + "mask": { + "unit_attribute": "family.is_partnered", + "equals": true + }, + "rule": "a partnered unit takes it once for each partner (run.py:2017-2024, 2545-2554)" }, { "binding": "family_tax_credits", "variable": "family_tax_credit_prescribed_amount", "engine_entity": "Family", - "coefficient": 1, - "divisor": 52, - "applies_when": "family.n_dependent_children >= 1", - "divisor_rule": "reg 17 uses the annual eldest-child family tax credit divided by 52 (run.py:2556-2562); the harness's 365/7 divisor is a Treasury-host diagnostic only and is not used", + "coefficient": "1/52", + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_has_dependent_child", + "equals": true + }, + "rule": "reg 17 adds the annual eldest-child family tax credit divided by 52 for a unit with a dependent child (run.py:2556-2562); the harness's 365/7 divisor is a Treasury-host diagnostic only and is not used" + } + ], + "first_aggregation": "Every Jobseeker input takes a unit value or a constant, so all members of a unit agree and first, the lowest person id, is safe." + }, + { + "id": "reg18_cutout", + "target_input": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "legal_basis": "Social Security Regulations 2018 reg 18; reg 18(3)(b) for sole parents", + "graph_node": "{population}.bridge.cutout", + "placement": "The shared nz.as.bridge population, a FILTER branch of nz.as, runs the masks, the sole-parent gross rate and the cutout once for S0, S1, S2, S3 and S5; each variant repeats them on its own housing population.", + "method": "solve_zero", + "kernel": "simulate.solve_zero@1", + "gross_rate": { + "id": "sole_parent_gross_rate", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "binding": "main_benefits_rates", + "variable": "jobseeker_support_gross_weekly_rate", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 1, + "mask": { + "unit_attribute": "family.is_sole_parent", + "equals": true + }, + "rule": "The engine evaluates the single-with-dependent-children rate under these overrides on every row, and the node writes it for sole parents only; other units read zero.", + "input_overrides": [ + { + "variable": "jobseeker_support_single", + "value": true, + "value_source": "bridge_point", + "reason": "single applicant" + }, + { + "variable": "jobseeker_support_dependent_children_count", + "value": 1, + "value_source": "bridge_point", + "reason": "selects the with-dependent-children rate branch" + }, + { + "variable": "jobseeker_support_youngest_dependent_child_age", + "value": 0, + "value_source": "bridge_point", + "reason": "below the 14-year threshold, so the gross rate is jobseeker_support_single_with_dependent_children_weekly_rate" + }, + { + "variable": "jobseeker_support_total_income", + "value": 0, + "value_source": "bridge_point", + "reason": "the gross rate does not depend on income" + } + ] + }, + "solve": { + "binding": "main_benefits_rates", + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "iteration_check": "ldexp(5000, -43) is 5.7e-10, within the 1e-9 tolerance the kernel requires.", + "quantization": "none: the cutout stays a plain float64 input to the Accommodation Supplement engine", + "input_overrides": [ + { + "variable": "jobseeker_support_applicant_age", + "value": 25, + "value_source": "harness_constant", + "reason": "harness constant for IncomeExplorer stylized adults (run.py:1941); open item: whether reg 17 uses each adult's own age-dependent rate is unresolved (reg 17 text not read in this lane)" + }, + { + "variable": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1942)" + }, + { + "variable": "jobseeker_support_dependent_children_count", + "unit_attribute": "family.n_dependent_children", + "value_source": "unit", + "reason": "harness: family_shape dependent_child_count (run.py:1937,1943)" + }, + { + "variable": "jobseeker_support_living_with_parent", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1944)" + }, + { + "variable": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1945)" + }, + { + "variable": "jobseeker_support_partner_receives_main_benefit", + "unit_attribute": "family.is_partnered", + "value_source": "unit", + "reason": "harness: family_shape partner_present (run.py:1946)" + }, + { + "variable": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1947); superannuitant units follow superannuitant_units below" + }, + { + "variable": "jobseeker_support_single", + "unit_attribute": "family.accommodation_supplement_bridge_single_without_dependent_child", + "value_source": "unit", + "reason": "Holds for a single unit with no dependent child. On every unit except a sole parent it equals not partner_present (run.py:1948). A sole parent reads false, and with every partner flag false the reduction falls to its final else, Income Test 3, as reg 18(3)(b) requires." + }, + { + "variable": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false, + "value_source": "harness_constant", + "reason": "harness constant (run.py:1950)" + }, + { + "variable": "jobseeker_support_youngest_dependent_child_age", + "unit_attribute": "family.youngest_dependent_child_age", + "value_source": "unit", + "reason": "harness: family_shape youngest_child_age (run.py:1938,1951). The unit column is null for a childless family, and the engine adapter reads integer inputs as int64, so the override applies only where the unit has a dependent child; other rows keep the closure default 0.", + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "terms": [ + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_net_weekly_payment", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 1, + "mask": { + "unit_attribute": "family.is_sole_parent", + "equals": false + }, + "branch": "all_other_units" + }, + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_weekly_income_test_reduction", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": -1, + "mask": { + "unit_attribute": "family.is_sole_parent", + "equals": true + }, + "branch": "sole_parent" + }, + { + "source": "family.accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "branch": "sole_parent" + } + ] + }, + "branches": [ + { + "id": "sole_parent", + "applies_when": "family.is_sole_parent", + "residual": "sole-parent gross rate minus the Income Test 3 reduction at the trial income", + "legal_reading": "Reg 18(3)(b) sets the income level as the income that would prevent payment of Jobseeker Support at the sole-parent rate as if Income Test 3 applied to that rate instead of Income Test 1. That income is the zero of the sole-parent rate minus the Income Test 3 reduction.", + "harness_lines": "2491-2500", + "harness_expression": "main_benefit_income_test_lower_weekly_threshold + jobseeker_support_single_with_dependent_children_weekly_rate / main_benefit_income_test_3_abatement_rate", + "equivalence": "With reduction r(x) = max(0, x - L) * s, gross rate G > 0 and slope s > 0, the zero of G - r(x) is L + G / s, the harness expression." + }, + { + "id": "all_other_units", + "applies_when": "not family.is_sole_parent", + "residual": "the unit's own Jobseeker Support net payment at the trial income", + "harness_lines": "2501-2511", + "harness_expression": "500 + payment_at_anchor / (payment_at_anchor - payment_after_step), with the payment evaluated at weekly incomes 500 and 501", + "equivalence": "Income Tests 3 and 4 each have one rate, so the payment falls linearly to its zero and the harness's anchor extrapolation equals that zero. The solve also covers a zero anchor payment, where the extrapolation refuses; a positive residual at the bracket's upper end now refuses in place of the old slope check." + } + ] + } + ], + "mask_bindings": { + "schema_version": 1, + "required_inputs": { + "family": [ + "n_dependent_children", + "is_single" + ] + }, + "input_domains": { + "family": { + "n_dependent_children": { + "kind": "nonnegative_integer" + }, + "is_single": { + "values": [ + true, + false + ] + } + } + }, + "columns": [ + { + "entity": "family", + "name": "accommodation_supplement_bridge_has_dependent_child", + "predicates": [ + { + "column": "n_dependent_children", + "operator": "ge", + "value": 1 + } + ] + }, + { + "entity": "family", + "name": "accommodation_supplement_bridge_single_without_dependent_child", + "predicates": [ + { + "column": "is_single", + "operator": "eq", + "value": true + }, + { + "column": "n_dependent_children", + "operator": "eq", + "value": 0 + } + ] + } + ] + }, + "mask_note": "Kernel masks compare equality only, so one calibration.prepare@1 node per population writes these family booleans ahead of the bridge nodes.", + "superannuitant_units": { + "central": "exclude_and_count", + "central_rule": "Every branch but S5 adds receipt_group in [beneficiary, other] to the positive-payment conjunction (holdout_comparator_bindings.json central). That one predicate defines the excluded set, so the set equals the superannuitant receipt-group reporting cell by construction, and the cell diagnostics report its unit count.", + "schedule_5_input": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit stays defaulted: the engine's payment ignores it, so it cannot serve as the exclusion switch.", + "scenario_s5": "reg17_superannuitant_base_rate", + "s5_rule": "S5 drops the receipt-group clause from the positive-payment conjunction (holdout_comparator_bindings.json s5) and pays superannuitant units from s5_base_rate.", + "s5_base_rate": { + "id": "reg17_superannuitant_base_rate", + "target_input": "accommodation_supplement_base_rate_weekly_amount", + "legal_basis": "Social Security Regulations 2018 reg 17(2)(b) to (e)", + "graph_node": "nz.scn.S5.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "primary_binding": "main_benefits_rates", + "input_overrides": "reg17_base_rate", + "components": [ + { + "binding": "family_tax_credits", "input_overrides": [ { "variable": "family_tax_credit_eldest_dependent_child_care_units", @@ -129,296 +428,176 @@ "reason": "no subsequent-child amount enters reg 17" } ] + }, + { + "binding": "nz_super", + "input_overrides": [] } - ] + ], + "terms": [ + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_net_weekly_payment", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 1, + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_single_non_superannuitant", + "equals": true + }, + "rule": "a single unit outside the superannuitant group takes zero-income Jobseeker Support once, as in the central base rate" + }, + { + "binding": "main_benefits_rates", + "variable": "jobseeker_support_net_weekly_payment", + "engine_entity": "Person", + "aggregation": "first", + "coefficient": 2, + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_partnered_non_superannuitant", + "equals": true + }, + "rule": "a partnered unit outside the superannuitant group takes it once for each partner" + }, + { + "binding": "nz_super", + "variable": "nz_super_weekly_amount_before_tax", + "engine_entity": "Person", + "aggregation": "max", + "coefficient": 1, + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_single_superannuitant", + "equals": true + }, + "rule": "a single superannuitant unit takes the NZ Superannuation weekly amount before tax" + }, + { + "binding": "nz_super", + "variable": "nz_super_weekly_amount_before_tax", + "engine_entity": "Person", + "aggregation": "max", + "coefficient": 2, + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_partnered_superannuitant", + "equals": true + }, + "rule": "reg 17(2)(e) treats a partner as if a rate were paid, so a partnered superannuitant unit takes twice the larger member amount" + }, + { + "binding": "family_tax_credits", + "variable": "family_tax_credit_prescribed_amount", + "engine_entity": "Family", + "coefficient": "1/52", + "mask": { + "unit_attribute": "family.accommodation_supplement_bridge_has_dependent_child", + "equals": true + }, + "rule": "reg 17 adds the annual eldest-child family tax credit divided by 52 for a unit with a dependent child (run.py:2556-2562); the harness's 365/7 divisor is a Treasury-host diagnostic only and is not used" + } + ], + "before_tax_reading": "Before tax follows reg 17's \"before any abatement or deduction\" and the Schedule 1 rate the nz_super engine holds.", + "mixed_couple_simplification": "A partner on a main benefit takes the NZ Superannuation amount, not their own rate: max over members picks the superannuitant's amount for both partners.", + "receipt_group_order": "The S5 receipt_group node runs ahead of these masks, so the superannuitant group comes from the one assigned-member receipt predicate." }, - { - "id": "reg18_cutout", - "target_input": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", - "legal_basis": "Social Security Regulations 2018 reg 18", - "graph_node": "nz.as.bridge.cutout", - "method": "branched", - "branches": [ + "s5_mask_bindings": { + "schema_version": 1, + "required_inputs": { + "family": [ + "is_partnered", + "receipt_group" + ] + }, + "input_domains": { + "family": { + "is_partnered": { + "values": [ + true, + false + ] + }, + "receipt_group": { + "values": [ + "superannuitant", + "beneficiary", + "other" + ] + } + } + }, + "columns": [ { - "id": "sole_parent", - "applies_when": "family.is_sole_parent", - "harness_lines": "2491-2500", - "harness_expression": "main_benefit_income_test_lower_weekly_threshold + jobseeker_support_single_with_dependent_children_weekly_rate / main_benefit_income_test_3_abatement_rate", - "why_not_solve_zero": "The engine applies Income Test 1 (two-tier) to a single person with dependent children (rates.yaml jobseeker_support_weekly_income_test_reduction), while the harness pairs the single-with-children rate with the Income Test 3 slope. No input combination makes the engine evaluate that pair, so a zero-solve on the unit's own Jobseeker schedule would not reproduce golden-08. The three engine evaluations below recover the same three compiled quantities from derived outputs, with no parameter accessor.", - "evaluations": [ + "entity": "family", + "name": "accommodation_supplement_bridge_single_non_superannuitant", + "predicates": [ { - "id": "gross_rate", - "binding": "main_benefits_rates", - "variable": "jobseeker_support_gross_weekly_rate", - "engine_entity": "Person", - "input_overrides": [ - { - "variable": "jobseeker_support_single", - "value": true, - "value_source": "bridge_point", - "reason": "single applicant" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "value": 1, - "value_source": "bridge_point", - "reason": "selects the with-dependent-children rate branch" - }, - { - "variable": "jobseeker_support_youngest_dependent_child_age", - "value": 0, - "value_source": "bridge_point", - "reason": "below the 14-year threshold, so the gross rate is jobseeker_support_single_with_dependent_children_weekly_rate" - }, - { - "variable": "jobseeker_support_total_income", - "value": 0, - "value_source": "bridge_point", - "reason": "the gross rate does not depend on income" - } - ] + "column": "is_partnered", + "operator": "eq", + "value": false }, { - "id": "reduction_at_anchor", - "binding": "main_benefits_rates", - "variable": "jobseeker_support_weekly_income_test_reduction", - "engine_entity": "Person", - "input_overrides": [ - { - "variable": "jobseeker_support_single", - "value": true, - "value_source": "bridge_point", - "reason": "single applicant" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "value": 0, - "value_source": "bridge_point", - "reason": "with transferred_2013 false this selects Income Test 3" - }, - { - "variable": "jobseeker_support_transferred_2013_no_dependent_children", - "value": false, - "value_source": "bridge_point", - "reason": "Income Test 3 branch" - }, - { - "variable": "jobseeker_support_total_income", - "value": 500, - "value_source": "bridge_point", - "reason": "the harness anchor (run.py:2502); must exceed the lower threshold, else the bridge refuses" - } + "column": "receipt_group", + "operator": "in", + "value": [ + "beneficiary", + "other" ] + } + ] + }, + { + "entity": "family", + "name": "accommodation_supplement_bridge_partnered_non_superannuitant", + "predicates": [ + { + "column": "is_partnered", + "operator": "eq", + "value": true }, { - "id": "reduction_after_step", - "binding": "main_benefits_rates", - "variable": "jobseeker_support_weekly_income_test_reduction", - "engine_entity": "Person", - "input_overrides": [ - { - "variable": "jobseeker_support_single", - "value": true, - "value_source": "bridge_point", - "reason": "single applicant" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "value": 0, - "value_source": "bridge_point", - "reason": "Income Test 3 branch" - }, - { - "variable": "jobseeker_support_transferred_2013_no_dependent_children", - "value": false, - "value_source": "bridge_point", - "reason": "Income Test 3 branch" - }, - { - "variable": "jobseeker_support_total_income", - "value": 501, - "value_source": "bridge_point", - "reason": "anchor plus the harness's one-dollar step (run.py:2504)" - } + "column": "receipt_group", + "operator": "in", + "value": [ + "beneficiary", + "other" ] } - ], - "composition": { - "slope": "reduction_after_step - reduction_at_anchor (per dollar of weekly income)", - "lower_threshold": "500 - reduction_at_anchor / slope", - "cutout": "lower_threshold + gross_rate / slope", - "refuse_when": "reduction_at_anchor <= 0 or slope <= 0" - } + ] }, { - "id": "all_other_units", - "applies_when": "not family.is_sole_parent", - "harness_lines": "2501-2511", - "method": "anchor_extrapolation", - "evaluations": [ + "entity": "family", + "name": "accommodation_supplement_bridge_single_superannuitant", + "predicates": [ { - "id": "payment_at_anchor", - "binding": "main_benefits_rates", - "variable": "jobseeker_support_net_weekly_payment", - "engine_entity": "Person", - "input_overrides": [ - { - "variable": "jobseeker_support_applicant_age", - "value": 25, - "value_source": "harness_constant", - "reason": "harness constant for IncomeExplorer stylized adults (run.py:1941); open item: whether reg 17 uses each adult's own age-dependent rate is unresolved (reg 17 text not read in this lane)" - }, - { - "variable": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1942)" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "unit_attribute": "family.n_dependent_children", - "value_source": "unit", - "reason": "harness: family_shape dependent_child_count (run.py:1937,1943)" - }, - { - "variable": "jobseeker_support_living_with_parent", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1944)" - }, - { - "variable": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1945)" - }, - { - "variable": "jobseeker_support_partner_receives_main_benefit", - "unit_attribute": "family.is_partnered", - "value_source": "unit", - "reason": "harness: family_shape partner_present (run.py:1946)" - }, - { - "variable": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1947); superannuitant units follow superannuitant_units below" - }, - { - "variable": "jobseeker_support_single", - "unit_attribute": "family.is_single", - "value_source": "unit", - "reason": "harness: not partner_present (run.py:1948)" - }, - { - "variable": "jobseeker_support_transferred_2013_no_dependent_children", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1950)" - }, - { - "variable": "jobseeker_support_youngest_dependent_child_age", - "unit_attribute": "family.youngest_dependent_child_age", - "value_source": "unit", - "reason": "harness: family_shape youngest_child_age (run.py:1938,1951)" - }, - { - "variable": "jobseeker_support_total_income", - "value": 500, - "value_source": "bridge_point", - "reason": "the harness anchor (run.py:2502)" - } - ] + "column": "is_partnered", + "operator": "eq", + "value": false }, { - "id": "payment_after_step", - "binding": "main_benefits_rates", - "variable": "jobseeker_support_net_weekly_payment", - "engine_entity": "Person", - "input_overrides": [ - { - "variable": "jobseeker_support_applicant_age", - "value": 25, - "value_source": "harness_constant", - "reason": "harness constant for IncomeExplorer stylized adults (run.py:1941); open item: whether reg 17 uses each adult's own age-dependent rate is unresolved (reg 17 text not read in this lane)" - }, - { - "variable": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1942)" - }, - { - "variable": "jobseeker_support_dependent_children_count", - "unit_attribute": "family.n_dependent_children", - "value_source": "unit", - "reason": "harness: family_shape dependent_child_count (run.py:1937,1943)" - }, - { - "variable": "jobseeker_support_living_with_parent", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1944)" - }, - { - "variable": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1945)" - }, - { - "variable": "jobseeker_support_partner_receives_main_benefit", - "unit_attribute": "family.is_partnered", - "value_source": "unit", - "reason": "harness: family_shape partner_present (run.py:1946)" - }, - { - "variable": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1947); superannuitant units follow superannuitant_units below" - }, - { - "variable": "jobseeker_support_single", - "unit_attribute": "family.is_single", - "value_source": "unit", - "reason": "harness: not partner_present (run.py:1948)" - }, - { - "variable": "jobseeker_support_transferred_2013_no_dependent_children", - "value": false, - "value_source": "harness_constant", - "reason": "harness constant (run.py:1950)" - }, - { - "variable": "jobseeker_support_youngest_dependent_child_age", - "unit_attribute": "family.youngest_dependent_child_age", - "value_source": "unit", - "reason": "harness: family_shape youngest_child_age (run.py:1938,1951)" - }, - { - "variable": "jobseeker_support_total_income", - "value": 501, - "value_source": "bridge_point", - "reason": "anchor plus one dollar (run.py:2504)" - } - ] + "column": "receipt_group", + "operator": "eq", + "value": "superannuitant" } - ], - "composition": { - "reduction_per_dollar": "payment_at_anchor - payment_after_step", - "cutout": "500 + payment_at_anchor / reduction_per_dollar", - "refuse_when": "payment_at_anchor <= 0 or reduction_per_dollar <= 0" - }, - "exactness": "Reg 18 asks for the income that extinguishes Jobseeker Support (run.py:2513-2514). The extrapolation equals that zero when the net-payment schedule is linear between the anchor and its zero: Income Tests 3 and 4 have one rate (rates.yaml). Income Test 1 has two, but these overrides select it only for single units with children, which take the other branch." + ] + }, + { + "entity": "family", + "name": "accommodation_supplement_bridge_partnered_superannuitant", + "predicates": [ + { + "column": "is_partnered", + "operator": "eq", + "value": true + }, + { + "column": "receipt_group", + "operator": "eq", + "value": "superannuitant" + } + ] } ] - } - ], - "superannuitant_units": { - "central": "exclude_and_count", - "scenario_s5": "reg17_superannuitant_base_rate", - "status": "The harness has no NZ Superannuation or Veteran's Pension base-rate branch. G7 implements one from the reg 17 text if it can; otherwise the MC11 fallback stands: superannuitant units are excluded from the central run and counted. Scenario S5 carries the alternative. Awaiting D1 (MC11).", + }, + "status": "MC11 adopted (d1043): central runs exclude and count; S5 carries the reg 17 superannuitant base rate.", "predicate": { "resource": "reporting_classifiers", "path": [ @@ -433,7 +612,7 @@ }, "predicate_note": "MC11 exclude-and-count and reporting must select this one assigned-member receipt predicate. A bridge implementation must resolve the reference rather than infer superannuitants from entitlement or age." }, - "beneficiary_note": "The harness computes the base rate from zero-income Jobseeker Support for every scenario, beneficiary or not; accommodation_supplement_non_beneficiary itself comes from the receipt layer through the group encode, not from this bridge.", + "beneficiary_note": "The harness computes the base rate from zero-income Jobseeker Support for every scenario, beneficiary or not; accommodation_supplement_non_beneficiary itself comes from the receipt layer through the group encode, not from this bridge. Reg 17 for non-superannuitant beneficiaries stays as built; whether reg 17 uses each adult's own age-dependent rate remains open.", "differential_expectations": { "source": { "repository": "TheAxiomFoundation/axiom-oracles", diff --git a/packages/microcosm-build/src/microcosm/build/nz/axiom_input_closure.json b/packages/microcosm-build/src/microcosm/build/nz/axiom_input_closure.json index 66539ff10b..4e04375d1a 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/axiom_input_closure.json +++ b/packages/microcosm-build/src/microcosm/build/nz/axiom_input_closure.json @@ -1086,8 +1086,8 @@ "input": "accommodation_supplement_base_rate_weekly_amount", "class": "encoded", "encoded_by": "graph_node", - "node": "nz.as.bridge.base_rate", - "reason": "The reg 17 base rate, computed by the engine-calling bridge node from the main-benefit and family tax credit modules (method card MC11, amendment MC11a; the one sanctioned exception to real-Axiom-only runtime until rulespec-nz encodes reg 17, work package B13). Unit construction and group encoding never compute it." + "node": "nz.scn.S0.bridge.base_rate", + "reason": "The reg 17 base rate. Each scenario and variant branch runs its own simulate.counterfactual@1 base-rate node (nz.scn.S0.bridge.base_rate for the central run) over the main-benefit and family tax credit modules, under method card MC11, the one sanctioned exception to real-Axiom-only runtime until rulespec-nz encodes reg 17 (work package B13). Unit construction and group encoding never compute it." }, { "rulespec_path": "nz/statutes/social_security/accommodation_supplement/core.yaml", @@ -1211,7 +1211,7 @@ "class": "encoded", "encoded_by": "graph_node", "node": "nz.as.bridge.cutout", - "reason": "The reg 18 non-beneficiary income cutout, computed by the engine-calling bridge node (method card MC11, amendment MC11a; deleted when B13 encodes reg 18). Unit construction and group encoding never compute it." + "reason": "The reg 18 non-beneficiary income cutout. A simulate.solve_zero@1 node finds the income that extinguishes Jobseeker Support, with Income Test 3 for sole parents under reg 18(3)(b); nz.as.bridge.cutout serves the entitlement scenarios and each variant runs its own (method card MC11; deleted when B13 encodes reg 18). Unit construction and group encoding never compute it." }, { "rulespec_path": "nz/statutes/social_security/accommodation_supplement/core.yaml", @@ -1301,10 +1301,10 @@ "household.as_area" ], "test": "equals", - "value": 1, + "value": "1", "group_rule": "household_value", "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_resides_in_area_1", - "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 1. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area." + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 1. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area. The geography kernel carries area codes as text; this predicate compares the same text code." }, "reason": "Model state, not a concept: see the state binding's note." }, @@ -1321,10 +1321,10 @@ "household.as_area" ], "test": "equals", - "value": 2, + "value": "2", "group_rule": "household_value", "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_resides_in_area_2", - "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 2. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area." + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 2. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area. The geography kernel carries area codes as text; this predicate compares the same text code." }, "reason": "Model state, not a concept: see the state binding's note." }, @@ -1341,10 +1341,10 @@ "household.as_area" ], "test": "equals", - "value": 3, + "value": "3", "group_rule": "household_value", "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_resides_in_area_3", - "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 3. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area." + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which picks the area's maximum weekly rate; a family in none of areas 1 to 3 takes the area 4 rates. Read from the household's assigned Accommodation Supplement area (household.as_area, 1 to 4) equal to 3. The area is model state: the geography nodes assign it to the household from the territorial-authority-to-area crosswalk with population split shares (method card MC9), not from an address, so every family in a household shares the household's area. The geography kernel carries area codes as text; this predicate compares the same text code." }, "reason": "Model state, not a concept: see the state binding's note." }, diff --git a/packages/microcosm-build/src/microcosm/build/nz/benefit_gross_up.json b/packages/microcosm-build/src/microcosm/build/nz/benefit_gross_up.json index 825b6fbfb6..56bcfa5ee3 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/benefit_gross_up.json +++ b/packages/microcosm-build/src/microcosm/build/nz/benefit_gross_up.json @@ -2,8 +2,9 @@ "schema_version": 1, "country": "nz", "generator": "tools/build_nz_benefit_gross_up.py", - "status": "reusable graph declarations; packaged transport graph wiring remains pending", + "status": "The central branch and each calibration variant run these reusable declarations after their own money normalization.", "disclosure": "Annualised Schedule 1, before credits, 52-week benefit gross-up, each benefit inverted independently of other income.", + "net_rounding": "MSD pays whole cents, so a money.minor_units@1 node rounds each weekly net payment half-even to cents before its gross-up, and each solve reads those cents with coefficient 0.52, which turns weekly cents into annual dollars over 52 weeks.", "monotonicity": "For the pinned Schedule 1, every marginal tax rate falls below one; 52*n + T(G) - G decreases or stays constant as each person's own G increases.", "authoritative_value": "money.minor_units@1 recovers annual integer cents exactly from certified float64 quantum multiples and preserves the bridge's float64 output contract.", "certificate_contract": "certificate_margin bounds the absolute difference between each computed residual and the exact residual of the declared terms at every evaluated point. Boundary residuals must exceed the margin in magnitude; ambiguous boundaries refuse, and the residual bound includes the margin. A zero margin asserts exact outputs and permits half-even ties.", @@ -18,7 +19,7 @@ { "id": "nz.benefits.rates", "kernel": "simulate.rules_by_ref@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "rules_binding": "main_benefits_rates", "inputs": [ @@ -81,16 +82,60 @@ ] } }, + { + "id": "nz.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, { "id": "nz.gross_up.jobseeker_support", "kernel": "simulate.solve_zero@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { "entity": "person", "columns": [ - "jobseeker_support_net_weekly_payment" + "jobseeker_support_net_weekly_payment_cents" ] } ], @@ -114,7 +159,7 @@ "individual_income_tax_before_credits" ], "input_overrides": "[]", - "output_coefficients": "[{\"coefficient\":52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", "bracket": [ 0, @@ -132,13 +177,13 @@ { "id": "nz.gross_up.sole_parent_support", "kernel": "simulate.solve_zero@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { "entity": "person", "columns": [ - "sole_parent_support_net_weekly_payment" + "sole_parent_support_net_weekly_payment_cents" ] } ], @@ -162,7 +207,7 @@ "individual_income_tax_before_credits" ], "input_overrides": "[]", - "output_coefficients": "[{\"coefficient\":52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", "bracket": [ 0, @@ -180,13 +225,13 @@ { "id": "nz.gross_up.supported_living_payment", "kernel": "simulate.solve_zero@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { "entity": "person", "columns": [ - "supported_living_payment_net_weekly_payment" + "supported_living_payment_net_weekly_payment_cents" ] } ], @@ -210,7 +255,7 @@ "individual_income_tax_before_credits" ], "input_overrides": "[]", - "output_coefficients": "[{\"coefficient\":52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", "bracket": [ 0, @@ -228,7 +273,7 @@ { "id": "nz.gross_up.annual_cents", "kernel": "money.minor_units@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { @@ -272,7 +317,7 @@ { "id": "nz.gross_up.super_cents", "kernel": "money.minor_units@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { @@ -296,7 +341,7 @@ { "id": "nz.benefits.annual_transfers", "kernel": "money.annual_transfers@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [ { diff --git a/packages/microcosm-build/src/microcosm/build/nz/concept_mapping.json b/packages/microcosm-build/src/microcosm/build/nz/concept_mapping.json new file mode 100644 index 0000000000..5ae43f6954 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/concept_mapping.json @@ -0,0 +1,1506 @@ +{ + "bindings": [ + { + "canonical_input": "nz:regulations/acc/earners_levy#input.acc_earnings_for_earners_levy", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income" + ], + "engine_entity": "Person", + "engine_input": "acc_earnings_for_earners_levy", + "module": "nz/regulations/acc/earners_levy.yaml", + "note": "Consumed in nz/regulations/acc/earners_levy.yaml by acc_standard_earners_levy_excluding_gst (source: Accident Compensation (Earners' Levy) Regulations 2025 regs 4, 5 and 8): 'min(max(0, acc_earnings_for_earners_levy), acc_earners_levy_maximum_earnings) * acc_earners_levy_rate_excluding_gst', and by acc_standard_earners_levy_including_gst (IRD PAYE-facing rate, rounded to cents). The module's test standard_negative_earnings feeds -100 and expects a nil levy, so the input admits a net loss. Read here as annual gross employee wages plus net non-farm and farm self-employment profit. Differences: the input is 'earnings' in the Accident Compensation Act sense (the definition is not in this module), a legal quantity; the concept's gross wages (with tips, bonuses, commissions) may not match the Act's earnings items; shareholder-employee earnings are not separated in the concepts; and this sum nets a self-employment loss against wages before the rule clamps at zero, which the module does not say the Act does. Both annual.", + "relation": "approximate", + "transform": { + "kind": "sum" + } + }, + { + "canonical_input": "nz:regulations/acc/earners_levy#input.acc_employee_earnings_for_low_self_employed_formula", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "acc_employee_earnings_for_low_self_employed_formula", + "module": "nz/regulations/acc/earners_levy.yaml", + "note": "Consumed in nz/regulations/acc/earners_levy.yaml by acc_low_self_employed_minimum_levy_excluding_gst (source: Accident Compensation (Earners' Levy) Regulations 2025 reg 6): 'if acc_self_employed_more_than_30_hours_per_week and acc_self_employed_earnings_for_earners_levy < acc_low_self_employed_minimum_earnings: acc_earners_levy_rate_excluding_gst * max(0, acc_low_self_employed_minimum_earnings - acc_employee_earnings_for_low_self_employed_formula)'. Read as the person's annual gross wages and salaries. Differences: the input is employee earnings as the Accident Compensation Act defines them (not in this module); the concept is the survey's gross employee cash income. Both annual. The gating flag (self-employed more than 30 hours a week) stays uncovered, so this binding only matters once it is set.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:regulations/acc/earners_levy#input.acc_self_employed_earnings_for_earners_levy", + "concepts": [ + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income" + ], + "engine_entity": "Person", + "engine_input": "acc_self_employed_earnings_for_earners_levy", + "module": "nz/regulations/acc/earners_levy.yaml", + "note": "Consumed in nz/regulations/acc/earners_levy.yaml by acc_low_self_employed_minimum_levy_excluding_gst (source: Accident Compensation (Earners' Levy) Regulations 2025 reg 6), which applies the minimum-earnings formula when 'acc_self_employed_earnings_for_earners_levy < acc_low_self_employed_minimum_earnings' for a person self-employed more than 30 hours a week. Read as annual net non-farm plus farm self-employment profit. Differences: the input is self-employed earnings as the Accident Compensation Act defines them (not in this module), a legal quantity; shareholder-employee earnings are not identifiable in the concepts and are not included. Both annual; the concepts are signed and the rule compares the value as given.", + "relation": "approximate", + "transform": { + "kind": "sum" + } + }, + { + "canonical_input": "nz:regulations/health_entitlement_cards/community_services_card/core#input.community_services_card_dependent_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "community_services_card_dependent_children_count", + "module": "nz/regulations/health_entitlement_cards/community_services_card/core.yaml", + "note": "Consumed in nz/regulations/health_entitlement_cards/community_services_card/core.yaml by community_services_card_family_group_for_dependent_child_threshold (source: Health Entitlement Cards Regulations 1993 reg 8(7)): '... and community_services_card_dependent_children_count >= 1', and by community_services_card_no_dependent_children_income_route (reg 8(1)(d)): 'community_services_card_dependent_children_count == 0 and ...'. Read as the number of co-resident persons aged 17 or under who name this person as a parent (birth, adoptive or step). Differences: the regulations' dependent-child definition is not in this module and the 17 cut is this mapping's assumption; a partner's child not recorded as this person's stepchild, and a non-parent caregiver's child, are missed.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:regulations/health_entitlement_cards/community_services_card/core#input.community_services_card_person_age_years", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "community_services_card_person_age_years", + "module": "nz/regulations/health_entitlement_cards/community_services_card/core.yaml", + "note": "Consumed in nz/regulations/health_entitlement_cards/community_services_card/core.yaml by community_services_card_no_dependent_children_income_route (source: Health Entitlement Cards Regulations 1993 reg 8(1)(d)): '... and community_services_card_person_age_years >= community_services_card_minimum_age_without_dependent_children and ...'. The person's own age in years. Differences: completed years at the survey reference date versus age when the card's eligibility is assessed (the module evaluates by year and states no date).", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:regulations/health_entitlement_cards/community_services_card/core#input.community_services_card_person_married_or_partnered", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "community_services_card_person_married_or_partnered", + "module": "nz/regulations/health_entitlement_cards/community_services_card/core.yaml", + "note": "Consumed in nz/regulations/health_entitlement_cards/community_services_card/core.yaml by community_services_card_family_income_limit (source: Health Entitlement Cards Regulations 1993 reg 8(5)) and community_services_card_superannuation_income_limit (reg 8(5A)): 'if community_services_card_person_married_or_partnered: else: '. Read as having a co-resident spouse, civil partner or cohabiting partner. Differences: the regulations' test for married or partnered is not in this module; the concept is co-residence based, so a married person whose spouse lives elsewhere reads as unpartnered, and a cohabitation the regulations would not count is counted.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:regulations/health_entitlement_cards/community_services_card/core#input.community_services_card_student_in_recognised_full_time_tertiary_course", + "concepts": [ + "fact:person.education_enrollment", + "fact:person.enrolled_full_time" + ], + "engine_entity": "Person", + "engine_input": "community_services_card_student_in_recognised_full_time_tertiary_course", + "module": "nz/regulations/health_entitlement_cards/community_services_card/core.yaml", + "note": "Consumed in nz/regulations/health_entitlement_cards/community_services_card/core.yaml by community_services_card_student_route (source: Health Entitlement Cards Regulations 1993 reg 8(1)(f)): 'community_services_card_student_in_recognised_full_time_tertiary_course and community_services_card_ordinarily_resident_in_new_zealand and community_services_card_family_income_under_limit'. Read as enrolled full time in an ISCED 5-8 programme. Differences: the input requires a course that is recognised under the regulations (not defined in this module) and full time on that course's legal measure; the concept's full-time flag follows the programme's own definition and its tertiary band covers every ISCED 5-8 programme.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:person.education_enrollment", + [ + "tertiary" + ] + ], + [ + "fact:person.enrolled_full_time", + [ + true + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:regulations/social_security/childcare_assistance/core#input.childcare_assistance_dependent_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "childcare_assistance_dependent_children_count", + "module": "nz/regulations/social_security/childcare_assistance/core.yaml", + "note": "Consumed in nz/regulations/social_security/childcare_assistance/core.yaml by childcare_assistance_schedule_2_hourly_rate_before_fee_cap (source: Social Security Regulations 2018 Schedule 2): 'if childcare_assistance_dependent_children_count <= 1: ... else: if childcare_assistance_dependent_children_count == 2: ... else: ' selects which set of income thresholds, compared with childcare_assistance_household_income_before_tax, fixes the hourly rate. The row is the caregiver (the module summary: s 77 gives assistance to a principal caregiver); read as the number of co-resident persons aged 17 or under who name this person as a parent (birth, adoptive or step). Differences: 'dependent child' is defined outside this module and the 17 cut is this mapping's assumption; children in the caregiver's care who do not name them as a parent (grandchildren, foster children, a partner's children not recorded as step) are missed.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:regulations/student_allowances/core#input.student_allowance_has_children", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "student_allowance_has_children", + "module": "nz/regulations/student_allowances/core.yaml", + "note": "nz/regulations/student_allowances/core.yaml rules student_allowance_has_recognised_partner (Student Allowances Regulations 1998 reg 2: '... or student_allowance_has_children'), student_allowance_weekly_gross_allowance (Schedule 2: 'if student_allowance_has_children: student_allowance_students_with_children_gross'); rate excerpts read 'the student has 1 or more supported children'. Difference: the regulations' 'supported child' definition is not encoded in the module; max_child_age 17 is this mapping's reading, and supported children with no parent pointer to the student are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:regulations/student_allowances/core#input.student_allowance_has_partner", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "student_allowance_has_partner", + "module": "nz/regulations/student_allowances/core.yaml", + "note": "nz/regulations/student_allowances/core.yaml rule student_allowance_has_recognised_partner (Student Allowances Regulations 1998 reg 2): 'if student_allowance_has_partner and ((student_allowance_student_age >= student_allowance_partner_age_threshold and student_allowance_partner_age >= student_allowance_partner_age_threshold) or student_allowance_has_children): 1'. Difference: the regulations recognise a spouse or partner who lives apart (Schedule 2 has a rate for a student 'not living in the same home as their spouse or partner'); has_partner sees only a co-resident partner, and a survey cohabitant may not meet the regulations' partner definition.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:regulations/student_allowances/core#input.student_allowance_lives_with_partner", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "student_allowance_lives_with_partner", + "module": "nz/regulations/student_allowances/core.yaml", + "note": "nz/regulations/student_allowances/core.yaml rule student_allowance_lives_at_home (Student Allowances Regulations 1998 reg 2 and Schedule 2 clause 2): 'if student_allowance_has_recognised_partner > 0: if student_allowance_lives_with_partner: 1 else: 0'; rate excerpt 'is living in the same home as their spouse or partner'. The rule reads it only for a recognised partner, where a co-resident partner pointer is the same fact. Difference: the partner pointer is the survey's partner, which may not be the regulations' spouse or partner.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:regulations/student_allowances/core#input.student_allowance_student_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "student_allowance_student_age", + "module": "nz/regulations/student_allowances/core.yaml", + "note": "nz/regulations/student_allowances/core.yaml rules student_allowance_has_recognised_partner (reg 2: 'student_allowance_student_age >= student_allowance_partner_age_threshold', 24), student_allowance_single_student_no_children_gross and student_allowance_weekly_allowance (Schedule 2: 'student_allowance_student_age < student_allowance_rate_band_age_threshold', 24). Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/income_tax/core/taxable_income#input.income_tax_activity_income", + "concepts": [ + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income" + ], + "engine_entity": "Person", + "engine_input": "income_tax_activity_income", + "module": "nz/statutes/income_tax/core/taxable_income.yaml", + "note": "Read by income_tax_activity_income_included (source 'Income Tax Act 2007 s MB 3; shared income-interface bridge for business and self-employment activity income'): 'max(0, income_tax_activity_income - income_tax_activity_deductions)'. The result is summed into income_tax_shared_income_bridge_total with the employment and schedular bridges. The input is gross activity income, with deductions in a separate input. The concepts are net non-farm and farm self-employment profit, so income_tax_activity_deductions stays uncovered (zero), and a net loss floors at zero instead of offsetting other income. Survey profit is not income as the Act measures it. Both sides are annual.", + "relation": "approximate", + "transform": { + "kind": "sum" + } + }, + { + "canonical_input": "nz:statutes/income_tax/core/taxable_income#input.income_tax_employment_income", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "income_tax_employment_income", + "module": "nz/statutes/income_tax/core/taxable_income.yaml", + "note": "Read by income_tax_employment_income_included (source 'Income Tax Act 2007 s CE 1; shared income-interface bridge for employment, salary, and wage income'): 'max(0, income_tax_employment_income - income_tax_employment_deductions)'. The result is summed into income_tax_shared_income_bridge_total. The input is employment income as s CE 1 defines it. The concept is survey gross wages and salaries from all employee jobs, including overtime, tips, bonuses and commissions, and excluding benefits in kind and employer contributions. Anything s CE 1 counts beyond cash wages is missed. Both sides are annual.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/income_tax/credits/individual_credits#input.charitable_or_public_benefit_gift_refund_application_made", + "concepts": [ + "fact:person.take_up_seed" + ], + "engine_entity": "Person", + "engine_input": "charitable_or_public_benefit_gift_refund_application_made", + "module": "nz/statutes/income_tax/credits/individual_credits.yaml", + "note": "Consumed in nz/statutes/income_tax/credits/individual_credits.yaml by charitable_or_public_benefit_gift_section_41a_refund_requirements (source: Tax Administration Act 1994 s 41A), whose formula includes 'and charitable_or_public_benefit_gift_refund_application_made'. A claiming decision, drawn like policyengine-us's would_file_if_eligible_for_refundable_credit (TakeUpThreshold us.refundable_credit_filing): true when the person's nz.donation_tax_credit draw from the persistent seed falls below a claim rate supplied at encode time. Differences: the value is imputed and independent of whether the person gave anything. The credit still needs the gift amounts and the other s 41A inputs (application in time, information provided, LD 1 requirements met), which stay uncovered, so this binding alone changes no credit.", + "relation": "approximate", + "transform": { + "kind": "take_up_threshold", + "program": "nz.donation_tax_credit" + } + }, + { + "canonical_input": "nz:statutes/income_tax/credits/individual_credits#input.independent_earner_tax_credit_receives_new_zealand_superannuation", + "concepts": [ + "fact:person.public_pension_income" + ], + "engine_entity": "Person", + "engine_input": "independent_earner_tax_credit_receives_new_zealand_superannuation", + "module": "nz/statutes/income_tax/credits/individual_credits.yaml", + "note": "Consumed in nz/statutes/income_tax/credits/individual_credits.yaml by independent_earner_tax_credit_status_requirement (source: Income Tax Act 2007 s LC 13(1)), whose formula includes 'and not independent_earner_tax_credit_receives_new_zealand_superannuation'; independent_earner_tax_credit is zero when that requirement fails. Read as positive(public_pension_income); the concept's definition names NZ Superannuation. Differences: other old-age pensions the concept holds also set the flag, such as an overseas state pension, or a Veteran's Pension recorded as a public pension (the rule tests Veteran's Pension through its own input). LC 13 tests receipt within a credit period, while the concept counts receipt at any time in the year, and this Year-period rule then zeroes the whole year's credit rather than only the months of receipt. Transport drops the concept, so the binding executes only on frames built from NZ's own data.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/income_tax/credits/individual_credits#input.payroll_donation_person_is_employee", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "payroll_donation_person_is_employee", + "module": "nz/statutes/income_tax/credits/individual_credits.yaml", + "note": "nz/statutes/income_tax/credits/individual_credits.yaml rule payroll_donation_credit_qualifies (Income Tax Act 2007 ss LD 4(1) and LD 8): 'payroll_donation_person_is_employee and payroll_donation_employer_files_employment_income_information_electronically and payroll_donation_employer_offers_payroll_giving and ...'. Difference: positive employee wages at any time in the reference year stands in for being an employee in the pay period the donation is made from.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/income_tax/family_scheme/eligibility#input.in_work_tax_credit_person_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Family", + "engine_input": "in_work_tax_credit_person_age", + "group_rule": "reference_member", + "module": "nz/statutes/income_tax/family_scheme/eligibility.yaml", + "note": "Read by in_work_tax_credit_age_requirement (source 'Income Tax Act 2007 s MD 5'): 'in_work_tax_credit_person_age >= wff_minimum_age' (16, ss MC 3 and MD 5). The input is the claimant's age, held on the Family entity. The binding takes the Family reference member's age in completed years at the survey reference date. The claimant need not be the reference member, and the dates differ.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/income_tax/family_scheme/eligibility#input.wff_dependent_children_principal_caregiver_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Family", + "engine_input": "wff_dependent_children_principal_caregiver_count", + "group_rule": "reference_member", + "module": "nz/statutes/income_tax/family_scheme/eligibility.yaml", + "note": "nz/statutes/income_tax/family_scheme/eligibility.yaml rule wff_principal_care_requirement (Income Tax Act 2007 s MC 4): 'wff_dependent_children_principal_caregiver_count >= 1' (test values 1 and 2); the module reads the count nowhere else. Group rule reference_member: counts co-resident persons aged 17 or under who name the Family's principal member as a parent (birth, adoptive or step). Difference: principal caregiver is a Commissioner determination (s MC 10; the separate input wff_commissioner_considers_primary_day_to_day_care). Children with no parent pointer to the principal member are missed, so a Family whose principal member is not recorded as the children's parent (for example a step-parent without a step-parent pointer while the partner is the recorded parent) counts zero and fails s MC 4. max_age 17 is this mapping's reading of 'dependent child', and the module handles an 18-year-old in school separately (s MC 9(1), wff_credit_child_school_tertiary_age = 18), which this count leaves out.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:statutes/income_tax/family_scheme/eligibility#input.wff_person_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Family", + "engine_input": "wff_person_age", + "group_rule": "reference_member", + "module": "nz/statutes/income_tax/family_scheme/eligibility.yaml", + "note": "nz/statutes/income_tax/family_scheme/eligibility.yaml rule wff_person_age_requirement (Income Tax Act 2007 s MC 3): 'wff_person_age >= wff_minimum_age', parameter 16. Group rule reference_member: the Family's principal member stands in for 'the person' claiming, whom the concepts do not identify. Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/income_tax/family_scheme/family_scheme_income#input.family_scheme_activity_income", + "concepts": [ + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income" + ], + "engine_entity": "Family", + "engine_input": "family_scheme_activity_income", + "group_rule": "sum_over_members", + "module": "nz/statutes/income_tax/family_scheme/family_scheme_income.yaml", + "note": "Read by family_scheme_activity_income_included (source 'Income Tax Act 2007 s MB 3(2)'): 'max(0, family_scheme_activity_income - family_scheme_activity_deductions)'. family_scheme_income_before_period_adjustment (ss MB 1 and MB 3 to MB 13) adds the result to family_scheme_base_income_excluding_mb3_to_mb13_adjustments. The input is gross income from an activity, with its deductions in a separate input. The concepts are net non-farm and farm self-employment profit, so family_scheme_activity_deductions stays uncovered (zero) and the rule's floor at zero drops a net loss. Members' profits are summed onto the Family entity. Because signed profits are summed across members and across farm and non-farm activity before the rule's single zero floor, one member's or one activity's loss offsets another's profit, which the Family-level input cannot separate. The module does not say whether its Family-level amount is one person's or a couple's family scheme income. A dependent child's profit would also be summed here, although the module handles dependent-child income separately (MB 11). Survey profit is not activity income as the Act measures it.", + "relation": "approximate", + "transform": { + "kind": "sum" + } + }, + { + "canonical_input": "nz:statutes/income_tax/family_scheme/tax_credits#input.in_work_tax_credit_allowed_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Family", + "engine_input": "in_work_tax_credit_allowed_children_count", + "group_rule": "reference_member", + "module": "nz/statutes/income_tax/family_scheme/tax_credits.yaml", + "note": "Read by in_work_tax_credit_relevant_children (source 'Income Tax Act 2007 s MD 10(3)(c)'): 'max(wff_in_work_tax_credit_minimum_children_for_base_amount, max(0, in_work_tax_credit_allowed_children_count))', where the minimum is 3. This scales in_work_tax_credit_before_abatement (s MD 10(2)) only when the uncovered input entitled_to_in_work_tax_credit is true. The module's test pairs a count of 2 with one eldest and one subsequent family-tax-credit child. The binding takes the Family reference member's count of co-resident persons aged 17 or under who name them as a parent. Differences: eligibility.yaml tests children through principal-caregiver and financial-dependency predicates (in_work_tax_credit_principal_caregiver, in_work_tax_credit_child_financially_dependent) that the concepts cannot evaluate. It also carries an MC 9(1) age parameter of 18 (wff_credit_child_school_tertiary_age) that the age-17 cut-off ignores. A reference member who is not the children's named parent counts zero.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:statutes/income_tax/familyboost_tax_credit/core#input.has_relationship_partner", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "has_relationship_partner", + "module": "nz/statutes/income_tax/familyboost_tax_credit/core.yaml", + "note": "Read by fb_entitled (source 'Income Tax Act 2007 ss MH 3(1), MH 3(6)-(7)'): 'not (has_relationship_partner and not separated_with_no_partner_at_quarter_end and relationship_partner_is_couples_claimant_for_quarter)'. Also read by fb_tax_credit_income (s MH 4(7)-(8)): 'if has_relationship_partner and not separated_with_no_partner_at_quarter_end: partner_tax_credit_income_for_quarter'. The input is the Act's relationship-partner status for a tax credit quarter. The concept flags a co-resident spouse, civil partner or cohabiting partner at one survey reference date. It misses a partner the Act would count who lives elsewhere, and it cannot see changes within the quarter.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:statutes/income_tax/withholding/resident_withholding_tax#input.rwt_gross_interest_and_dividends", + "concepts": [ + "fact:person.interest_income", + "fact:person.dividend_income" + ], + "engine_entity": "Person", + "engine_input": "rwt_gross_interest_and_dividends", + "module": "nz/statutes/income_tax/withholding/resident_withholding_tax.yaml", + "note": "nz/statutes/income_tax/withholding/resident_withholding_tax.yaml rule rwt_withholding_amount (Income Tax Act 2007 subpart RE, cited at s RE 12): 'max(0, rwt_gross_interest_and_dividends) * rwt_applicable_rate', rule period Year; module summary 'resident withholding tax rates applied to interest and dividends for New Zealand residents'. Difference: the input is the interest and dividends RWT is withheld from, which the module does not define further; the survey totals (gross of tax withheld) can include amounts outside NZ withholding, such as foreign-paid interest or dividends, and any dividend-specific withholding adjustments are not encoded here.", + "relation": "approximate", + "transform": { + "kind": "sum" + } + }, + { + "canonical_input": "nz:statutes/kiwisaver/contributions#input.kiwisaver_gross_salary_or_wages", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "kiwisaver_gross_salary_or_wages", + "module": "nz/statutes/kiwisaver/contributions.yaml", + "note": "Read by kiwisaver_employee_deduction (source 'KiwiSaver Act 2006 s 64; Inland Revenue KiwiSaver contribution guidance'): 'max(0, kiwisaver_gross_salary_or_wages) * kiwisaver_selected_employee_contribution_rate'. Also read by kiwisaver_minimum_employer_contribution ('KiwiSaver Act 2006 s 101B'): 'max(0, kiwisaver_gross_salary_or_wages) * kiwisaver_employer_minimum_contribution_rate'. The input is the gross salary or wages that KiwiSaver contributions are taken from. The concept is survey gross wages and salaries from all employee jobs, including tips and bonuses and excluding benefits in kind. Neither rule reads KiwiSaver membership, so the employer contribution is computed on every employee's wages. The employee rate is an election and stays uncovered. Both sides are annual.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/core#input.nz_super_person_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "nz_super_person_age", + "module": "nz/statutes/new_zealand_superannuation/core.yaml", + "note": "nz/statutes/new_zealand_superannuation/core.yaml rule nz_super_age_requirement (NZ Superannuation and Retirement Income Act 2001 s 7): 'nz_super_person_age >= nz_super_age_threshold and not nz_super_elected_weekly_compensation_instead_of_superannuation', threshold parameter 65. Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/core#input.nz_super_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "nz_super_single", + "module": "nz/statutes/new_zealand_superannuation/core.yaml", + "note": "nz/statutes/new_zealand_superannuation/core.yaml rules nz_super_living_alone (s 4A: 'nz_super_single and nz_super_principal_residence_is_qualifying_accommodation and ...') and nz_super_ordinary_weekly_rate_before_tax (s 12 and Schedule 1 Part 1 clause 1: 'if nz_super_single: ... else: nz_super_partnered_weekly_rate_before_tax'); nz/statutes/new_zealand_superannuation/special_rates.yaml rule nz_super_hospital_rate_population (s 19(2): 'nz_super_single or (nz_super_in_relationship and not nz_super_has_dependent_children)'). Difference: no_partner means no co-resident spouse, civil partner or cohabiting partner. The module does not define 'single'; a person whose spouse or partner lives elsewhere (for example in care) has no partner pointer and reads single here, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/special_rates#input.nz_super_has_dependent_children", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "nz_super_has_dependent_children", + "module": "nz/statutes/new_zealand_superannuation/special_rates.yaml", + "note": "nz/statutes/new_zealand_superannuation/special_rates.yaml rule nz_super_hospital_rate_population (NZ Superannuation and Retirement Income Act 2001 s 19(2)): '... or (nz_super_in_relationship and not nz_super_has_dependent_children)'. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. max_child_age 17 is this mapping's reading of 'dependent child' as under 18; the module does not encode the definition's age limit or its care and financial-dependence tests, and dependent children with no parent pointer to the person (or living elsewhere) are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/special_rates#input.nz_super_in_relationship", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "nz_super_in_relationship", + "module": "nz/statutes/new_zealand_superannuation/special_rates.yaml", + "note": "nz/statutes/new_zealand_superannuation/special_rates.yaml rule nz_super_hospital_rate_population (NZ Superannuation and Retirement Income Act 2001 s 19(2)): 'nz_super_receives_or_becomes_entitled and (nz_super_single or (nz_super_in_relationship and not nz_super_has_dependent_children))'. Difference: has_partner means a co-resident spouse, civil partner or cohabiting partner; a partner living elsewhere is missed, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/special_rates#input.nz_super_receives_or_becomes_entitled", + "concepts": [ + "fact:person.public_pension_income" + ], + "engine_entity": "Person", + "engine_input": "nz_super_receives_or_becomes_entitled", + "module": "nz/statutes/new_zealand_superannuation/special_rates.yaml", + "note": "Consumed in nz/statutes/new_zealand_superannuation/special_rates.yaml by nz_super_hospital_rate_population (source: New Zealand Superannuation and Retirement Income Act 2001 s 19(2)), which ANDs 'nz_super_receives_or_becomes_entitled' with single status or partnered status without dependent children. Read as positive(public_pension_income); the concept's definition names NZ Superannuation. Differences: the input also covers a person who becomes entitled, which reference-year receipt does not show; other old-age pensions the concept holds also set the flag, such as an overseas state pension or a Veteran's Pension recorded as a public pension; and the concept is an annual amount. The module's hospital inputs stay uncovered, so the flag matters only once they are fed. Transport drops the concept, so the binding executes only on frames built from NZ's own data.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/new_zealand_superannuation/special_rates#input.nz_super_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "nz_super_single", + "module": "nz/statutes/new_zealand_superannuation/special_rates.yaml", + "note": "nz/statutes/new_zealand_superannuation/core.yaml rules nz_super_living_alone (s 4A: 'nz_super_single and nz_super_principal_residence_is_qualifying_accommodation and ...') and nz_super_ordinary_weekly_rate_before_tax (s 12 and Schedule 1 Part 1 clause 1: 'if nz_super_single: ... else: nz_super_partnered_weekly_rate_before_tax'); nz/statutes/new_zealand_superannuation/special_rates.yaml rule nz_super_hospital_rate_population (s 19(2): 'nz_super_single or (nz_super_in_relationship and not nz_super_has_dependent_children)'). Difference: no_partner means no co-resident spouse, civil partner or cohabiting partner. The module does not define 'single'; a person whose spouse or partner lives elsewhere (for example in care) has no partner pointer and reads single here, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/parental_leave/paid_parental_leave#input.ppl_employees_average_weekly_earnings", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "ppl_employees_average_weekly_earnings", + "module": "nz/statutes/parental_leave/paid_parental_leave.yaml", + "note": "nz/statutes/parental_leave/paid_parental_leave.yaml rule ppl_entitlement_for_employee (Parental Leave and Employment Protection Act 1987 s 71B): 'if ppl_employee_is_eligible: min(max(0, ppl_employees_average_weekly_earnings), ppl_maximum_weekly_rate)', rule period Week; module summary 'The weekly PPL rate is the lower of the employee's average weekly earnings and the maximum PPL rate'. Scale 1/52: weekly = annual / 52. Difference: reference-year employee wages averaged over 52 weeks, against the Act's average weekly earnings over a pre-leave window the module does not state; self-employment earnings are not included.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scale" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_cash_assets", + "concepts": [ + "fact:person.liquid_financial_assets" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_cash_assets", + "group_rule": "sum_over_members", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_cash_assets_within_limit (source: Social Security Act 2018 s 65(1)(b); Social Security Regulations 2018 reg 15). It holds when accommodation_supplement_cash_assets is at most accommodation_supplement_cash_asset_limit_partnered_or_with_children (16200, reg 15(1)(a)) for a family in a relationship or with dependent children, and at most accommodation_supplement_cash_asset_limit_other (8100, reg 15(1)(b)) otherwise, and accommodation_supplement_non_rate_entitlement_requirements (ss 65 to 67) requires it. The module does not define cash assets. The Act does, in s 68(2), which Schedule 2 applies for the purposes of the accommodation supplement: money saved, invested or banked with a bank or other institution; money invested in securities, bonds or debentures, or advanced on mortgage; money withdrawn from a KiwiSaver scheme; and money invested in shares in a partnership, company or other body. It excludes KiwiSaver contributions and member's interests, and anything the regulations exempt (reg 16 and Schedule 8 Part 1). Under s 69(2), which reg 15(3) restates, an applicant's assets include those of their spouse or partner, so the binding sums members' amounts onto the Family entity. Group encoding (ConceptMapping.encode_groups) applies it to the Family units the unit-construction step (microcosm.frame.unit_construction) builds under a declared benefit-unit rule, which decides who is a member; no New Zealand build applies it yet, and the country pack's rule (method card MC7) awaits the D1 method review. Differences: the concept leaves out money advanced on mortgage, withdrawn KiwiSaver money held as cash, shares in a partnership or company the person runs, which s 68(2)(a)(iv) counts as money invested in shares in a partnership or limited liability company or other incorporated or unincorporated body (a sole trader's non-cash business equity is in neither), and a member's interest in a non-KiwiSaver superannuation scheme, which Schedule 8 item 10 exempts only while a lock-in clause prevents withdrawal (Schedule 8 cl 25); the other Schedule 8 exemptions are not applied; if the unit rule makes a dependent child a Family member, the child's assets will be summed too, although s 69(2) adds only a spouse's or partner's, and if it leaves out a spouse or partner in long-term residential care, whose assets s 69(2A) still counts, their assets will be missed; and the concept is the stock at the survey reference date, while the test applies when the supplement is assessed.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_costs_are_homeownership", + "concepts": [ + "fact:household.tenure" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_costs_are_homeownership", + "group_rule": "household_value", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_entry_threshold_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6): 'if accommodation_supplement_costs_are_homeownership: accommodation_supplement_homeownership_entry_threshold_rate else: accommodation_supplement_rent_board_entry_threshold_rate'. Read as the household owning its dwelling (outright or with a mortgage). Differences: the input describes this family's own accommodation costs; household_value gives every family in an owner-occupied household true, including a second family (a boarder or other resident) whose costs are board or rent, not homeownership costs.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:household.tenure", + [ + "owned_outright", + "owned_with_mortgage" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_has_accommodation_costs", + "concepts": [ + "fact:household.tenure" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_has_accommodation_costs", + "group_rule": "household_value", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_non_rate_entitlement_requirements (source: Social Security Act 2018 ss 65 to 67): 'accommodation_supplement_has_accommodation_costs and accommodation_supplement_cash_assets_within_limit and ...'. The module computes the amount of weekly accommodation costs separately, in accommodation_supplement_weekly_accommodation_costs (source: s 65AAA definition of accommodation costs), from other inputs; nothing in the module ties this gate to that amount or says what counts as having accommodation costs. Read as any tenure other than rent_free. Differences: the input asks whether this family itself has accommodation costs; household_value gives true to every family in a rented or owned household, including a family that pays nothing toward housing, and the legal components of accommodation costs are not checked.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:household.tenure", + [ + "owned_outright", + "owned_with_mortgage", + "rented_public_authority", + "rented_nonprofit_social", + "rented_private" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_has_dependent_children", + "concepts": [ + "fact:person.age", + "fact:person.partner_person_id", + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:household.reference_person_id" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_has_dependent_children", + "group_rule": "reference_member", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_cash_assets_within_limit (source: Social Security Act 2018 s 65(1)(b); Social Security Regulations 2018 reg 15), which picks the partnered-or-with-children asset limit, and by accommodation_supplement_maximum_weekly_rate (Schedule 4 Part 7 clauses 1 to 6), where 'accommodation_supplement_in_relationship and accommodation_supplement_has_dependent_children' selects the large-family rates. Read as the family holding at least one dependent child under the country pack's declared benefit-unit rule (microcosm.frame.unit_construction), which builds each family from the relationship pointers, age and the household reference person and states who counts as a dependent child. 'Dependent child' is a Social Security Act 2018 Schedule 2 term that this module does not define and rulespec-nz at 8dc2507 does not encode, so the rule's age limit and placements are spec data, not read from the Act. Differences: the care, maintenance and financial dependence the definition turns on are not observed, so the rule's co-residence test stands in for them; and a child with no co-resident parent is placed in the household reference person's family when the rule says so, which names a caregiver the Act would identify by care.", + "relation": "approximate", + "transform": { + "feature": "has_dependent_child", + "kind": "unit_composition" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_has_two_or_more_dependent_children", + "concepts": [ + "fact:person.age", + "fact:person.partner_person_id", + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:household.reference_person_id" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_has_two_or_more_dependent_children", + "group_rule": "reference_member", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6): 'accommodation_supplement_sole_parent and accommodation_supplement_has_two_or_more_dependent_children' selects the large-family rates, and a sole parent with one dependent child takes the middle-family rates. Read as the family holding at least two dependent children under the country pack's declared benefit-unit rule (microcosm.frame.unit_construction), which builds each family from the relationship pointers, age and the household reference person and states who counts as a dependent child. Differences: as for accommodation_supplement_has_dependent_children, dependency is the rule's co-residence test, not the Act's care and maintenance.", + "relation": "approximate", + "transform": { + "feature": "two_or_more_dependent_children", + "kind": "unit_composition" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_in_relationship", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_in_relationship", + "group_rule": "reference_member", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_cash_assets_within_limit (source: Social Security Act 2018 s 65(1)(b); Social Security Regulations 2018 reg 15), which picks the partnered-or-with-children cash asset limit, and by accommodation_supplement_maximum_weekly_rate (Schedule 4 Part 7 clauses 1 to 6), which picks the family category. Read as the family's reference member having a co-resident spouse, civil partner or cohabiting partner. Differences: the Act's test for being in a relationship is not in this module; the concept is co-residence based, so a partner living elsewhere is missed and a cohabitation the Act would not treat as a relationship is counted.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_owner_weekly_required_payments", + "concepts": [ + "fact:household.mortgage_interest", + "fact:household.mortgage_principal" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_owner_weekly_required_payments", + "group_rule": "allocate_to_reference_unit", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_weekly_accommodation_costs (source: Social Security Act 2018 s 65AAA definition of accommodation costs), whose first branch returns it when accommodation_supplement_owns_premises_and_not_joint_owner_with_resident holds; the result feeds the Schedule 4 Part 7 weekly formula, so the value is weekly although the rule declares period Year. Read as the household's annual mortgage interest plus mortgage principal repaid, summed and scaled by 1/52 (one scaled_sum, since a binding takes one transform), on the family that contains the household reference person and zero on the household's other families. Differences: the module does not define the owner's payments; rates (property tax), insurance and other home payments are not added, which understates owners' costs (method card MC8); the concept is what the household repaid in the year, not what the mortgage requires; and a second family in an owner-occupied household gets zero.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "concepts": [ + "fact:household.tenure" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "group_rule": "household_value", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_weekly_accommodation_costs (source: Social Security Act 2018 s 65AAA definition of accommodation costs): 'if accommodation_supplement_owns_premises_and_not_joint_owner_with_resident: accommodation_supplement_owner_weekly_required_payments'. Read as the household owning its dwelling, outright or with a mortgage. Differences: the concept says nothing about title or co-owners, so a joint owner who lives with another owner is read as a sole owner; and household_value gives true to every family in an owner-occupied household, including a boarder family, whose owner payments are then zero because the household's payments go to the family containing the reference person.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:household.tenure", + [ + "owned_outright", + "owned_with_mortgage" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_relevant_weekly_income", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income", + "fact:person.interest_income", + "fact:person.dividend_income", + "fact:person.rental_income", + "fact:person.private_pension_income" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_relevant_weekly_income", + "group_rule": "sum_over_members", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_non_beneficiary_income_reduction (source: Social Security Regulations 2018 reg 18): 'if accommodation_supplement_non_beneficiary: max(0, accommodation_supplement_relevant_weekly_income - accommodation_supplement_non_beneficiary_income_cutout_weekly_amount) * accommodation_supplement_non_beneficiary_income_reduction_rate'. Read as the family's annual gross income from employment, non-farm and farm self-employment, interest, dividends, rent and private pensions, summed over its members and scaled by 1/52. Differences: the module does not define relevant income and reg 18's definition is not in it; every member's income is summed, including a dependent child's, and whether reg 18 counts a child's income is not stated here; realized capital gains are left out; public pension income is left out: it is a donor program receipt, which transport drops, and New Zealand Superannuation receipt is the receipt layer's model state, which a non-beneficiary family lacks by construction; and annual flows averaged over 52 weeks stand in for the weekly income at assessment.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_rent_paid_to_kainga_ora", + "concepts": [ + "fact:household.tenure" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_rent_paid_to_kainga_ora", + "group_rule": "household_value", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_social_housing_exclusion_not_applies (source: Social Security Act 2018 s 66): 'not accommodation_supplement_rent_paid_to_kainga_ora and not accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing and not accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown'. The tenure concept's rented_public_authority category names NZ Kainga Ora as its public landlord. The input is narrower: it is one landlord, not any public authority, and it is this family's rent, while household_value gives true to every family in the household, including one that does not itself pay rent to Kainga Ora.", + "relation": "narrow_match", + "transform": { + "clauses": [ + [ + "fact:household.tenure", + [ + "rented_public_authority" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "concepts": [ + "fact:household.tenure" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "group_rule": "household_value", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_social_housing_exclusion_not_applies (source: Social Security Act 2018 s 66), alongside the Kainga Ora and concessionary-mortgage exclusions. The tenure concept's rented_nonprofit_social category names the NZ registered community housing provider as its non-profit social landlord. The input is narrower: a registered provider and a social-housing tenancy, and this family's own rent, while household_value gives true to every family in the household.", + "relation": "narrow_match", + "transform": { + "clauses": [ + [ + "fact:household.tenure", + [ + "rented_nonprofit_social" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_sole_parent", + "concepts": [ + "fact:person.age", + "fact:person.partner_person_id", + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:household.reference_person_id" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_sole_parent", + "group_rule": "reference_member", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_maximum_weekly_rate (source: Social Security Act 2018 Schedule 4 Part 7 clauses 1 to 6), which gives a sole parent with two or more dependent children the large-family rates and one with one dependent child the middle-family rates. Read as the family having one adult (no partner in it) and at least one dependent child under the country pack's declared benefit-unit rule (microcosm.frame.unit_construction), which builds each family from the relationship pointers, age and the household reference person and states who counts as a dependent child. Differences: the module does not define a sole parent; the concept pointers are co-residence based, so a parent whose partner lives elsewhere counts here, and so does a family head with no partner who cares for a child the rule places with them (for example a household reference person and a younger relative with no co-resident parent).", + "relation": "approximate", + "transform": { + "feature": "sole_parent", + "kind": "unit_composition" + } + }, + { + "canonical_input": "nz:statutes/social_security/accommodation_supplement/core#input.accommodation_supplement_weekly_rent_paid", + "concepts": [ + "fact:household.rent" + ], + "engine_entity": "Family", + "engine_input": "accommodation_supplement_weekly_rent_paid", + "group_rule": "allocate_to_reference_unit", + "module": "nz/statutes/social_security/accommodation_supplement/core.yaml", + "note": "Consumed in nz/statutes/social_security/accommodation_supplement/core.yaml by accommodation_supplement_weekly_accommodation_costs (source: Social Security Act 2018 s 65AAA definition of accommodation costs), whose last branch returns accommodation_supplement_weekly_rent_paid when the family is not an owner, a joint owner with a resident, an additional resident in social housing or a boarder; the result feeds the Schedule 4 Part 7 weekly formula against weekly maximum rates (the module's tests feed weekly rents such as 700). Scale 1/52 turns the concept's annual contract rent into an average weekly amount; the rule declares period Year but the value is weekly. Differences: the concept is contract rent for the whole dwelling before housing subsidy, excluding separately billed utilities and service charges, and s 65AAA's own definition of rent is not in this module; the household amount goes to the family containing the household reference person, so another family in the household that pays the tenant gets zero here (in the rule's terms it pays board or contributions, which stay uncovered).", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scale" + } + }, + { + "canonical_input": "nz:statutes/social_security/disability_allowance/core#input.disability_allowance_dependent_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "disability_allowance_dependent_children_count", + "module": "nz/statutes/social_security/disability_allowance/core.yaml", + "note": "Read by disability_allowance_income_limit (source 'Social Security Act 2018 Schedule 5 Part 3'). 'disability_allowance_dependent_children_count <= 1' picks the sole-parent one-child limit (clause 13) over clause 14, and '== 0' is one condition of the 16-or-17 single limit (clause 10). The binding counts co-resident persons aged 17 or under who name this person as a parent. The Act's dependent child is a legal status this module does not define. Financial dependency and care arrangements are not in the concepts, and the age-17 cut-off is this mapping's stand-in, not a figure read from the module. Children in the person's care who do not name them as a parent are missed.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:statutes/social_security/disability_allowance/core#input.disability_allowance_person_age_years", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "disability_allowance_person_age_years", + "module": "nz/statutes/social_security/disability_allowance/core.yaml", + "note": "Read by disability_allowance_income_limit (source 'Social Security Act 2018 Schedule 5 Part 3') for a single applicant who is not a sole parent: 'disability_allowance_person_age_years >= disability_allowance_income_limit_young_single_minimum_age and disability_allowance_person_age_years <= disability_allowance_income_limit_young_single_maximum_age and disability_allowance_dependent_children_count == 0' (parameters 16 and 17, clause 10) selects the 16-or-17 single income limit. The input is the applicant's age when the rule is applied. The concept is age in completed years at the survey reference date, so a birthday between the two dates moves it by one.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/disability_allowance/core#input.disability_allowance_person_in_relationship", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "disability_allowance_person_in_relationship", + "module": "nz/statutes/social_security/disability_allowance/core.yaml", + "note": "Read by disability_allowance_income_limit (source 'Social Security Act 2018 Schedule 5 Part 3'): 'if disability_allowance_person_in_relationship: disability_allowance_income_limit_partnered' (clause 12). The input is the Act's legal relationship status. The concept flags a co-resident spouse, civil partner or cohabiting partner at the survey reference date. It does not apply the Act's tests for a relationship, and it misses a partner the Act would count who does not live in the household.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/disability_allowance/core#input.disability_allowance_person_is_sole_parent", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "disability_allowance_person_is_sole_parent", + "module": "nz/statutes/social_security/disability_allowance/core.yaml", + "note": "Read by disability_allowance_income_limit (source 'Social Security Act 2018 Schedule 5 Part 3') only in the branch where disability_allowance_person_in_relationship is false: 'if disability_allowance_person_is_sole_parent: if disability_allowance_dependent_children_count <= 1: disability_allowance_income_limit_sole_parent_one_child else: disability_allowance_income_limit_sole_parent_other' (clauses 13 and 14). The rule supplies the no-partner condition itself, so the binding flags a parent (birth, adoptive or step) of a co-resident child aged 17 or under. The Act's sole-parent status is a legal status this module does not define, and the co-resident parent flag stands in for it. The age-17 cut-off is this mapping's choice, not a figure read from the module. A caregiver who is not a parent of the child is not flagged.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/disability_allowance/core#input.disability_allowance_requires_ongoing_support_for_everyday_functions", + "concepts": [ + "fact:person.has_disability" + ], + "engine_entity": "Person", + "engine_input": "disability_allowance_requires_ongoing_support_for_everyday_functions", + "module": "nz/statutes/social_security/disability_allowance/core.yaml", + "note": "Read by disability_allowance_functional_need_requirement (source 'Social Security Act 2018 s 85(2)(a)'): 'disability_allowance_requires_ongoing_support_for_everyday_functions or disability_allowance_requires_ongoing_supervision_or_treatment_by_health_practitioner'. The concept is a functional survey measure (difficulty with everyday activities, as the source survey's functional-difficulty items record it). It stands in for the Act's need for ongoing support with everyday functions, which the module takes as a factual input and does not define. Difficulty with an activity is not the same as needing ongoing support. The module's separate six-month duration test reads disability_allowance_expected_disability_duration_months, which stays uncovered.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.jobseeker_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_applicant_age", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "Read by jobseeker_age_requirement (source 'Social Security Act 2018 s 23'): 'jobseeker_applicant_age >= jobseeker_minimum_age_without_dependent_child' (18, s 23(a)) without a dependent child, or '>= jobseeker_minimum_age_with_dependent_child' (20, s 23(b)) with one. The input is the applicant's age when the rule is applied. The concept is age in completed years at the survey reference date, so a birthday between the two dates moves it by one.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.jobseeker_full_time_student", + "concepts": [ + "fact:person.enrolled_full_time" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_full_time_student", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "Read by jobseeker_not_ineligible (source 'Social Security Act 2018 ss 25 and 26'): '(not jobseeker_full_time_student or jobseeker_section_25_discretionary_student_eligibility) and not jobseeker_unemployed_due_to_strike and not jobseeker_unemployed_or_on_leave_for_employment_related_training'. The concept is full-time enrolment in any education programme, as the programme defines it, school included. The input is the Act's full-time student status, which the module does not define, so the programmes and study loads that count may differ.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.jobseeker_has_dependent_child", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_has_dependent_child", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "Read by jobseeker_age_requirement (source 'Social Security Act 2018 s 23'): 'not jobseeker_has_dependent_child and jobseeker_applicant_age >= jobseeker_minimum_age_without_dependent_child' (18) or 'jobseeker_has_dependent_child and jobseeker_applicant_age >= jobseeker_minimum_age_with_dependent_child' (20). The binding flags a parent (birth, adoptive or step) of a co-resident child aged 17 or under. The Act's dependent child is a legal status this module does not define. Financial dependency and care arrangements are not in the concepts, and the age-17 cut-off is this mapping's stand-in, not a figure read from the module. Caregivers who are not a parent of the child are not flagged.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.main_benefit_receiving_new_zealand_superannuation", + "concepts": [ + "fact:person.public_pension_income" + ], + "engine_entity": "Person", + "engine_input": "main_benefit_receiving_new_zealand_superannuation", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "Consumed in nz/statutes/social_security/main_benefits/entitlement.yaml by main_benefit_concurrent_benefit_limit (source: Social Security Act 2018 s 18), whose formula includes 'and not main_benefit_receiving_new_zealand_superannuation'. Read as positive(public_pension_income): the concept's definition names NZ Superannuation among the social-insurance or state old-age pensions it holds. Differences: the concept also holds any other such pension (an overseas state pension, or a Veteran's Pension if the source records it as a public pension), so the flag can be true for someone who receives no NZ Superannuation. s 18 bars receiving a main benefit and NZ Superannuation at the same time, while the concept counts receipt at any time in the reference year. The concept's transport rule is drop, so on a transported frame encode skips this binding; the engine has no default for an absent input, so a transport run's input closure (build/nz/axiom_input_closure.json) feeds it instead. The binding executes only on frames built from NZ's own data.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_applicant_age", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_age_requirement (Social Security Act 2018 s 29(d)): 'sole_parent_applicant_age >= sole_parent_minimum_age', parameter 20. Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_caring_for_dependent_children_under_age_limit", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_caring_for_dependent_children_under_age_limit", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_child_requirement (Social Security Act 2018 ss 30 and 31): 'sole_parent_is_mother_or_father_or_child_regarded_as_child and sole_parent_caring_for_dependent_children_under_age_limit >= sole_parent_minimum_dependent_children' (minimum 1; the test file feeds it counts 0 and 1). The age limit is sole_parent_dependent_child_age_limit = 14 (ss 30 and 33), and rule sole_parent_support_expires_when_youngest_child_turns_age_limit ends support at 'sole_parent_youngest_dependent_child_age >= sole_parent_dependent_child_age_limit', so 'under the age limit' is 13 or under (max_age 13). Difference: counts co-resident persons aged 13 or under who name this person as a parent (birth, adoptive or step); the law counts dependent children the person is caring for, which adds children cared for without a parent pointer and drops children who are not dependent; each parent of a couple gets the count.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 13 + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_is_mother_or_father_or_child_regarded_as_child", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_child_requirement (Social Security Act 2018 ss 30 and 31): 'sole_parent_is_mother_or_father_or_child_regarded_as_child and sole_parent_caring_for_dependent_children_under_age_limit >= sole_parent_minimum_dependent_children'. Difference: parent pointers cover birth, adoptive and step parents of co-resident children; a child the law regards as the person's own without a parent pointer is missed, and whether the Act counts a step-parent as 'mother or father' is not stated in the module. max_child_age 17 reads 'dependent child' as under 18 (not encoded in the module); the conjoined count binding applies the under-14 limit, so the conjunction is unchanged by this choice.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_is_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_is_single", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_relationship_requirement (Social Security Act 2018 s 30): 'sole_parent_is_single or sole_parent_spouse_or_partner_died or sole_parent_marriage_or_civil_union_dissolved or sole_parent_living_apart_and_lost_or_lacks_partner_support or ...'. Difference: no_partner means no co-resident spouse, civil partner or cohabiting partner. The module does not define 'single'; a person whose spouse or partner lives elsewhere (for example in care) has no partner pointer and reads single here, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_marriage_or_civil_union_dissolved", + "concepts": [ + "fact:person.legal_marital_status" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_marriage_or_civil_union_dissolved", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_relationship_requirement (Social Security Act 2018 s 30): '... or sole_parent_marriage_or_civil_union_dissolved or ...'. The concept's 'married' includes civil unions, so 'divorced' covers a dissolved civil union when the source codes it so. Difference: legal status at the reference date; a person whose marriage was dissolved and who has since remarried reads false, and 'separated' (not dissolved) reads false.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:person.legal_marital_status", + [ + "divorced" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.sole_parent_spouse_or_partner_died", + "concepts": [ + "fact:person.legal_marital_status" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_spouse_or_partner_died", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule sole_parent_relationship_requirement (Social Security Act 2018 s 30): '... or sole_parent_spouse_or_partner_died or ...'. Difference: 'widowed' is legal marital status, so the death of an unmarried (de facto) partner is missed; a widowed person who has since remarried reads false.", + "relation": "approximate", + "transform": { + "clauses": [ + [ + "fact:person.legal_marital_status", + [ + "widowed" + ] + ] + ], + "kind": "predicate" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.supported_living_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "supported_living_applicant_age", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule supported_living_restricted_or_blind_age_requirement (Social Security Act 2018 s 34(c)): 'supported_living_applicant_age >= supported_living_restricted_or_blind_minimum_age', parameter 16. Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "concepts": [ + "fact:person.has_disability" + ], + "engine_entity": "Person", + "engine_input": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule supported_living_restricted_work_capacity (Social Security Act 2018 s 35): 'supported_living_capacity_restricted_by_health_condition_injury_or_disability and supported_living_restricted_work_capacity_permanent and supported_living_restricted_work_capacity_severe'; the module summary says administrative medical certificates, MSD satisfaction and other external determinations remain factual inputs. Difference: has_disability is a functional survey measure (difficulty with everyday activities, as survey functional-difficulty items record it); the input is a restriction of capacity for work by a health condition, injury or disability. The two overlap without either containing the other: a functional difficulty need not restrict work capacity, and a work-restricting condition need not produce a difficulty the survey records. Permanence (supported_living_restricted_work_capacity_permanent, from the expected-duration and terminal-condition inputs) and severity (supported_living_restricted_work_capacity_severe: supported_living_regular_open_employment_capacity_hours_per_week < 15) are separate derived conditions whose inputs this binding does not supply.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.supported_living_caring_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "supported_living_caring_applicant_age", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule supported_living_caring_age_requirement (Social Security Act 2018 s 40(1)(c)): age >= supported_living_caring_minimum_age_without_dependent_child (18) or, with a dependent child, >= supported_living_caring_minimum_age_with_dependent_child (20). Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/entitlement#input.supported_living_caring_applicant_has_dependent_child", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "supported_living_caring_applicant_has_dependent_child", + "module": "nz/statutes/social_security/main_benefits/entitlement.yaml", + "note": "nz/statutes/social_security/main_benefits/entitlement.yaml rule supported_living_caring_age_requirement (Social Security Act 2018 s 40(1)(c)): '(not supported_living_caring_applicant_has_dependent_child and age >= ..._without_dependent_child) or (supported_living_caring_applicant_has_dependent_child and age >= ..._with_dependent_child)'. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. max_child_age 17 is this mapping's reading of 'dependent child' as under 18; the module does not encode the definition's age limit or its care and financial-dependence tests, and dependent children with no parent pointer to the person (or living elsewhere) are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.jobseeker_support_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_support_applicant_age", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Read by jobseeker_support_gross_weekly_rate (source 'Social Security Act 2018 Schedule 4 Part 1 clauses 1 and 3'). For a single applicant with no dependent children, 'jobseeker_support_applicant_age < jobseeker_support_under_20_living_with_parent_age_limit' (clause 1(a)) and 'jobseeker_support_applicant_age < jobseeker_support_under_25_without_children_age_limit' (clause 1(b)) select the weekly rate. The input is the applicant's age when the rule is applied. The concept is age in completed years at the survey reference date, so a birthday between the two dates moves it by one.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.jobseeker_support_dependent_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_support_dependent_children_count", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Read by jobseeker_support_gross_weekly_rate (source 'Social Security Act 2018 Schedule 4 Part 1 clauses 1 and 3') and jobseeker_support_weekly_income_test_reduction ('Schedule 2 Income Tests 1, 3, and 4; Schedule 4 Part 1 clauses 1 and 3'). Both test only 'jobseeker_support_dependent_children_count >= 1', which chooses the with-children rates and income tests. The binding counts co-resident persons aged 17 or under who name this person as a parent. The Act's dependent child is a legal status this module does not define. Financial dependency and care arrangements are not in the concepts, and the age-17 cut-off is this mapping's stand-in, not a figure read from the module. Children in the person's care who do not name them as a parent are missed.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.jobseeker_support_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_support_single", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Read by jobseeker_support_gross_weekly_rate (source 'Social Security Act 2018 Schedule 4 Part 1 clauses 1 and 3') and jobseeker_support_weekly_income_test_reduction ('Schedule 2 Income Tests 1, 3, and 4'). 'if jobseeker_support_single:' selects the single-person rates and income tests; otherwise the partnered branches apply. The input is the Act's single status. The concept flags a person with no co-resident spouse, civil partner or cohabiting partner at the survey reference date. It does not apply the Act's tests for a relationship, and the two differ when a partner the Act would count lives elsewhere.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.jobseeker_support_total_income", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income", + "fact:person.interest_income", + "fact:person.dividend_income", + "fact:person.rental_income", + "fact:person.private_pension_income" + ], + "engine_entity": "Person", + "engine_input": "jobseeker_support_total_income", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Consumed in nz/statutes/social_security/main_benefits/rates.yaml by jobseeker_support_weekly_income_test_reduction (source: Social Security Act 2018 Schedule 2 Income Tests 1, 3 and 4; Schedule 4 Part 1), which abates the Jobseeker Support rate above main_benefit_income_test_lower_weekly_threshold. Read as the person's own annual gross income from employment, non-farm and farm self-employment, interest, dividends, rent and private pensions, summed and scaled by 1/52. Differences: the module does not define the income it tests; the input is a person-level value, so a partner's income is not added, and whether the test reads a couple's joint income is not stated in this module; main-benefit and New Zealand Superannuation amounts are model state, not concepts, so neither is in the sum, and public pension income, a donor program receipt that transport drops, is left out; realized capital gains are left out; and annual flows averaged over 52 weeks stand in for the weekly income at assessment.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.main_benefit_income_test_assessable_income", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income", + "fact:person.interest_income", + "fact:person.dividend_income", + "fact:person.rental_income", + "fact:person.private_pension_income" + ], + "engine_entity": "Person", + "engine_input": "main_benefit_income_test_assessable_income", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Consumed in nz/statutes/social_security/main_benefits/rates.yaml by main_benefit_income_test_1_weekly_reduction to main_benefit_income_test_4_weekly_reduction (source: Social Security Act 2018 Schedule 2 definitions of Income Tests 1 to 4), which abate above main_benefit_income_test_lower_weekly_threshold. Read as the person's own annual gross income from employment, non-farm and farm self-employment, interest, dividends, rent and private pensions, summed and scaled by 1/52. Differences: the module does not define the income it tests; the input is a person-level value, so a partner's income is not added, and whether the test reads a couple's joint income is not stated in this module; main-benefit and New Zealand Superannuation amounts are model state, not concepts, so neither is in the sum, and public pension income, a donor program receipt that transport drops, is left out; realized capital gains are left out; and annual flows averaged over 52 weeks stand in for the weekly income at assessment.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.sole_parent_support_total_income", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income", + "fact:person.interest_income", + "fact:person.dividend_income", + "fact:person.rental_income", + "fact:person.private_pension_income" + ], + "engine_entity": "Person", + "engine_input": "sole_parent_support_total_income", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Consumed in nz/statutes/social_security/main_benefits/rates.yaml by sole_parent_support_income_for_income_test (source: Social Security Act 2018 Schedule 4 Part 2 clauses 1 and 2), 'max(0, sole_parent_support_total_income - sole_parent_support_income_disregarded_for_childcare)'. Read as the person's own annual gross income from employment, non-farm and farm self-employment, interest, dividends, rent and private pensions, summed and scaled by 1/52. Differences: the module does not define the income it tests; the input is a person-level value, so a partner's income is not added, and whether the test reads a couple's joint income is not stated in this module; main-benefit and New Zealand Superannuation amounts are model state, not concepts, so neither is in the sum, and public pension income, a donor program receipt that transport drops, is left out; realized capital gains are left out; and annual flows averaged over 52 weeks stand in for the weekly income at assessment.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_blind_average_weekly_earnings", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "supported_living_blind_average_weekly_earnings", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rule supported_living_blind_subsidy_unconstrained_weekly_amount (Social Security Act 2018 Schedule 4 Part 3 clause 3): 'max(0, supported_living_blind_average_weekly_earnings) * supported_living_blind_subsidy_rate' (0.25), then capped in supported_living_blind_subsidy_weekly_amount. Weekly by name and by the module's weekly rate schedules, although the rule's period field says Year. Scale 1/52: weekly = annual / 52. Difference: the concept is employee wages over the reference year; the averaging period the Act uses is not in the module, and self-employment earnings are not included.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scale" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_blind_beneficiary_employed", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "supported_living_blind_beneficiary_employed", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rule supported_living_blind_subsidy_weekly_amount (Social Security Act 2018 Schedule 4 Part 3 clauses 3 and 4): 'if supported_living_payment_totally_blind and supported_living_blind_beneficiary_employed: min(...)'. Difference: positive employee wages at any time in the reference year stands in for being in employment when the subsidy is assessed; a self-employed blind beneficiary reads false.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_payment_applicant_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "supported_living_payment_applicant_age", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rule supported_living_payment_schedule_weekly_rate_before_residential_care_halving (Social Security Act 2018 Schedule 4 Part 3 clauses 1 and 7): 'supported_living_payment_applicant_age < supported_living_payment_single_under_18_age_limit' (18) selects the single under-18 rate. Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_payment_beneficiary_personal_earnings", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "supported_living_payment_beneficiary_personal_earnings", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rule supported_living_payment_income_disregard_for_restricted_or_blind (Social Security Act 2018 Schedule 4 Part 3 clause 1): 'if supported_living_payment_restricted_or_blind: if supported_living_payment_totally_blind: max(0, supported_living_payment_beneficiary_personal_earnings) else: min(max(0, supported_living_payment_restricted_or_blind_earned_income_disregard_maximum), max(0, ..._personal_earnings))'. The cap parameter is 20 and the result offsets income tested against main_benefit_income_test_lower_weekly_threshold (160), and the module summary says it encodes weekly rate schedules, so the input is weekly although the rule's period field says Year. Scale 1/52: weekly = annual / 52. Difference: the concept is employee wages only; 'personal earnings' is not defined in the module and may include self-employment earnings (input broader); an annual average stands in for the week's earnings.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scale" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_payment_dependent_children_count", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "supported_living_payment_dependent_children_count", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rule supported_living_payment_schedule_weekly_rate_before_residential_care_halving (Social Security Act 2018 Schedule 4 Part 3 clauses 1 and 7): 'if supported_living_payment_dependent_children_count >= 1: ..._with_children_weekly_rate'. Difference: counts co-resident persons aged 17 or under naming this person as a parent (birth, adoptive or step); max_age 17 is this mapping's reading of 'dependent child' as under 18, which the module does not encode, and dependent children with no parent pointer to the person are missed.", + "relation": "approximate", + "transform": { + "kind": "coresident_child_count", + "max_age": 17 + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_payment_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "supported_living_payment_single", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "nz/statutes/social_security/main_benefits/rates.yaml rules supported_living_payment_schedule_weekly_rate_before_residential_care_halving (Schedule 4 Part 3 clauses 1 and 7: 'if supported_living_payment_single: ...'), supported_living_payment_full_income_test_weekly_reduction ('not supported_living_payment_single and ...') and supported_living_blind_subsidy_single_person_increase_if_applicable (clause 2). Difference: no_partner means no co-resident spouse, civil partner or cohabiting partner. The module does not define 'single'; a person whose spouse or partner lives elsewhere (for example in care) has no partner pointer and reads single here, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/main_benefits/rates#input.supported_living_payment_total_income", + "concepts": [ + "fact:person.employment_income", + "fact:person.nonfarm_self_employment_income", + "fact:person.farm_self_employment_income", + "fact:person.interest_income", + "fact:person.dividend_income", + "fact:person.rental_income", + "fact:person.private_pension_income" + ], + "engine_entity": "Person", + "engine_input": "supported_living_payment_total_income", + "module": "nz/statutes/social_security/main_benefits/rates.yaml", + "note": "Consumed in nz/statutes/social_security/main_benefits/rates.yaml by supported_living_payment_income_for_income_test (source: Social Security Act 2018 Schedule 4 Part 3 clause 1), 'max(0, supported_living_payment_total_income - supported_living_payment_income_disregard_for_restricted_or_blind)'. Read as the person's own annual gross income from employment, non-farm and farm self-employment, interest, dividends, rent and private pensions, summed and scaled by 1/52. Differences: the module does not define the income it tests; the input is a person-level value, so a partner's income is not added, and whether the test reads a couple's joint income is not stated in this module; main-benefit and New Zealand Superannuation amounts are model state, not concepts, so neither is in the sum, and public pension income, a donor program receipt that transport drops, is left out; realized capital gains are left out; and annual flows averaged over 52 weeks stand in for the weekly income at assessment.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scaled_sum" + } + }, + { + "canonical_input": "nz:statutes/social_security/orphans_unsupported_child_benefit/core#input.caregiver_age_years", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "caregiver_age_years", + "module": "nz/statutes/social_security/orphans_unsupported_child_benefit/core.yaml", + "note": "Consumed in nz/statutes/social_security/orphans_unsupported_child_benefit/core.yaml by is_eligible_caregiver (source: Social Security Act 2018 s 44, excerpt 'P is aged 18 years or over'): 'caregiver_age_years >= ocb_caregiver_minimum_age and caregiver_is_not_a_parent_of_child and ...'. The module places one caregiver-child pair on a Person row (its tests set both caregiver_age_years and child_age_years on one request); this binding reads the row as the caregiver P, so it is the person's own age. Differences: completed years at the survey reference date versus age in the benefit week the rule evaluates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/winter_energy_payment/core#input.winter_energy_payment_has_dependent_children", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "winter_energy_payment_has_dependent_children", + "module": "nz/statutes/social_security/winter_energy_payment/core.yaml", + "note": "nz/statutes/social_security/winter_energy_payment/core.yaml rule winter_energy_payment_rate_per_winter_period (Social Security Act 2018 Schedule 4 Part 8): 'if winter_energy_payment_single and not winter_energy_payment_has_dependent_children: ...'. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. Schedule 4 Part 8 clause 2 defines dependent child for this Part (the repository's corpus summary of Part 8; the module summary names Part 8's dependent-child category), and the module does not encode that definition, so max_child_age 17 is this mapping's reading of 'dependent child' as under 18. Dependent children with no parent pointer to the person (or living elsewhere) are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/winter_energy_payment/core#input.winter_energy_payment_person_age", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "winter_energy_payment_person_age", + "module": "nz/statutes/social_security/winter_energy_payment/core.yaml", + "note": "nz/statutes/social_security/winter_energy_payment/core.yaml rules winter_energy_payment_aged_65_or_over_for_residential_care (Social Security Act 2018 s 72(2)(c): '>= winter_energy_payment_residential_care_older_age_threshold', 65) and winter_energy_payment_aged_50_to_64_for_residential_care (s 72(2)(ca): 50 to 64). Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/winter_energy_payment/core#input.winter_energy_payment_receiving_new_zealand_superannuation", + "concepts": [ + "fact:person.public_pension_income" + ], + "engine_entity": "Person", + "engine_input": "winter_energy_payment_receiving_new_zealand_superannuation", + "module": "nz/statutes/social_security/winter_energy_payment/core.yaml", + "note": "Consumed in nz/statutes/social_security/winter_energy_payment/core.yaml by winter_energy_payment_receiving_qualifying_benefit (source: Social Security Act 2018 s 71 and s 72(1)(a)), whose formula includes 'or winter_energy_payment_receiving_new_zealand_superannuation'. Read as positive(public_pension_income); the concept's definition names NZ Superannuation. Differences: other old-age pensions the concept holds also set the flag, such as an overseas state pension, or a Veteran's Pension recorded as a public pension (the rule reads Veteran's Pension through its own input). s 72 entitles for days in the winter period on which a qualifying benefit is received, while the concept counts receipt at any time in the reference year. Transport drops the concept, so the binding executes only on frames built from NZ's own data.", + "relation": "approximate", + "transform": { + "kind": "positive" + } + }, + { + "canonical_input": "nz:statutes/social_security/winter_energy_payment/core#input.winter_energy_payment_single", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "winter_energy_payment_single", + "module": "nz/statutes/social_security/winter_energy_payment/core.yaml", + "note": "nz/statutes/social_security/winter_energy_payment/core.yaml rule winter_energy_payment_rate_per_winter_period (Social Security Act 2018 Schedule 4 Part 8): 'if winter_energy_payment_single and not winter_energy_payment_has_dependent_children: ..._single_no_dependent_children_rate_per_winter_period else: ..._other_rate_per_winter_period'. Difference: no_partner means no co-resident spouse, civil partner or cohabiting partner. The module does not define 'single'; a person whose spouse or partner lives elsewhere (for example in care) has no partner pointer and reads single here, and a survey-recorded cohabitant may not meet the Act's relationship test.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "no_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/winter_energy_payment/core#input.winter_energy_payment_valid_election_not_to_receive_in_force", + "concepts": [ + "fact:person.take_up_seed" + ], + "engine_entity": "Person", + "engine_input": "winter_energy_payment_valid_election_not_to_receive_in_force", + "module": "nz/statutes/social_security/winter_energy_payment/core.yaml", + "note": "Consumed in nz/statutes/social_security/winter_energy_payment/core.yaml by winter_energy_payment_not_elected_out (source: Social Security Act 2018 s 73): 'not winter_energy_payment_valid_election_not_to_receive_in_force'. An opt-out election, drawn like policyengine-uk's child_benefit_opts_out (TakeUpThreshold uk.child_benefit_opt_out): true when the person's nz.winter_energy_payment_opt_out draw from the persistent seed falls below an opt-out rate supplied at encode time. Differences: the value is imputed, not an observed election. s 73 requires both spouses or partners to elect for a relationship-rate payment, but each partner gets an independent draw, so partners can disagree.", + "relation": "approximate", + "transform": { + "kind": "take_up_threshold", + "program": "nz.winter_energy_payment_opt_out" + } + }, + { + "canonical_input": "nz:statutes/social_security/youth_young_parent_payment/core#input.young_person_age_years", + "concepts": [ + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "young_person_age_years", + "module": "nz/statutes/social_security/youth_young_parent_payment/core.yaml", + "note": "nz/statutes/social_security/youth_young_parent_payment/core.yaml rules youth_payment_entitled (Social Security Act 2018 s 49: 'young_person_age_years >= yp_youth_min_age and young_person_age_years <= yp_youth_max_age', 16 and 17), young_parent_payment_entitled (s 56: age bands 16-17, 18-19 via ypp_category_ii_min_age 18 and ypp_max_age 19) and applicable_weekly_rate (Schedule 4 Part 6 items 1-5). Difference: the concept is age in completed years at the survey reference date; the rule reads the person's age when the entitlement is assessed, which the module does not date, so ages near the threshold can differ by the gap between the two dates.", + "relation": "approximate", + "transform": { + "kind": "identity" + } + }, + { + "canonical_input": "nz:statutes/social_security/youth_young_parent_payment/core#input.young_person_has_dependent_child", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "young_person_has_dependent_child", + "module": "nz/statutes/social_security/youth_young_parent_payment/core.yaml", + "note": "nz/statutes/social_security/youth_young_parent_payment/core.yaml rule youth_payment_entitled (Social Security Act 2018 s 49; excerpt 'P has no dependent children'): '... and not young_person_has_dependent_child and ...'. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. max_child_age 17 is this mapping's reading of 'dependent child' as under 18; the module does not encode the definition's age limit or its care and financial-dependence tests, and dependent children with no parent pointer to the person (or living elsewhere) are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/youth_young_parent_payment/core#input.young_person_has_dependent_child_for_part6_rates", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "young_person_has_dependent_child_for_part6_rates", + "module": "nz/statutes/social_security/youth_young_parent_payment/core.yaml", + "note": "nz/statutes/social_security/youth_young_parent_payment/core.yaml rule applicable_weekly_rate (Social Security Act 2018 Schedule 4 Part 6 items 1-5): 'if young_person_has_dependent_child_for_part6_rates: yp_rate_..._with_child'; excerpt 'In this Part, dependent child (as defined in Schedule 2) excludes a child in respect of whom an orphan's benefit or an unsupported child's benefit is being paid'. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. max_child_age 17 is this mapping's reading of 'dependent child' as under 18; the module does not encode the definition's age limit or its care and financial-dependence tests, and dependent children with no parent pointer to the person (or living elsewhere) are missed. The clause 6 exclusion depends on another program's payment and cannot be applied from the concepts.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/social_security/youth_young_parent_payment/core#input.young_person_is_in_relationship", + "concepts": [ + "fact:person.partner_person_id" + ], + "engine_entity": "Person", + "engine_input": "young_person_is_in_relationship", + "module": "nz/statutes/social_security/youth_young_parent_payment/core.yaml", + "note": "nz/statutes/social_security/youth_young_parent_payment/core.yaml rules applicable_weekly_rate (Social Security Act 2018 Schedule 4 Part 6 items 1-5: 'if young_person_is_in_relationship: ... yp_rate_partnered_...') and base_weekly_payment_after_income_test (subparts 1 and 4). Difference: has_partner means a co-resident spouse, civil partner or cohabiting partner; a partner living elsewhere is missed, and a survey-recorded cohabitant may not meet the Act's relationship test. The s 49/56 'is or has been in a relationship' test uses the separate input young_person_has_never_been_in_relationship, left unbound.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "role": "has_partner" + } + }, + { + "canonical_input": "nz:statutes/social_security/youth_young_parent_payment/core#input.young_person_is_parent_or_step_parent_of_dependent_child", + "concepts": [ + "fact:person.parent_1_person_id", + "fact:person.parent_2_person_id", + "fact:person.age" + ], + "engine_entity": "Person", + "engine_input": "young_person_is_parent_or_step_parent_of_dependent_child", + "module": "nz/statutes/social_security/youth_young_parent_payment/core.yaml", + "note": "nz/statutes/social_security/youth_young_parent_payment/core.yaml rule young_parent_payment_entitled (Social Security Act 2018 s 56; excerpts 'P is a parent or step-parent of at least 1 dependent child' and 'a dependent child of a young person's spouse or partner must also be treated as a dependent child of the young person'). Parent pointers cover birth, adoptive and step parents; a partner's child counts only when the survey records the young person as that child's (step) parent. Difference: flags a person named as parent (birth, adoptive or step) by a co-resident person aged 17 or under. max_child_age 17 is this mapping's reading of 'dependent child' as under 18; the module does not encode the definition's age limit or its care and financial-dependence tests, and dependent children with no parent pointer to the person (or living elsewhere) are missed.", + "relation": "approximate", + "transform": { + "kind": "relationship_role", + "max_child_age": 17, + "role": "parent_of_coresident_child" + } + }, + { + "canonical_input": "nz:statutes/student_loan/repayments#input.student_loan_weekly_earnings", + "concepts": [ + "fact:person.employment_income" + ], + "engine_entity": "Person", + "engine_input": "student_loan_weekly_earnings", + "module": "nz/statutes/student_loan/repayments.yaml", + "note": "nz/statutes/student_loan/repayments.yaml rule student_loan_weekly_deduction (Student Loan Scheme Act 2011 s 37; IRD excerpt \"You repay 12% of every dollar you earn over the pay period repayment threshold when you use a tax code with 'SL' for your main job (M SL or ME SL).\"): 'max(0, student_loan_weekly_earnings - student_loan_weekly_repayment_threshold) * student_loan_repayment_rate', rule period Week; student_loan_weekly_repayment_threshold is 464, one fifty-second of the 24,128 annual threshold (s 37(4)(a)). Scale 1/52: weekly = annual / 52. Difference: annual gross wages averaged over 52 weeks, against salary or wages in a weekly pay period from the main job; for part-year workers or several jobs the averaged figure and the pay-period figure differ, and the weekly threshold makes that difference non-linear. The module has no borrower input, so student_loan_weekly_deduction is computed for everyone whose earnings are fed; a build must restrict it to student loan borrowers, whom the concepts do not identify.", + "relation": "approximate", + "transform": { + "factor": 0.019230769230769232, + "kind": "scale" + } + } + ], + "engine": "axiom:nz", + "engine_version": "6fe181fc4c65763150fe97501ef3443774e64869", + "entity_correspondence": { + "household": "Household", + "person": "Person" + }, + "format": "microcosm.concept_mapping.v1", + "input_declaration": "usage_inferred", + "structural_inputs": [], + "unmapped": { + "fact:household.property_tax": "The only rates input, rr_rates_payable_before_rebate (Person) in statutes/rates_rebates/rates_rebate.yaml, cannot be bound at 6fe181f, because the dense engine could not compile that module and nz.json lists it only under cli_walk_inputs, which the adapter's surface loader does not read; once the module compiles, allocate_to_reference_person of property_tax is the candidate (approximate, because the ratepayer need not be the reference person).", + "fact:household.source_household_id": "Original donor household lineage is build provenance and weight diagnostic support, not a rulespec-nz legal input.", + "fact:person.educational_attainment": "rulespec-nz at 6fe181f has no input for completed education: no rule or input name mentions a qualification, degree, diploma or attainment level; the education inputs are current enrollment or school attendance (this mapping binds some of them to education_enrollment and enrolled_full_time); and young_person_is_study_ready is what youth_young_parent_payment/core.yaml calls an agency-adjudicated composite input (s 50).", + "fact:person.realized_capital_gains": "rulespec-nz at 6fe181f has no input for gains on disposals: no rule mentions gains, disposals or the bright-line test, and the only capital input, income_tax_expenditure_or_loss_is_capital_nature (income_tax/core/taxable_income.yaml, s DA 2), classifies expenditure for the general deduction limitation.", + "fact:person.sex": "rulespec-nz at 6fe181f has no sex- or gender-dependent input: none of the 668 dense-surface input names or 40 module YAMLs mention sex, gender, male, female, man, woman, wife or husband, and the only related hit, sole_parent_is_mother_or_father_or_child_regarded_as_child (social_security/main_benefits/entitlement.yaml), tests parenthood, which this mapping binds to the parent_of_coresident_child role.", + "fact:person.usual_weekly_hours": "rulespec-nz at 6fe181f has no input that takes hours worked: the work-hours inputs are threshold statuses no transform can compute from hours, namely acc_self_employed_more_than_30_hours_per_week (regulations/acc/earners_levy.yaml, reg 6, which also needs self-employment hours alone), jobseeker_in_full_time_employment (main_benefits/entitlement.yaml, s 21), acc_weekly_compensation_is_full_time_earner and the Family-level in_work_tax_credit_normally_full_time_earner; the remaining hours_per_week inputs are childcare, programme-participation or work-capacity hours.", + "fact:person.weeks_worked": "rulespec-nz at 6fe181f has no input the concept determines: the closest, in_work_tax_credit_weekly_periods (Family, income_tax/family_scheme/tax_credits.yaml, s MD 10(2)), counts weeks in which the person or their partner meets the earner requirement, which needs the union of two partners' work weeks that no group rule gives (reference_member drops a working partner; sum_over_members double-counts and adds children's weeks), and minimum_family_tax_credit_weekly_periods and minimum_family_full_time_earner_weeks count only weeks as a full-time earner." + } +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/country_package.json b/packages/microcosm-build/src/microcosm/build/nz/country_package.json index 5e89805587..4b134065a0 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/country_package.json +++ b/packages/microcosm-build/src/microcosm/build/nz/country_package.json @@ -196,6 +196,61 @@ "path": "precalibration_stages.json", "kind": "legacy_json", "schema_id": "legacy_json" + }, + { + "path": "transport_inputs.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "transport_atomic_geography_support.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "concept_mapping.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "geography_assignment.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "money_normalization_hold_fixed.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "transport_graph.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "entitlement_graph.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "gap_annualisation.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "holdout_comparator_bindings.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "as_encoding.json", + "kind": "legacy_json", + "schema_id": "legacy_json" + }, + { + "path": "export_replay_bindings.json", + "kind": "legacy_json", + "schema_id": "legacy_json" } ] } diff --git a/packages/microcosm-build/src/microcosm/build/nz/entitlement_graph.json b/packages/microcosm-build/src/microcosm/build/nz/entitlement_graph.json new file mode 100644 index 0000000000..0adc47018b --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/entitlement_graph.json @@ -0,0 +1,1035 @@ +{ + "schema_version": 1, + "nodes": [ + { + "id": "nz.as.bridge", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.as.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.as.bridge", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.as.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.as.bridge", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.as.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.as.bridge", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + } + ], + "scenario_nodes": [ + { + "id": "nz.scn.{scenario}", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.{scenario}.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.scn.{scenario}.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.{scenario}.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "{scenario}", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.scn.{scenario}.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "{scenario}" + } + }, + { + "id": "nz.scn.{scenario}.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.{scenario}.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.{scenario}.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.{scenario}", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "{scenario}" + } + } + ], + "scenario_gap": "nz.scn.{scenario}.gap", + "variant_gap": "nz.v.{variant}.gap", + "bands": { + "id": "nz.as.bands", + "population": "nz.terminal", + "baseline_scenario": "S0" + }, + "package": { + "id": "nz.package", + "artifact_name": "bands" + }, + "checkpoints": [ + "nz.as.bands" + ] +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/export_contract.json b/packages/microcosm-build/src/microcosm/build/nz/export_contract.json index 2f3240c525..2325da4456 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/export_contract.json +++ b/packages/microcosm-build/src/microcosm/build/nz/export_contract.json @@ -1,5 +1,5 @@ { - "_description": "This closed roster declares the New Zealand v0 export inputs. Donor records remain US support records. The graph must select exact entity-qualified export and gate slices from the required and optional columns. Encoded inputs enter only when axiom_input_closure.json and this roster both name them. The export kernel writes every column that its selected frame carries; this roster alone does not project or enforce those slices. formula_owned_excluded names every output that the graph requests from the bound rulespec-nz modules, and the graph must exclude those outputs from its export slices.", + "_description": "The graph enforces this closed entity-qualified roster at composition. The export and terminal gate slices retain replay inputs and assigned receipt flags and exclude formula outputs, scratch cents and reporting state. Frame projection supplies structural identifiers and memberships automatically.", "_source": { "rules_bindings": "axiom_rules_bindings.json", "unit_rule": "benefit_unit_rule.json" @@ -58,20 +58,173 @@ "family_weight" ], "optional": [ - "source_household_id", - "family_source_household_id", + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents", "age", - "sex", - "region_code", - "support_stratum", + "dividend_income", "donor_country_code", + "donor_support_stratum", + "family_source_household_id", + "farm_self_employment_income", + "household_region_code", + "interest_income", + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_income_test_assessable_income", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "mortgage_interest", + "mortgage_principal", + "nonfarm_self_employment_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "private_pension_income", + "property_tax", + "realized_capital_gains", "receives_jobseeker_support", + "receives_nz_super", "receives_sole_parent_support", "receives_supported_living_payment", - "receives_nz_super" + "region_code", + "rent", + "rental_income", + "sex", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "sole_parent_youngest_dependent_child_age", + "source_household_id", + "support_stratum", + "supported_living_applicant_age", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind", + "tenure" ], "formula_owned_excluded": [ "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_entitled_weekly_payment", "accommodation_supplement_maximum_weekly_rate", "accommodation_supplement_non_beneficiary_income_reduction", "accommodation_supplement_non_rate_entitlement_requirements", @@ -101,5 +254,351 @@ "receives_supported_living_payment": "The receipt kernel assigns this person-level snapshot flag; the donor does not observe NZ receipt.", "receives_nz_super": "The receipt kernel assigns this person-level snapshot flag; the donor does not observe NZ receipt." }, - "_slice_requirement": "G8-w3b must declare the exact entity-qualified export and terminal-gate slices. H12 still requires closed-roster enforcement for all replay-required normalized or encoded inputs. export.prepare@1 currently accepts entities, weight_entity, time_period and optional bindings, then emits a descriptor that materialize_export writes; it does not read this roster. The hub must resolve any required shared-code enforcement separately." + "_slice_requirement": "The graph selects export_contract for opt-in composition validation and declares its exact export and terminal gate slices.", + "replay_bindings": { + "mapping": "axiom:nz", + "closure": "axiom_input_closure", + "receipt_contract": "receipt_contract", + "assignment": "assigned snapshot receipt" + }, + "entity_slices": { + "export": { + "person": [ + "age", + "dividend_income", + "farm_self_employment_income", + "interest_income", + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_income_test_assessable_income", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "nonfarm_self_employment_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "private_pension_income", + "realized_capital_gains", + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment", + "rental_income", + "sex", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ], + "household": [ + "donor_support_stratum", + "household_region_code", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "rent", + "source_household_id", + "tenure" + ], + "family": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents", + "family_household_id", + "family_source_household_id" + ] + }, + "gates": { + "person": [ + "age", + "dividend_income", + "farm_self_employment_income", + "interest_income", + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_income_test_assessable_income", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "nonfarm_self_employment_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "private_pension_income", + "realized_capital_gains", + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment", + "rental_income", + "sex", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ], + "household": [ + "donor_support_stratum", + "household_region_code", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "rent", + "source_household_id", + "tenure" + ], + "family": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents", + "family_household_id", + "family_source_household_id" + ] + } + } } diff --git a/packages/microcosm-build/src/microcosm/build/nz/export_replay_bindings.json b/packages/microcosm-build/src/microcosm/build/nz/export_replay_bindings.json new file mode 100644 index 0000000000..afd23a381a --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/export_replay_bindings.json @@ -0,0 +1,4 @@ +{ + "export_contract_sha256": "9483b44ef0646aee4556ec2bce1e744bd102685ebf393d6a3eef5ee1b4b377b5", + "axiom_input_closure_sha256": "1c237a316eecffd8d8eb9258a451b992373b804d72b411895337647c272731aa" +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/gap_annualisation.json b/packages/microcosm-build/src/microcosm/build/nz/gap_annualisation.json new file mode 100644 index 0000000000..77d1804ac5 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/gap_annualisation.json @@ -0,0 +1,4 @@ +{ + "msd_accommodation_supplement_recipients_national": 1, + "msd_annual_report_accommodation_assistance_expenditure": 52 +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/gates.json b/packages/microcosm-build/src/microcosm/build/nz/gates.json index e6a84bb0ad..3376c553bd 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/gates.json +++ b/packages/microcosm-build/src/microcosm/build/nz/gates.json @@ -141,6 +141,7 @@ "parameters": { "formula_owned_columns": [ "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_entitled_weekly_payment", "accommodation_supplement_maximum_weekly_rate", "accommodation_supplement_non_beneficiary_income_reduction", "accommodation_supplement_non_rate_entitlement_requirements", @@ -227,7 +228,8 @@ "V1", "V2", "V3", - "V4" + "V4", + "VHF" ], "required_cells": [ "income_decile_by_family_type/1/single", @@ -281,7 +283,7 @@ "target_maximum_single_donor_dollar_share": 0.05 }, "evidence_absent_blocks": true, - "notes": "MC15: missing, malformed or scenario-incomplete source-household diagnostics block. MC15 suppresses cells below ESS 100, above contribution CV 2 or donor dollar share 10% and excludes them from reported output; proper suppression does not block. The classifier lists structural-zero cells separately. Subgroup rows report entitlement, without invented subgroup payment comparators. G8 addendum A2 explicitly expects structural-zero cells: S0/beneficiary_superannuitant_other/superannuitant, S1/beneficiary_superannuitant_other/superannuitant, S2/beneficiary_superannuitant_other/superannuitant, S3/beneficiary_superannuitant_other/superannuitant. The machine-readable list is reporting_classifiers.json structural_zero_cells; reported amounts determine actual structural-zero diagnostics." + "notes": "MC15: missing, malformed or scenario-incomplete source-household diagnostics block. MC15 suppresses cells below ESS 100, above contribution CV 2 or donor dollar share 10% and excludes them from reported output; proper suppression does not block. The classifier lists structural-zero cells separately. Subgroup rows report entitlement, without invented subgroup payment comparators. G8 addendum A2 explicitly expects structural-zero cells, and MC11's central exclude-and-count adds every variant: S0/beneficiary_superannuitant_other/superannuitant, S1/beneficiary_superannuitant_other/superannuitant, S2/beneficiary_superannuitant_other/superannuitant, S3/beneficiary_superannuitant_other/superannuitant, V1/beneficiary_superannuitant_other/superannuitant, V2/beneficiary_superannuitant_other/superannuitant, V3/beneficiary_superannuitant_other/superannuitant, V4/beneficiary_superannuitant_other/superannuitant, VHF/beneficiary_superannuitant_other/superannuitant. S5 pays superannuitant units, so its cell is not structurally zero. The machine-readable list is reporting_classifiers.json structural_zero_cells; reported amounts determine actual structural-zero diagnostics." }, { "id": "weight_effective_sample_size_target_a", @@ -314,7 +316,8 @@ "V1", "V2", "V3", - "V4" + "V4", + "VHF" ], "required_cells": [ "income_decile_by_family_type/1/single", diff --git a/packages/microcosm-build/src/microcosm/build/nz/geography_assignment.json b/packages/microcosm-build/src/microcosm/build/nz/geography_assignment.json new file mode 100644 index 0000000000..5f1d03f7d8 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/geography_assignment.json @@ -0,0 +1,65 @@ +{ + "version": 1, + "identity": [ + "household_id" + ], + "stream": [ + "sha256-u53-v1", + "nz-joint-geography", + 0, + 21 + ], + "outputs": { + "area": "nz_atomic_area", + "system": "nz_area_system", + "basis": "nz_area_basis" + }, + "systems": [ + { + "id": "nz-joint", + "level": "ta_region_as_area", + "code_system": "stats_nz_joint_ta_regc_as", + "vintage": "ta2026_regc2025_au2017", + "source": "nz_chronicle_facts", + "selector": {}, + "constraints": [], + "observed_area": null, + "stages": [ + { + "level": "area", + "weight": "population" + } + ], + "layers": [ + { + "input": "ta_code", + "output": "ta_code", + "vintage": "ta2026_regc2025_au2017", + "relation": "exact", + "source": "atomic_geography_support.json" + }, + { + "input": "region_code", + "output": "household_region_code", + "vintage": "ta2026_regc2025_au2017", + "relation": "exact", + "source": "atomic_geography_support.json" + }, + { + "input": "as_area", + "output": "as_area", + "vintage": "ta2026_regc2025_au2017", + "relation": "exact", + "source": "atomic_geography_support.json" + }, + { + "input": "as_area_alt", + "output": "as_area_alt", + "vintage": "ta2026_regc2025_au2017", + "relation": "exact", + "source": "atomic_geography_support.json" + } + ] + } + ] +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/holdout_comparator_bindings.json b/packages/microcosm-build/src/microcosm/build/nz/holdout_comparator_bindings.json new file mode 100644 index 0000000000..a054a42024 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/holdout_comparator_bindings.json @@ -0,0 +1,101 @@ +{ + "schema_version": 1, + "central": { + "schema_version": 1, + "required_inputs": { + "family": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_non_rate_entitlement_requirements", + "receipt_group" + ] + }, + "input_domains": { + "family": { + "accommodation_supplement_rounded_weekly_payment": { + "kind": "nonnegative_number" + }, + "accommodation_supplement_non_rate_entitlement_requirements": { + "values": [ + -1, + 0, + 1 + ] + }, + "receipt_group": { + "values": [ + "superannuitant", + "beneficiary", + "other" + ] + } + } + }, + "columns": [ + { + "entity": "family", + "name": "accommodation_supplement_positive_payment_indicator", + "predicates": [ + { + "column": "accommodation_supplement_rounded_weekly_payment", + "operator": "gt", + "value": 0 + }, + { + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "operator": "eq", + "value": 1 + }, + { + "column": "receipt_group", + "operator": "in", + "value": [ + "beneficiary", + "other" + ] + } + ] + } + ] + }, + "s5": { + "schema_version": 1, + "required_inputs": { + "family": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_non_rate_entitlement_requirements" + ] + }, + "input_domains": { + "family": { + "accommodation_supplement_rounded_weekly_payment": { + "kind": "nonnegative_number" + }, + "accommodation_supplement_non_rate_entitlement_requirements": { + "values": [ + -1, + 0, + 1 + ] + } + } + }, + "columns": [ + { + "entity": "family", + "name": "accommodation_supplement_positive_payment_indicator", + "predicates": [ + { + "column": "accommodation_supplement_rounded_weekly_payment", + "operator": "gt", + "value": 0 + }, + { + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "operator": "eq", + "value": 1 + } + ] + } + ] + } +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/holdout_references.json b/packages/microcosm-build/src/microcosm/build/nz/holdout_references.json index 17b772bab9..5127e46c75 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/holdout_references.json +++ b/packages/microcosm-build/src/microcosm/build/nz/holdout_references.json @@ -41,12 +41,12 @@ "method_card_row": "MC5", "holdout_use": "accommodation_supplement_recipient_comparator", "annualisation_factor": "1", - "indicator_input_column": "accommodation_supplement_rounded_weekly_payment", + "indicator_input_column": "accommodation_supplement_entitled_weekly_payment", "indicator_operator": "positive", "indicator_threshold": "0", "measurement_basis": "National positive-payment recipient count; June 2026 snapshot stock, not annual recipients or dollars." }, - "notes": "H1 compares the June 2026 national recipient stock with family units whose accommodation_supplement_rounded_weekly_payment exceeds zero. The declared positive-payment indicator counts each unit once, with factor 1; it never sums dollars. The national fact avoids a Work and Income region to Stats NZ region bridge. MC5 holds this comparison outside calibration." + "notes": "H1 compares the June 2026 national recipient stock with family units whose accommodation_supplement_entitled_weekly_payment exceeds zero: the rounded payment where the engine judges the non-rate entitlement requirements to hold and, outside S5, the unit is not superannuitant. The declared positive-payment indicator counts each unit once, with factor 1; it never sums dollars. The national fact avoids a Work and Income region to Stats NZ region bridge. MC5 holds this comparison outside calibration." }, { "name": "msd_annual_report_accommodation_assistance_expenditure", @@ -70,7 +70,7 @@ "aggregate_fact_key": "ledger.aggregate_fact.v2:10c6ad3bbb19b8137b471748" }, "entity": "family", - "measure": "accommodation_supplement_rounded_weekly_payment", + "measure": "accommodation_supplement_entitled_weekly_payment", "period": 2024, "family": "accommodation_supplement", "metadata": { @@ -88,7 +88,7 @@ "annualisation_factor": "52", "measurement_basis": "Historical fiscal-year 2024/25 Accommodation Assistance expenditure versus annualised model dollars; no period alignment or AS-only scope claim." }, - "notes": "H2 annualises accommodation_supplement_rounded_weekly_payment by 52 and compares model dollars with the historical fiscal-year 2024/25 Accommodation Assistance line in MSD Annual Report 2025. The published appropriation may cover more than Accommodation Supplement; this comparator makes no AS-only scope claim and never uprates the historical observation. The selector pins msd.benefit_expenses.fy2024 because the feed repeats this amount in another record set." + "notes": "H2 annualises accommodation_supplement_entitled_weekly_payment by 52 and compares model dollars with the historical fiscal-year 2024/25 Accommodation Assistance line in MSD Annual Report 2025. The published appropriation may cover more than Accommodation Supplement; this comparator makes no AS-only scope claim and never uprates the historical observation. The selector pins msd.benefit_expenses.fy2024 because the feed repeats this amount in another record set." }, { "name": "treasury_an24_01_accommodation_supplement_fiscal_total", diff --git a/packages/microcosm-build/src/microcosm/build/nz/money_normalization_hold_fixed.json b/packages/microcosm-build/src/microcosm/build/nz/money_normalization_hold_fixed.json new file mode 100644 index 0000000000..807d7199af --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/money_normalization_hold_fixed.json @@ -0,0 +1,110 @@ +{ + "schema_version": 1, + "description": "The hold-fixed sensitivity converts the same donor columns to NZD and holds all four index families fixed at factor one. It uses the central reference-aging profile.", + "status": "The VHF scenario selects this sibling declaration in its own normalization node.", + "from_currency": "USD", + "to_currency": "NZD", + "rate": { + "form": "decimal_text", + "text": "1.654", + "citation": { + "publisher": "Internal Revenue Service", + "title": "Yearly average currency exchange rates", + "url": "https://www.irs.gov/individuals/international-taxpayers/yearly-average-currency-exchange-rates", + "table": "Yearly average exchange rates for converting foreign currencies into U.S. dollars", + "row": "New Zealand, Dollar", + "column": "2024", + "conversion_rule": "\"To convert from U.S. dollars to foreign currency, multiply the U.S. dollar amount by the applicable yearly average exchange rate in the table below.\"", + "page_last_reviewed": "2026-09-17", + "retrieved_on": "2026-10-07", + "retrieved_sha256": "8c765c8c88a6a6ad4fe325a0344ff69d2fa2ab174dcac2e8c13e1a5ea747fff8", + "retrieved_note": "SHA-256 of the HTML bytes fetched on the retrieval date; the page is re-rendered by the publisher, so it is a receipt, not a stable content key." + } + }, + "quote": "to_per_from", + "rounding": { + "digits": 2, + "mode": "half_even" + }, + "donor_money_period": { + "type": "calendar_year", + "value": 2024, + "basis": "declared_convention", + "evidence": [ + "tools/build_us_fiscal_refresh_release.py declares the module constant PERIOD = 2024, and its _dataset_from_frame passes PERIOD as time_period to USSingleYearDataset.", + "microcosm.frame.adapters.policyengine_us.PolicyEngineUSEngine._write_and_verify writes the supplied model period as a one-row integer _time_period table. This is model-period lineage evidence, not authentication of the monetary basis of donor amounts." + ] + }, + "target_period": 2027, + "columns": { + "person": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ], + "household": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + }, + "factor_profile": { + "dimension": "aging_index", + "profiles": [ + "low", + "central", + "high" + ], + "central_profile": "central" + }, + "index_family_factors": { + "mixed_income": { + "identity": true, + "reason": "The declared hold-fixed sensitivity holds this donor index family at factor one." + }, + "capital_income": { + "identity": true, + "reason": "The declared hold-fixed sensitivity holds this donor index family at factor one." + }, + "pensions": { + "identity": true, + "reason": "The declared hold-fixed sensitivity holds this donor index family at factor one." + }, + "owner_housing_costs": { + "identity": true, + "reason": "The declared hold-fixed sensitivity holds this donor index family at factor one." + } + }, + "cents_suffix": "_cents", + "quantile_mapped": { + "person": { + "employment_income": { + "awaits": [ + "P1: precal_references ird_wage_salary_people_by_band rows 7 to 241" + ], + "reason": "MC4 quantile-maps earnings onto IRD wage bands; P1 is parked until its source-period wage bridge and intervals exist (d1952 option A, earnings first)." + }, + "liquid_financial_assets": { + "awaits": [ + "P3: precal_references stats_nz_household_financial_net_worth_distribution", + "C2: an all-household liquid-asset distribution" + ], + "reason": "MC4 quantile-maps liquid assets; no all-household distribution exists yet (C2), and any interim producer is Max's call (M1)." + } + }, + "household": { + "rent": { + "awaits": [ + "C1: Census 2023 household weekly rent bands (G8-d1)" + ], + "reason": "MC4 quantile-maps rent onto the Census 2023 weekly-rent bands for renting households (C1); the MBIE bond reference P2 is parked." + } + } + }, + "pending": {}, + "notes": "The rate is the IRS 2024 yearly average for the New Zealand dollar, quoted in NZD per USD, so a donor amount is multiplied by it. Calendar-2024 money is a declared convention covering flows and asset stocks; the donor monetary basis has not been authenticated against a producing manifest. The US build's PERIOD = 2024 and the exporter's _time_period write provide model-period lineage evidence. Money normalization refuses a donor whose recorded _time_period differs from calendar 2024 (G8-w H1); this runtime check is a consistency check, not authentication. No donor file is opened to establish this declaration. Variants V1 and V2 age with their own aging_index profile (G8-w H2). public_pension_income is dropped at CREATE and is not declared." +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/precalibration_stages.json b/packages/microcosm-build/src/microcosm/build/nz/precalibration_stages.json index 2b428e419b..e49b327338 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/precalibration_stages.json +++ b/packages/microcosm-build/src/microcosm/build/nz/precalibration_stages.json @@ -22,7 +22,24 @@ "purpose": "calibration_measure" } ], - "citation": "https://github.com/TheAxiomFoundation/rulespec-nz/blob/8dc2507d5f10a0467c285fed54d018ee37246798/nz/statutes/social_security/main_benefits/rates.yaml (SHA-256 7c8ebbc3e62268722529ad790e3f561bbebf807d8a4d67bba24f93cb0809ec39); https://www.workandincome.govt.nz/products/benefit-rates/benefit-rates-april-2026.html. The rates stage supplies after-tax payments after abatement." + "derived_outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "purpose": "calibration_measure" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "purpose": "calibration_measure" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "purpose": "calibration_measure" + } + ], + "citation": "https://github.com/TheAxiomFoundation/rulespec-nz/blob/8dc2507d5f10a0467c285fed54d018ee37246798/nz/statutes/social_security/main_benefits/rates.yaml (SHA-256 7c8ebbc3e62268722529ad790e3f561bbebf807d8a4d67bba24f93cb0809ec39); https://www.workandincome.govt.nz/products/benefit-rates/benefit-rates-april-2026.html. The rates stage supplies after-tax payments after abatement, and its cents node rounds them half-even to the whole cents MSD pays." }, { "id": "nz.precal.benefit_gross_up", diff --git a/packages/microcosm-build/src/microcosm/build/nz/reporting_classifiers.json b/packages/microcosm-build/src/microcosm/build/nz/reporting_classifiers.json index 62de0fa6b3..63410e30fb 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/reporting_classifiers.json +++ b/packages/microcosm-build/src/microcosm/build/nz/reporting_classifiers.json @@ -66,26 +66,26 @@ }, { "entity": "person", - "column": "jobseeker_support_gross_weekly_payment", + "column": "jobseeker_support_annual_gross", "kind": "benefit", "tax_basis": "before_tax", - "annualisation_factor": 52, + "annualisation_factor": 1, "receipt_column": "receives_jobseeker_support" }, { "entity": "person", - "column": "sole_parent_support_gross_weekly_payment", + "column": "sole_parent_support_annual_gross", "kind": "benefit", "tax_basis": "before_tax", - "annualisation_factor": 52, + "annualisation_factor": 1, "receipt_column": "receives_sole_parent_support" }, { "entity": "person", - "column": "supported_living_payment_gross_weekly_payment", + "column": "supported_living_payment_annual_gross", "kind": "benefit", "tax_basis": "before_tax", - "annualisation_factor": 52, + "annualisation_factor": 1, "receipt_column": "receives_supported_living_payment" }, { @@ -168,7 +168,8 @@ "V1", "V2", "V3", - "V4" + "V4", + "VHF" ], "join_column": "family_id", "variant_rule": "carry_baseline_cell_by_unit_id", @@ -249,6 +250,26 @@ { "scenario": "S3", "cell": "beneficiary_superannuitant_other/superannuitant" + }, + { + "scenario": "V1", + "cell": "beneficiary_superannuitant_other/superannuitant" + }, + { + "scenario": "V2", + "cell": "beneficiary_superannuitant_other/superannuitant" + }, + { + "scenario": "V3", + "cell": "beneficiary_superannuitant_other/superannuitant" + }, + { + "scenario": "V4", + "cell": "beneficiary_superannuitant_other/superannuitant" + }, + { + "scenario": "VHF", + "cell": "beneficiary_superannuitant_other/superannuitant" } ], "structural_zero_citation": { diff --git a/packages/microcosm-build/src/microcosm/build/nz/scenarios.json b/packages/microcosm-build/src/microcosm/build/nz/scenarios.json index 0c9d418dbb..37f66861c1 100644 --- a/packages/microcosm-build/src/microcosm/build/nz/scenarios.json +++ b/packages/microcosm-build/src/microcosm/build/nz/scenarios.json @@ -2,11 +2,11 @@ "version": 1, "country": "nz", "method_card_row": "MC3", - "description": "The hub declares Accommodation Supplement entitlement scenarios S0, S1, S2, S3 and S5 after calibration, and calibration variants V1 to V4 from the raw nz.open branch. Each non-central scenario changes one central knob. Bands report the minimum, S0 and maximum gap across the declared scenarios and identify each bound-setting scenario.", + "description": "The hub declares Accommodation Supplement entitlement scenarios S0, S1, S2, S3 and S5 after calibration, and calibration variants V1 to V4 and the VHF hold-fixed sensitivity from the raw nz.open branch. Each non-central scenario changes one central knob. Bands report the minimum, S0 and maximum gap across the declared scenarios and identify each bound-setting scenario.", "status": "The hub adopts the declared scenario set under H7; C1 rent ageing and D2 publication approval remain open.", "tiers": { "entitlement": { - "branch_point": "nz.as" + "branch_point": "nz.as.bridge" }, "calibration": { "branch_point": "nz.open" @@ -20,7 +20,8 @@ "superannuitant_treatment": "exclude_and_count", "aging_index": "central", "beneficiary_assignment": "central", - "census_residual_allocation": "mar" + "census_residual_allocation": "mar", + "donor_money_index": "awe" }, "knob_domains": { "rent_allocation": [ @@ -52,6 +53,10 @@ "census_residual_allocation": [ "mar", "small_households" + ], + "donor_money_index": [ + "awe", + "hold_fixed" ] }, "knob_method_card_rows": { @@ -62,7 +67,8 @@ "superannuitant_treatment": "MC11", "aging_index": "MC5", "beneficiary_assignment": "MC6", - "census_residual_allocation": "MC5" + "census_residual_allocation": "MC5", + "donor_money_index": "MC5" }, "scenarios": [ { @@ -70,7 +76,669 @@ "tier": "entitlement", "method_card_row": "MC3", "knobs": {}, - "description": "central defaults: the central value of every MC3 band" + "description": "central defaults: the central value of every MC3 band", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.scn.S0", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.S0.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S0", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.scn.S0.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.S0", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.S0.income_decile", + "kernel": "reporting.income_decile@1", + "structural": "none", + "population": "nz.scn.S0", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "dividend_income", + "employment_income", + "farm_self_employment_income", + "interest_income", + "jobseeker_support_annual_gross", + "nonfarm_self_employment_income", + "nz_super_weekly_amount_before_tax", + "private_pension_income", + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment", + "rental_income", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S0", + "entities": [ + "person", + "household", + "family" + ] + } + }, + { + "id": "nz.scn.S0.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.S0", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S0" + } + }, + { + "id": "nz.scn.S0.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S0", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S0.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S0", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.S0.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.S0", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "S0" + } + } + ] }, { "id": "S1", @@ -85,70 +753,25638 @@ "variable": "accommodation_supplement_cash_assets", "value": 0 } - ] - }, - { - "id": "S2", - "tier": "entitlement", - "method_card_row": "MC8", - "knobs": { - "rent_allocation": "per_adult_share" - }, - "description": "household rent split per adult share instead of allocated to the reference unit (upper sensitivity)" - }, - { - "id": "S3", - "tier": "entitlement", - "method_card_row": "MC9", - "knobs": { - "area_column": "as_area_alt" - }, - "description": "the alternative territorial authority to Accommodation Supplement area crosswalk (as_area_crosswalk.json alternative)" - }, - { - "id": "S5", - "tier": "entitlement", - "method_card_row": "MC11", - "knobs": { - "superannuitant_treatment": "reg17_superannuitant_base_rate" - }, - "description": "reg 17 superannuitant treatment, the alternative to the MC11 default. The override is the engine-calling bridge, which rewrites the base rate; a non-engine override would hand-compute policy (as_rate_bridge.json superannuitant_units)" - }, - { - "id": "V1", - "tier": "calibration", - "method_card_row": "MC5", - "knobs": { - "aging_index": "low" - }, - "description": "low aging index for the calibration references (MC5 ages IRD bands from TY2024 to TY2026-27 by a declared index)" - }, - { - "id": "V2", - "tier": "calibration", - "method_card_row": "MC5", - "knobs": { - "aging_index": "high" - }, - "description": "high aging index" - }, - { - "id": "V3", - "tier": "calibration", - "method_card_row": "MC6", - "knobs": { - "beneficiary_assignment": "variant" - }, - "description": "V3 starts from the raw nz.open branch and uses the resolved beneficiary_assignment variant profile in receipt_contract.json to draw a separate deterministic receipt stream for NZ Super, SLP, SPS and JS with the same targets and eligibility definitions." - }, - { - "id": "V4", - "tier": "calibration", - "method_card_row": "MC5", - "knobs": { - "census_residual_allocation": "small_households" + ], + "encoding_knobs": { + "asset_test": false }, - "description": "d1886: allocate each region's Census size residual only to one- and two-person households in their stated proportions; tenure remains proportionally allocated" + "nodes": [ + { + "id": "nz.scn.S1", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.S1.inputs", + "kernel": "transport.scenario_override@1", + "population": "nz.scn.S1", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64", + "rewrite": true + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S1.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S1", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.scn.S1.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.S1", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.S1.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.scn.S1", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S1", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.scn.S1.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.S1", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S1" + } + }, + { + "id": "nz.scn.S1.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S1", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S1.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S1", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.S1.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.S1", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "S1" + } + } + ] + }, + { + "id": "S2", + "tier": "entitlement", + "method_card_row": "MC8", + "knobs": { + "rent_allocation": "per_adult_share" + }, + "description": "household rent split per adult share instead of allocated to the reference unit (upper sensitivity)", + "encoding_knobs": { + "rent_allocation": "per_adult_share" + }, + "nodes": [ + { + "id": "nz.scn.S2", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.S2.inputs", + "kernel": "transport.scenario_override@1", + "population": "nz.scn.S2", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64", + "rewrite": true + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S2.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S2", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.scn.S2.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.S2", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.S2.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.scn.S2", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S2", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.scn.S2.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.S2", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S2" + } + }, + { + "id": "nz.scn.S2.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S2", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S2.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S2", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.S2.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.S2", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "S2" + } + } + ] + }, + { + "id": "S3", + "tier": "entitlement", + "method_card_row": "MC9", + "knobs": { + "area_column": "as_area_alt" + }, + "description": "the alternative territorial authority to Accommodation Supplement area crosswalk (as_area_crosswalk.json alternative)", + "encoding_knobs": { + "area_column": "as_area_alt" + }, + "nodes": [ + { + "id": "nz.scn.S3", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.S3.inputs", + "kernel": "transport.scenario_override@1", + "population": "nz.scn.S3", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64", + "rewrite": true + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S3.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S3", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.scn.S3.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.S3", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.S3.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.scn.S3", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S3", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.scn.S3.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.S3", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S3" + } + }, + { + "id": "nz.scn.S3.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S3", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S3.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S3", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.S3.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.S3", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "S3" + } + } + ] + }, + { + "id": "S5", + "tier": "entitlement", + "method_card_row": "MC11", + "knobs": { + "superannuitant_treatment": "reg17_superannuitant_base_rate" + }, + "description": "reg 17 superannuitant treatment, the alternative to the MC11 default. The override is the engine-calling bridge, which rewrites the base rate; a non-engine override would hand-compute policy (as_rate_bridge.json superannuitant_units)", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.scn.S5", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as.bridge", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.scn.S5.bridge.superannuitant_masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S5", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_partnered", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_non_superannuitant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_partnered_non_superannuitant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_superannuitant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_partnered_superannuitant", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "superannuitant_units", + "s5_mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S5.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S5", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_partnered_non_superannuitant", + "accommodation_supplement_bridge_partnered_superannuitant", + "accommodation_supplement_bridge_single_non_superannuitant", + "accommodation_supplement_bridge_single_superannuitant", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_single_non_superannuitant", + "equals": true + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_partnered_non_superannuitant", + "equals": true + } + }, + { + "variable": "nz_super_weekly_amount_before_tax", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "nz_super", + "field": "engine_ref" + }, + "aggregation": "max", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_single_superannuitant", + "equals": true + } + }, + { + "variable": "nz_super_weekly_amount_before_tax", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "nz_super", + "field": "engine_ref" + }, + "aggregation": "max", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_partnered_superannuitant", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + }, + { + "engine_ref": { + "binding": "nz_super", + "field": "engine_ref" + }, + "period": { + "binding": "nz_super", + "field": "period" + }, + "variables": [ + "nz_super_weekly_amount_before_tax" + ], + "input_overrides": [] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the S5 reg 17 base rate, with NZ Superannuation before tax for superannuitant units." + }, + { + "id": "nz.scn.S5.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.scn.S5", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.scn.S5.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.scn.S5", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S5", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.scn.S5.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.scn.S5", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "S5" + } + }, + { + "id": "nz.scn.S5.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.scn.S5", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "s5" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.scn.S5.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.scn.S5", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.scn.S5.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.scn.S5", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "S5" + } + } + ] + }, + { + "id": "V1", + "tier": "calibration", + "method_card_row": "MC5", + "knobs": { + "aging_index": "low" + }, + "description": "low aging index for the calibration references (MC5 ages IRD bands from TY2024 to TY2026-27 by a declared index)", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.v.V1", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V1.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.v.V1", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": { + "scenario": "knobs", + "encoding": "json" + } + } + }, + { + "id": "nz.v.V1.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.v.V1", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.v.V1.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V1", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.v.V1.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V1", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.v.V1.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V1", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.v.V1.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V1.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V1.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V1.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V1.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V1.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V1.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.v.V1", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.v.V1.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.v.V1", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.v.V1.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.v.V1", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V1.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.v.V1", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V1.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.v.V1", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.v.V1.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.v.V1.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.v.V1.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.v.V1", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.v.V1.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.v.V1.housing", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.v.V1.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V1.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.v.V1.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V1.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V1.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V1.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.v.V1.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + }, + { + "id": "nz.v.V1.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.v.V1.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.v.V1.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.v.V1.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V1", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.v.V1.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.v.V1.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V1" + } + }, + { + "id": "nz.v.V1.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V1.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V1.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.v.V1.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.v.V1.housing", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "V1" + } + } + ] + }, + { + "id": "V2", + "tier": "calibration", + "method_card_row": "MC5", + "knobs": { + "aging_index": "high" + }, + "description": "high aging index", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.v.V2", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V2.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.v.V2", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": { + "scenario": "knobs", + "encoding": "json" + } + } + }, + { + "id": "nz.v.V2.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.v.V2", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.v.V2.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V2", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.v.V2.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V2", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.v.V2.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V2", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.v.V2.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V2.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V2.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V2.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V2.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V2.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V2.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.v.V2", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.v.V2.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.v.V2", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.v.V2.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.v.V2", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V2.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.v.V2", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V2.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.v.V2", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.v.V2.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.v.V2.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.v.V2.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.v.V2", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.v.V2.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.v.V2.housing", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.v.V2.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V2.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.v.V2.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V2.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V2.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V2.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.v.V2.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + }, + { + "id": "nz.v.V2.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.v.V2.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.v.V2.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.v.V2.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V2", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.v.V2.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.v.V2.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V2" + } + }, + { + "id": "nz.v.V2.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V2.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V2.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.v.V2.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.v.V2.housing", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "V2" + } + } + ] + }, + { + "id": "V3", + "tier": "calibration", + "method_card_row": "MC6", + "knobs": { + "beneficiary_assignment": "variant" + }, + "description": "V3 starts from the raw nz.open branch and uses the resolved beneficiary_assignment variant profile in receipt_contract.json to draw a separate deterministic receipt stream for NZ Super, SLP, SPS and JS with the same targets and eligibility definitions.", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.v.V3", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V3.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.v.V3", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": { + "scenario": "knobs", + "encoding": "json" + } + } + }, + { + "id": "nz.v.V3.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.v.V3", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.v.V3.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V3", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.v.V3.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V3", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.v.V3.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V3", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.v.V3.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V3.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V3.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V3.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V3.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V3.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V3.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.v.V3", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.v.V3.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.v.V3", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.v.V3.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.v.V3", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V3.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.v.V3", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V3.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.v.V3", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.v.V3.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.v.V3.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.v.V3.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.v.V3", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.v.V3.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.v.V3.housing", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.v.V3.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V3.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.v.V3.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V3.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V3.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V3.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.v.V3.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + }, + { + "id": "nz.v.V3.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.v.V3.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.v.V3.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.v.V3.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V3", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.v.V3.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.v.V3.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V3" + } + }, + { + "id": "nz.v.V3.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V3.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V3.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.v.V3.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.v.V3.housing", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "V3" + } + } + ] + }, + { + "id": "V4", + "tier": "calibration", + "method_card_row": "MC5", + "knobs": { + "census_residual_allocation": "small_households" + }, + "description": "d1886: allocate each region's Census size residual only to one- and two-person households in their stated proportions; tenure remains proportionally allocated", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.v.V4", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V4.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.v.V4", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": { + "scenario": "knobs", + "encoding": "json" + } + } + }, + { + "id": "nz.v.V4.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.v.V4", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.v.V4.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V4", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.v.V4.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V4", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.v.V4.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.V4", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.v.V4.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V4.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V4.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V4.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.V4.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V4.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.V4.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.v.V4", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.v.V4.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.v.V4", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.v.V4.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.v.V4", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V4.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.v.V4", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V4.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.v.V4", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.v.V4.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.v.V4.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.v.V4.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.v.V4", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.v.V4.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.v.V4.housing", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.v.V4.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.V4.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.v.V4.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V4.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V4.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V4.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.v.V4.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + }, + { + "id": "nz.v.V4.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.v.V4.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.v.V4.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.v.V4.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V4", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.v.V4.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.v.V4.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "V4" + } + }, + { + "id": "nz.v.V4.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.V4.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.V4.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.v.V4.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.v.V4.housing", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "V4" + } + } + ] + }, + { + "id": "VHF", + "tier": "calibration", + "method_card_row": "MC5", + "knobs": { + "donor_money_index": "hold_fixed" + }, + "description": "The hold-fixed sensitivity keeps all four donor index families at identity factors in its own money-normalization declaration while references retain the central aging profile.", + "encoding_knobs": {}, + "nodes": [ + { + "id": "nz.v.VHF", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.VHF.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.v.VHF", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization_hold_fixed", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization_hold_fixed", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": { + "scenario": "knobs", + "encoding": "json" + } + } + }, + { + "id": "nz.v.VHF.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.v.VHF", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.v.VHF.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.VHF", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.v.VHF.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.VHF", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.v.VHF.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.v.VHF", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.v.VHF.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.VHF.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.VHF.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.VHF.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.v.VHF.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.VHF.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.v.VHF.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.v.VHF", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.v.VHF.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.v.VHF", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.v.VHF.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.v.VHF", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.VHF.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.v.VHF", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.VHF.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.v.VHF", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.v.VHF.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.v.VHF.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.v.VHF.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.v.VHF", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.v.VHF.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.v.VHF.housing", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.v.VHF.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "params": {} + }, + { + "id": "nz.v.VHF.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.v.VHF.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "scenario": "encoding_knobs", + "encoding": "json" + }, + "scenario_sha256": { + "scenario": "encoding_knobs", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.VHF.bridge.masks", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "is_single", + "n_dependent_children" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_bridge_single_without_dependent_child", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "as_rate_bridge", + "encoding": "json", + "path": [ + "mask_bindings" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.VHF.bridge.sole_parent_gross_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_gross_weekly_rate" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_single", + "value": true + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "value": 1 + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "value": 0 + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_gross_weekly_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents." + }, + { + "id": "nz.v.VHF.bridge.cutout", + "kernel": "simulate.solve_zero@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "accommodation_supplement_bridge_sole_parent_gross_rate", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment", + "jobseeker_support_weekly_income_test_reduction" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_single_without_dependent_child" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": false + } + }, + { + "variable": "jobseeker_support_weekly_income_test_reduction", + "coefficient": -1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_sole_parent", + "equals": true + } + }, + { + "source_entity": "family", + "source_column": "accommodation_supplement_bridge_sole_parent_gross_rate", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" + } + ], + "solve_input": { + "entity": "person", + "column": "jobseeker_support_total_income" + }, + "bracket": [ + 0, + 5000 + ], + "tolerance": 1e-09, + "iterations": 43, + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout." + }, + { + "id": "nz.v.VHF.bridge.base_rate", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_bridge_has_dependent_child", + "accommodation_supplement_bridge_single_without_dependent_child", + "is_partnered", + "is_single", + "is_sole_parent", + "n_dependent_children", + "youngest_dependent_child_age" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "variables": [ + "jobseeker_support_net_weekly_payment" + ], + "input_overrides": [ + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "value": 25 + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "source_entity": "family", + "source_column": "n_dependent_children" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "source_entity": "family", + "source_column": "is_partnered" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "source_entity": "family", + "source_column": "is_single" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "value": false + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "source_entity": "family", + "source_column": "youngest_dependent_child_age", + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "value": 0 + } + ], + "output_coefficients": [ + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": false + } + }, + { + "variable": "jobseeker_support_net_weekly_payment", + "coefficient": 2, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "aggregation": "first", + "mask": { + "entity": "family", + "column": "is_partnered", + "equals": true + } + }, + { + "variable": "family_tax_credit_prescribed_amount", + "coefficient": 0.019230769230769232, + "entity": "family", + "column": "accommodation_supplement_base_rate_weekly_amount", + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "mask": { + "entity": "family", + "column": "accommodation_supplement_bridge_has_dependent_child", + "equals": true + } + } + ], + "components": [ + { + "engine_ref": { + "binding": "family_tax_credits", + "field": "engine_ref" + }, + "period": { + "binding": "family_tax_credits", + "field": "period" + }, + "variables": [ + "family_tax_credit_prescribed_amount" + ], + "input_overrides": [ + { + "entity": "family", + "column": "family_tax_credit_eldest_dependent_child_care_units", + "value": 1 + }, + { + "entity": "family", + "column": "family_tax_credit_subsequent_dependent_child_care_units", + "value": 0 + } + ] + } + ], + "resource_sha256": { + "resource": "as_rate_bridge", + "encoding": "sha256" + } + }, + "description": "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + }, + { + "id": "nz.v.VHF.as", + "kernel": "simulate.rules_by_ref@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_rounded_weekly_payment", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_amount_before_rounding", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets_within_limit", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_other_funding_exclusion_not_applies", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary_income_reduction", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_qualifying_accommodation_costs", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_maximum_weekly_rate", + "dtype": "float64" + } + ], + "rules_binding": "accommodation_supplement", + "params": { + "variables": [ + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_weekly_amount_before_rounding", + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + "accommodation_supplement_non_beneficiary_income_reduction", + "accommodation_supplement_weekly_qualifying_accommodation_costs", + "accommodation_supplement_maximum_weekly_rate" + ] + } + }, + { + "id": "nz.v.VHF.income_decile", + "kernel": "reporting.carry_income_decile@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "income_decile", + "dtype": "int64" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "income_decile" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "VHF", + "entities": [ + "person", + "household", + "family" + ] + }, + "artifact_inputs": [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells" + } + ] + }, + { + "id": "nz.v.VHF.receipt_group", + "kernel": "reporting.receipt_group@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment" + ] + }, + { + "entity": "family", + "columns": [ + "family_type" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "receipt_group", + "dtype": "string" + } + ], + "params": { + "classifier": { + "resource": "reporting_classifiers", + "encoding": "json", + "path": [ + "receipt_group" + ] + }, + "classifier_sha256": { + "resource": "reporting_classifiers", + "encoding": "sha256" + }, + "scenario": "VHF" + } + }, + { + "id": "nz.v.VHF.positive_payment", + "kernel": "calibration.prepare@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "inputs": [ + { + "entity": "family", + "columns": [ + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_rounded_weekly_payment", + "receipt_group" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "dtype": "bool" + } + ], + "params": { + "bindings": { + "resource": "holdout_comparator_bindings", + "encoding": "json", + "path": [ + "central" + ] + }, + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + } + } + }, + { + "id": "nz.v.VHF.as.entitled", + "kernel": "simulate.counterfactual@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "rulespec_nz" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_base_rate_weekly_amount", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_positive_payment_indicator", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "accommodation_supplement", + "field": "engine_ref" + }, + "period": { + "binding": "accommodation_supplement", + "field": "period" + }, + "variables": [ + "accommodation_supplement_rounded_weekly_payment" + ], + "input_overrides": [], + "output_coefficients": [ + { + "variable": "accommodation_supplement_rounded_weekly_payment", + "coefficient": 1, + "entity": "family", + "column": "accommodation_supplement_entitled_weekly_payment", + "mask": { + "entity": "family", + "column": "accommodation_supplement_positive_payment_indicator", + "equals": true + } + } + ] + }, + "description": "The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere." + }, + { + "id": "nz.v.VHF.gap", + "kernel": "takeup.gap@1", + "structural": "none", + "population": "nz.v.VHF.housing", + "sources": [ + "nz_holdout_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + }, + { + "entity": "household", + "columns": [ + "source_household_id" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_entitled_weekly_payment", + "accommodation_supplement_positive_payment_indicator", + "family_type", + "income_decile", + "receipt_group" + ] + } + ], + "params": { + "country": "nz", + "references": { + "resource": "holdout_references", + "encoding": "json" + }, + "references_sha256": { + "resource": "holdout_references", + "encoding": "sha256" + }, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "annualisation_factors": { + "resource": "gap_annualisation", + "encoding": "json" + }, + "annualisation_sha256": { + "resource": "gap_annualisation", + "encoding": "sha256" + }, + "scenario": "VHF" + } + } + ] } ], "gap_conventions": { @@ -166,7 +26402,7 @@ }, "reporting_cells": { "entity": "family", - "measure": "accommodation_supplement_rounded_weekly_payment", + "measure": "accommodation_supplement_entitled_weekly_payment", "period": "2026-27", "annualisation_factor": 52, "tables": [ diff --git a/packages/microcosm-build/src/microcosm/build/nz/transport_atomic_geography_support.json b/packages/microcosm-build/src/microcosm/build/nz/transport_atomic_geography_support.json new file mode 100644 index 0000000000..6e6e17011d --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/transport_atomic_geography_support.json @@ -0,0 +1,1734 @@ +{ + "version": 1, + "level": "ta_region_as_area", + "code_system": "stats_nz_joint_ta_regc_as", + "vintage": "ta2026_regc2025_au2017", + "columns": { + "area": { + "kind": "code", + "source": "Stats NZ Meshblock Higher Geographies 2026; G8-m SA1 to AS placement", + "vintage": "ta2026_regc2025_au2017", + "relation": "exact" + }, + "ta_code": { + "kind": "code", + "source": "Stats NZ Meshblock Higher Geographies 2026", + "vintage": "ta_2026", + "relation": "official_tabulation" + }, + "region_code": { + "kind": "code", + "source": "Stats NZ Meshblock Higher Geographies 2026", + "vintage": "regc_2025", + "relation": "official_tabulation" + }, + "as_area": { + "kind": "code", + "source": "G8-m SA1 interior-point/centroid AU2017 bridge", + "vintage": "au_2017", + "relation": "best_fit" + }, + "population_code": { + "kind": "code", + "source": "Stats NZ TA ERP target hierarchy", + "vintage": "ta_2025", + "relation": "exact" + }, + "population": { + "kind": "weight", + "source": "Stats NZ TA ERP at 30 June 2025", + "basis": "TA ERP apportioned by within-TA 2023 Census SA1 usually resident population shares" + }, + "as_area_alt": { + "kind": "code", + "source": "as_area_crosswalk.json modal_area", + "vintage": "ta_2025", + "relation": "best_fit" + } + }, + "rows": [ + { + "target": "stats_nz_population_by_territorial_authority__ta001", + "codes": { + "area": "001|01|2", + "ta_code": "001", + "region_code": "01", + "as_area": "2", + "population_code": "nz-ta-001", + "as_area_alt": "4" + }, + "population_share": 0.11744924124595402 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta001", + "codes": { + "area": "001|01|3", + "ta_code": "001", + "region_code": "01", + "as_area": "3", + "population_code": "nz-ta-001", + "as_area_alt": "4" + }, + "population_share": 0.24364201942074068 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta001", + "codes": { + "area": "001|01|4", + "ta_code": "001", + "region_code": "01", + "as_area": "4", + "population_code": "nz-ta-001", + "as_area_alt": "4" + }, + "population_share": 0.6389087393333053 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta002", + "codes": { + "area": "002|01|2", + "ta_code": "002", + "region_code": "01", + "as_area": "2", + "population_code": "nz-ta-002", + "as_area_alt": "2" + }, + "population_share": 0.6245147666221545 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta002", + "codes": { + "area": "002|01|4", + "ta_code": "002", + "region_code": "01", + "as_area": "4", + "population_code": "nz-ta-002", + "as_area_alt": "2" + }, + "population_share": 0.3754852333778454 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta003", + "codes": { + "area": "003|01|2", + "ta_code": "003", + "region_code": "01", + "as_area": "2", + "population_code": "nz-ta-003", + "as_area_alt": "4" + }, + "population_share": 0.20433221359898066 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta003", + "codes": { + "area": "003|01|3", + "ta_code": "003", + "region_code": "01", + "as_area": "3", + "population_code": "nz-ta-003", + "as_area_alt": "4" + }, + "population_share": 0.19390710066025715 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta003", + "codes": { + "area": "003|01|4", + "ta_code": "003", + "region_code": "01", + "as_area": "4", + "population_code": "nz-ta-003", + "as_area_alt": "4" + }, + "population_share": 0.6017606857407622 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta011", + "codes": { + "area": "011|03|2", + "ta_code": "011", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-011", + "as_area_alt": "4" + }, + "population_share": 0.31483737932327305 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta011", + "codes": { + "area": "011|03|3", + "ta_code": "011", + "region_code": "03", + "as_area": "3", + "population_code": "nz-ta-011", + "as_area_alt": "4" + }, + "population_share": 0.32533508295060454 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta011", + "codes": { + "area": "011|03|4", + "ta_code": "011", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-011", + "as_area_alt": "4" + }, + "population_share": 0.3598275377261224 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta012", + "codes": { + "area": "012|03|2", + "ta_code": "012", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-012", + "as_area_alt": "3" + }, + "population_share": 0.054350887074063645 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta012", + "codes": { + "area": "012|03|3", + "ta_code": "012", + "region_code": "03", + "as_area": "3", + "population_code": "nz-ta-012", + "as_area_alt": "3" + }, + "population_share": 0.5385806814981695 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta012", + "codes": { + "area": "012|03|4", + "ta_code": "012", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-012", + "as_area_alt": "3" + }, + "population_share": 0.40706843142776683 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta013", + "codes": { + "area": "013|03|1", + "ta_code": "013", + "region_code": "03", + "as_area": "1", + "population_code": "nz-ta-013", + "as_area_alt": "2" + }, + "population_share": 0.16983173916079033 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta013", + "codes": { + "area": "013|03|2", + "ta_code": "013", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-013", + "as_area_alt": "2" + }, + "population_share": 0.5660825246107659 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta013", + "codes": { + "area": "013|03|3", + "ta_code": "013", + "region_code": "03", + "as_area": "3", + "population_code": "nz-ta-013", + "as_area_alt": "2" + }, + "population_share": 0.09578998813097815 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta013", + "codes": { + "area": "013|03|4", + "ta_code": "013", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-013", + "as_area_alt": "2" + }, + "population_share": 0.16829574809746561 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta015", + "codes": { + "area": "015|03|2", + "ta_code": "015", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-015", + "as_area_alt": "4" + }, + "population_share": 0.2387878787878788 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta015", + "codes": { + "area": "015|03|3", + "ta_code": "015", + "region_code": "03", + "as_area": "3", + "population_code": "nz-ta-015", + "as_area_alt": "4" + }, + "population_share": 0.34715151515151516 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta015", + "codes": { + "area": "015|03|4", + "ta_code": "015", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-015", + "as_area_alt": "4" + }, + "population_share": 0.4140606060606061 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta016", + "codes": { + "area": "016|03|2", + "ta_code": "016", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-016", + "as_area_alt": "2" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta017", + "codes": { + "area": "017|03|2", + "ta_code": "017", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-017", + "as_area_alt": "2" + }, + "population_share": 0.8063081484510787 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta017", + "codes": { + "area": "017|03|4", + "ta_code": "017", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-017", + "as_area_alt": "2" + }, + "population_share": 0.19369185154892138 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta018", + "codes": { + "area": "018|03|3", + "ta_code": "018", + "region_code": "03", + "as_area": "3", + "population_code": "nz-ta-018", + "as_area_alt": "4" + }, + "population_share": 0.2672811059907834 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta018", + "codes": { + "area": "018|03|4", + "ta_code": "018", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-018", + "as_area_alt": "4" + }, + "population_share": 0.7327188940092166 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta019", + "codes": { + "area": "019|03|4", + "ta_code": "019", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-019", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta020", + "codes": { + "area": "020|03|4", + "ta_code": "020", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-020", + "as_area_alt": "4" + }, + "population_share": 0.995302223614156 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta020", + "codes": { + "area": "020|08|4", + "ta_code": "020", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-020", + "as_area_alt": "4" + }, + "population_share": 0.004697776385844034 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta021", + "codes": { + "area": "021|03|2", + "ta_code": "021", + "region_code": "03", + "as_area": "2", + "population_code": "nz-ta-021", + "as_area_alt": "2" + }, + "population_share": 0.6471157424637142 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta021", + "codes": { + "area": "021|03|4", + "ta_code": "021", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-021", + "as_area_alt": "2" + }, + "population_share": 0.34774841831038333 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta021", + "codes": { + "area": "021|04|4", + "ta_code": "021", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-021", + "as_area_alt": "2" + }, + "population_share": 0.0030517305545217713 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta021", + "codes": { + "area": "021|06|4", + "ta_code": "021", + "region_code": "06", + "as_area": "4", + "population_code": "nz-ta-021", + "as_area_alt": "2" + }, + "population_share": 0.002084108671380722 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta021", + "codes": { + "area": "021|08|4", + "ta_code": "021", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-021", + "as_area_alt": "2" + }, + "population_share": 0.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta022", + "codes": { + "area": "022|04|1", + "ta_code": "022", + "region_code": "04", + "as_area": "1", + "population_code": "nz-ta-022", + "as_area_alt": "4" + }, + "population_share": 0.16740487752814984 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta022", + "codes": { + "area": "022|04|2", + "ta_code": "022", + "region_code": "04", + "as_area": "2", + "population_code": "nz-ta-022", + "as_area_alt": "4" + }, + "population_share": 0.29894871658039385 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta022", + "codes": { + "area": "022|04|4", + "ta_code": "022", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-022", + "as_area_alt": "4" + }, + "population_share": 0.5336464058914563 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta023", + "codes": { + "area": "023|04|1", + "ta_code": "023", + "region_code": "04", + "as_area": "1", + "population_code": "nz-ta-023", + "as_area_alt": "1" + }, + "population_share": 0.997977775160011 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta023", + "codes": { + "area": "023|04|4", + "ta_code": "023", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-023", + "as_area_alt": "1" + }, + "population_share": 0.0020222248399890054 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta024", + "codes": { + "area": "024|03|4", + "ta_code": "024", + "region_code": "03", + "as_area": "4", + "population_code": "nz-ta-024", + "as_area_alt": "3" + }, + "population_share": 0.05248876108703576 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta024", + "codes": { + "area": "024|04|3", + "ta_code": "024", + "region_code": "04", + "as_area": "3", + "population_code": "nz-ta-024", + "as_area_alt": "3" + }, + "population_share": 0.8148313150540683 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta024", + "codes": { + "area": "024|04|4", + "ta_code": "024", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-024", + "as_area_alt": "3" + }, + "population_share": 0.13267992385889596 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta025", + "codes": { + "area": "025|04|3", + "ta_code": "025", + "region_code": "04", + "as_area": "3", + "population_code": "nz-ta-025", + "as_area_alt": "3" + }, + "population_share": 0.5886816824089771 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta025", + "codes": { + "area": "025|04|4", + "ta_code": "025", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-025", + "as_area_alt": "3" + }, + "population_share": 0.41131831759102283 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta026", + "codes": { + "area": "026|04|4", + "ta_code": "026", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-026", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta027", + "codes": { + "area": "027|04|4", + "ta_code": "027", + "region_code": "04", + "as_area": "4", + "population_code": "nz-ta-027", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta028", + "codes": { + "area": "028|05|3", + "ta_code": "028", + "region_code": "05", + "as_area": "3", + "population_code": "nz-ta-028", + "as_area_alt": "3" + }, + "population_share": 0.7519216100451799 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta028", + "codes": { + "area": "028|05|4", + "ta_code": "028", + "region_code": "05", + "as_area": "4", + "population_code": "nz-ta-028", + "as_area_alt": "3" + }, + "population_share": 0.24807838995482015 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta029", + "codes": { + "area": "029|06|4", + "ta_code": "029", + "region_code": "06", + "as_area": "4", + "population_code": "nz-ta-029", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta030", + "codes": { + "area": "030|06|2", + "ta_code": "030", + "region_code": "06", + "as_area": "2", + "population_code": "nz-ta-030", + "as_area_alt": "2" + }, + "population_share": 0.8852247347850363 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta030", + "codes": { + "area": "030|06|4", + "ta_code": "030", + "region_code": "06", + "as_area": "4", + "population_code": "nz-ta-030", + "as_area_alt": "2" + }, + "population_share": 0.1147752652149637 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta031", + "codes": { + "area": "031|06|2", + "ta_code": "031", + "region_code": "06", + "as_area": "2", + "population_code": "nz-ta-031", + "as_area_alt": "2" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta032", + "codes": { + "area": "032|06|3", + "ta_code": "032", + "region_code": "06", + "as_area": "3", + "population_code": "nz-ta-032", + "as_area_alt": "4" + }, + "population_share": 0.1506875847375557 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta032", + "codes": { + "area": "032|06|4", + "ta_code": "032", + "region_code": "06", + "as_area": "4", + "population_code": "nz-ta-032", + "as_area_alt": "4" + }, + "population_share": 0.8493124152624443 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta033", + "codes": { + "area": "033|07|2", + "ta_code": "033", + "region_code": "07", + "as_area": "2", + "population_code": "nz-ta-033", + "as_area_alt": "2" + }, + "population_share": 0.7049123775355319 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta033", + "codes": { + "area": "033|07|3", + "ta_code": "033", + "region_code": "07", + "as_area": "3", + "population_code": "nz-ta-033", + "as_area_alt": "2" + }, + "population_share": 0.12391334345246309 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta033", + "codes": { + "area": "033|07|4", + "ta_code": "033", + "region_code": "07", + "as_area": "4", + "population_code": "nz-ta-033", + "as_area_alt": "2" + }, + "population_share": 0.17117427901200497 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta034", + "codes": { + "area": "034|07|4", + "ta_code": "034", + "region_code": "07", + "as_area": "4", + "population_code": "nz-ta-034", + "as_area_alt": "4" + }, + "population_share": 0.9843195266272189 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta034", + "codes": { + "area": "034|08|4", + "ta_code": "034", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-034", + "as_area_alt": "4" + }, + "population_share": 0.015680473372781067 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta035", + "codes": { + "area": "035|07|3", + "ta_code": "035", + "region_code": "07", + "as_area": "3", + "population_code": "nz-ta-035", + "as_area_alt": "4" + }, + "population_share": 0.44359504132231403 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta035", + "codes": { + "area": "035|07|4", + "ta_code": "035", + "region_code": "07", + "as_area": "4", + "population_code": "nz-ta-035", + "as_area_alt": "4" + }, + "population_share": 0.5564049586776859 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta036", + "codes": { + "area": "036|08|4", + "ta_code": "036", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-036", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta037", + "codes": { + "area": "037|08|4", + "ta_code": "037", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-037", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta038", + "codes": { + "area": "038|06|4", + "ta_code": "038", + "region_code": "06", + "as_area": "4", + "population_code": "nz-ta-038", + "as_area_alt": "4" + }, + "population_share": 0.001530221882172915 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta038", + "codes": { + "area": "038|08|4", + "ta_code": "038", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-038", + "as_area_alt": "4" + }, + "population_share": 0.9984697781178271 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta039", + "codes": { + "area": "039|08|3", + "ta_code": "039", + "region_code": "08", + "as_area": "3", + "population_code": "nz-ta-039", + "as_area_alt": "3" + }, + "population_share": 0.6989824236817761 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta039", + "codes": { + "area": "039|08|4", + "ta_code": "039", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-039", + "as_area_alt": "3" + }, + "population_share": 0.30101757631822385 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta040", + "codes": { + "area": "040|08|3", + "ta_code": "040", + "region_code": "08", + "as_area": "3", + "population_code": "nz-ta-040", + "as_area_alt": "3" + }, + "population_share": 0.9638516886425449 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta040", + "codes": { + "area": "040|08|4", + "ta_code": "040", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-040", + "as_area_alt": "3" + }, + "population_share": 0.03614831135745516 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta041", + "codes": { + "area": "041|08|4", + "ta_code": "041", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-041", + "as_area_alt": "4" + }, + "population_share": 0.9996785599485696 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta041", + "codes": { + "area": "041|09|4", + "ta_code": "041", + "region_code": "09", + "as_area": "4", + "population_code": "nz-ta-041", + "as_area_alt": "4" + }, + "population_share": 0.0003214400514304082 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta042", + "codes": { + "area": "042|08|3", + "ta_code": "042", + "region_code": "08", + "as_area": "3", + "population_code": "nz-ta-042", + "as_area_alt": "3" + }, + "population_share": 0.7093583980384144 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta042", + "codes": { + "area": "042|08|4", + "ta_code": "042", + "region_code": "08", + "as_area": "4", + "population_code": "nz-ta-042", + "as_area_alt": "3" + }, + "population_share": 0.2906416019615856 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta043", + "codes": { + "area": "043|09|2", + "ta_code": "043", + "region_code": "09", + "as_area": "2", + "population_code": "nz-ta-043", + "as_area_alt": "2" + }, + "population_share": 0.787906427728297 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta043", + "codes": { + "area": "043|09|3", + "ta_code": "043", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-043", + "as_area_alt": "2" + }, + "population_share": 0.14781628930142718 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta043", + "codes": { + "area": "043|09|4", + "ta_code": "043", + "region_code": "09", + "as_area": "4", + "population_code": "nz-ta-043", + "as_area_alt": "2" + }, + "population_share": 0.06427728297027578 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta044", + "codes": { + "area": "044|09|2", + "ta_code": "044", + "region_code": "09", + "as_area": "2", + "population_code": "nz-ta-044", + "as_area_alt": "2" + }, + "population_share": 0.9965660034339966 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta044", + "codes": { + "area": "044|09|3", + "ta_code": "044", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-044", + "as_area_alt": "2" + }, + "population_share": 0.003433996566003434 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta045", + "codes": { + "area": "045|09|2", + "ta_code": "045", + "region_code": "09", + "as_area": "2", + "population_code": "nz-ta-045", + "as_area_alt": "2" + }, + "population_share": 0.9447977447059595 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta045", + "codes": { + "area": "045|09|3", + "ta_code": "045", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-045", + "as_area_alt": "2" + }, + "population_share": 0.05520225529404052 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta046", + "codes": { + "area": "046|09|2", + "ta_code": "046", + "region_code": "09", + "as_area": "2", + "population_code": "nz-ta-046", + "as_area_alt": "2" + }, + "population_share": 0.9936126296998773 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta046", + "codes": { + "area": "046|09|3", + "ta_code": "046", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-046", + "as_area_alt": "2" + }, + "population_share": 0.006387370300122727 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta047", + "codes": { + "area": "047|09|2", + "ta_code": "047", + "region_code": "09", + "as_area": "2", + "population_code": "nz-ta-047", + "as_area_alt": "2" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta048", + "codes": { + "area": "048|09|3", + "ta_code": "048", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-048", + "as_area_alt": "3" + }, + "population_share": 0.8647945354006289 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta048", + "codes": { + "area": "048|09|4", + "ta_code": "048", + "region_code": "09", + "as_area": "4", + "population_code": "nz-ta-048", + "as_area_alt": "3" + }, + "population_share": 0.13520546459937113 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta049", + "codes": { + "area": "049|09|3", + "ta_code": "049", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-049", + "as_area_alt": "3" + }, + "population_share": 0.5669828097213989 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta049", + "codes": { + "area": "049|09|4", + "ta_code": "049", + "region_code": "09", + "as_area": "4", + "population_code": "nz-ta-049", + "as_area_alt": "3" + }, + "population_share": 0.4330171902786011 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta050", + "codes": { + "area": "050|09|3", + "ta_code": "050", + "region_code": "09", + "as_area": "3", + "population_code": "nz-ta-050", + "as_area_alt": "4" + }, + "population_share": 0.37986270022883295 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta050", + "codes": { + "area": "050|09|4", + "ta_code": "050", + "region_code": "09", + "as_area": "4", + "population_code": "nz-ta-050", + "as_area_alt": "4" + }, + "population_share": 0.620137299771167 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta051", + "codes": { + "area": "051|16|2", + "ta_code": "051", + "region_code": "16", + "as_area": "2", + "population_code": "nz-ta-051", + "as_area_alt": "2" + }, + "population_share": 0.6058280618064917 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta051", + "codes": { + "area": "051|16|3", + "ta_code": "051", + "region_code": "16", + "as_area": "3", + "population_code": "nz-ta-051", + "as_area_alt": "2" + }, + "population_share": 0.02400705174738152 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta051", + "codes": { + "area": "051|16|4", + "ta_code": "051", + "region_code": "16", + "as_area": "4", + "population_code": "nz-ta-051", + "as_area_alt": "2" + }, + "population_share": 0.3701648864461267 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta052", + "codes": { + "area": "052|17|2", + "ta_code": "052", + "region_code": "17", + "as_area": "2", + "population_code": "nz-ta-052", + "as_area_alt": "2" + }, + "population_share": 0.9757700440025144 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta052", + "codes": { + "area": "052|17|4", + "ta_code": "052", + "region_code": "17", + "as_area": "4", + "population_code": "nz-ta-052", + "as_area_alt": "2" + }, + "population_share": 0.02422995599748557 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta053", + "codes": { + "area": "053|18|2", + "ta_code": "053", + "region_code": "18", + "as_area": "2", + "population_code": "nz-ta-053", + "as_area_alt": "2" + }, + "population_share": 0.6970525676086295 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta053", + "codes": { + "area": "053|18|3", + "ta_code": "053", + "region_code": "18", + "as_area": "3", + "population_code": "nz-ta-053", + "as_area_alt": "2" + }, + "population_share": 0.0956548161652993 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta053", + "codes": { + "area": "053|18|4", + "ta_code": "053", + "region_code": "18", + "as_area": "4", + "population_code": "nz-ta-053", + "as_area_alt": "2" + }, + "population_share": 0.2072926162260711 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta054", + "codes": { + "area": "054|13|3", + "ta_code": "054", + "region_code": "13", + "as_area": "3", + "population_code": "nz-ta-054", + "as_area_alt": "3" + }, + "population_share": 0.5217081850533808 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta054", + "codes": { + "area": "054|13|4", + "ta_code": "054", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-054", + "as_area_alt": "3" + }, + "population_share": 0.4782918149466192 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta055", + "codes": { + "area": "055|12|4", + "ta_code": "055", + "region_code": "12", + "as_area": "4", + "population_code": "nz-ta-055", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta056", + "codes": { + "area": "056|12|3", + "ta_code": "056", + "region_code": "12", + "as_area": "3", + "population_code": "nz-ta-056", + "as_area_alt": "3" + }, + "population_share": 0.6768671089236037 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta056", + "codes": { + "area": "056|12|4", + "ta_code": "056", + "region_code": "12", + "as_area": "4", + "population_code": "nz-ta-056", + "as_area_alt": "3" + }, + "population_share": 0.3231328910763963 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta057", + "codes": { + "area": "057|12|3", + "ta_code": "057", + "region_code": "12", + "as_area": "3", + "population_code": "nz-ta-057", + "as_area_alt": "4" + }, + "population_share": 0.39979757085020245 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta057", + "codes": { + "area": "057|12|4", + "ta_code": "057", + "region_code": "12", + "as_area": "4", + "population_code": "nz-ta-057", + "as_area_alt": "4" + }, + "population_share": 0.6002024291497976 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta058", + "codes": { + "area": "058|13|2", + "ta_code": "058", + "region_code": "13", + "as_area": "2", + "population_code": "nz-ta-058", + "as_area_alt": "4" + }, + "population_share": 0.1786660777385159 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta058", + "codes": { + "area": "058|13|3", + "ta_code": "058", + "region_code": "13", + "as_area": "3", + "population_code": "nz-ta-058", + "as_area_alt": "4" + }, + "population_share": 0.0706713780918728 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta058", + "codes": { + "area": "058|13|4", + "ta_code": "058", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-058", + "as_area_alt": "4" + }, + "population_share": 0.7506625441696113 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta059", + "codes": { + "area": "059|13|2", + "ta_code": "059", + "region_code": "13", + "as_area": "2", + "population_code": "nz-ta-059", + "as_area_alt": "2" + }, + "population_share": 0.5989854612980661 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta059", + "codes": { + "area": "059|13|4", + "ta_code": "059", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-059", + "as_area_alt": "2" + }, + "population_share": 0.401014538701934 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta060", + "codes": { + "area": "060|13|2", + "ta_code": "060", + "region_code": "13", + "as_area": "2", + "population_code": "nz-ta-060", + "as_area_alt": "2" + }, + "population_share": 0.9915452364344354 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta060", + "codes": { + "area": "060|13|4", + "ta_code": "060", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-060", + "as_area_alt": "2" + }, + "population_share": 0.00845476356556466 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta062", + "codes": { + "area": "062|13|2", + "ta_code": "062", + "region_code": "13", + "as_area": "2", + "population_code": "nz-ta-062", + "as_area_alt": "2" + }, + "population_share": 0.6331554087784648 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta062", + "codes": { + "area": "062|13|4", + "ta_code": "062", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-062", + "as_area_alt": "2" + }, + "population_share": 0.3668445912215353 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta063", + "codes": { + "area": "063|13|2", + "ta_code": "063", + "region_code": "13", + "as_area": "2", + "population_code": "nz-ta-063", + "as_area_alt": "2" + }, + "population_share": 0.6249352443446727 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta063", + "codes": { + "area": "063|13|3", + "ta_code": "063", + "region_code": "13", + "as_area": "3", + "population_code": "nz-ta-063", + "as_area_alt": "2" + }, + "population_share": 0.045933344845449836 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta063", + "codes": { + "area": "063|13|4", + "ta_code": "063", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-063", + "as_area_alt": "2" + }, + "population_share": 0.3291314108098774 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta064", + "codes": { + "area": "064|13|3", + "ta_code": "064", + "region_code": "13", + "as_area": "3", + "population_code": "nz-ta-064", + "as_area_alt": "3" + }, + "population_share": 0.7654554630330558 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta064", + "codes": { + "area": "064|13|4", + "ta_code": "064", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-064", + "as_area_alt": "3" + }, + "population_share": 0.23454453696694424 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta065", + "codes": { + "area": "065|13|3", + "ta_code": "065", + "region_code": "13", + "as_area": "3", + "population_code": "nz-ta-065", + "as_area_alt": "4" + }, + "population_share": 0.29115407147041594 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta065", + "codes": { + "area": "065|13|4", + "ta_code": "065", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-065", + "as_area_alt": "4" + }, + "population_share": 0.7088459285295841 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta066", + "codes": { + "area": "066|13|4", + "ta_code": "066", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-066", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta067", + "codes": { + "area": "067|99|4", + "ta_code": "067", + "region_code": "99", + "as_area": "4", + "population_code": "nz-ta-067", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta068", + "codes": { + "area": "068|13|4", + "ta_code": "068", + "region_code": "13", + "as_area": "4", + "population_code": "nz-ta-068", + "as_area_alt": "3" + }, + "population_share": 0.08082875047960097 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta068", + "codes": { + "area": "068|14|3", + "ta_code": "068", + "region_code": "14", + "as_area": "3", + "population_code": "nz-ta-068", + "as_area_alt": "3" + }, + "population_share": 0.6140171377413992 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta068", + "codes": { + "area": "068|14|4", + "ta_code": "068", + "region_code": "14", + "as_area": "4", + "population_code": "nz-ta-068", + "as_area_alt": "3" + }, + "population_share": 0.30515411177899987 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta069", + "codes": { + "area": "069|14|2", + "ta_code": "069", + "region_code": "14", + "as_area": "2", + "population_code": "nz-ta-069", + "as_area_alt": "4" + }, + "population_share": 0.2607032695866749 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta069", + "codes": { + "area": "069|14|3", + "ta_code": "069", + "region_code": "14", + "as_area": "3", + "population_code": "nz-ta-069", + "as_area_alt": "4" + }, + "population_share": 0.23022825416409623 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta069", + "codes": { + "area": "069|14|4", + "ta_code": "069", + "region_code": "14", + "as_area": "4", + "population_code": "nz-ta-069", + "as_area_alt": "4" + }, + "population_share": 0.5090684762492289 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta070", + "codes": { + "area": "070|14|1", + "ta_code": "070", + "region_code": "14", + "as_area": "1", + "population_code": "nz-ta-070", + "as_area_alt": "1" + }, + "population_share": 0.5776035131744041 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta070", + "codes": { + "area": "070|14|4", + "ta_code": "070", + "region_code": "14", + "as_area": "4", + "population_code": "nz-ta-070", + "as_area_alt": "1" + }, + "population_share": 0.422396486825596 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta071", + "codes": { + "area": "071|14|3", + "ta_code": "071", + "region_code": "14", + "as_area": "3", + "population_code": "nz-ta-071", + "as_area_alt": "3" + }, + "population_share": 0.9364698761523419 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta071", + "codes": { + "area": "071|14|4", + "ta_code": "071", + "region_code": "14", + "as_area": "4", + "population_code": "nz-ta-071", + "as_area_alt": "3" + }, + "population_share": 0.06353012384765806 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta072", + "codes": { + "area": "072|14|4", + "ta_code": "072", + "region_code": "14", + "as_area": "4", + "population_code": "nz-ta-072", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta073", + "codes": { + "area": "073|15|3", + "ta_code": "073", + "region_code": "15", + "as_area": "3", + "population_code": "nz-ta-073", + "as_area_alt": "4" + }, + "population_share": 0.07764062941675304 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta073", + "codes": { + "area": "073|15|4", + "ta_code": "073", + "region_code": "15", + "as_area": "4", + "population_code": "nz-ta-073", + "as_area_alt": "4" + }, + "population_share": 0.9223593705832469 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta074", + "codes": { + "area": "074|15|4", + "ta_code": "074", + "region_code": "15", + "as_area": "4", + "population_code": "nz-ta-074", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta075", + "codes": { + "area": "075|15|4", + "ta_code": "075", + "region_code": "15", + "as_area": "4", + "population_code": "nz-ta-075", + "as_area_alt": "4" + }, + "population_share": 1.0 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta076", + "codes": { + "area": "076|02|1", + "ta_code": "076", + "region_code": "02", + "as_area": "1", + "population_code": "nz-ta-076", + "as_area_alt": "1" + }, + "population_share": 0.9837162460784953 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta076", + "codes": { + "area": "076|02|2", + "ta_code": "076", + "region_code": "02", + "as_area": "2", + "population_code": "nz-ta-076", + "as_area_alt": "1" + }, + "population_share": 0.015863528013852966 + }, + { + "target": "stats_nz_population_by_territorial_authority__ta076", + "codes": { + "area": "076|02|4", + "ta_code": "076", + "region_code": "02", + "as_area": "4", + "population_code": "nz-ta-076", + "as_area_alt": "1" + }, + "population_share": 0.00042022590765173414 + } + ], + "share_tolerance": 1e-12, + "population_geography_level": "local_authority", + "population_code_column": "population_code" +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/transport_graph.json b/packages/microcosm-build/src/microcosm/build/nz/transport_graph.json new file mode 100644 index 0000000000..bcadc329a4 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/transport_graph.json @@ -0,0 +1,4337 @@ +{ + "schema_version": 1, + "country": "nz", + "description": "The NZ transport declaration retains named pending money producers. The graph makes no estimate or publication claim.", + "export_contract": "export_contract", + "sources": [ + { + "name": "populace_us_donor", + "codec": "populace-us-h5-v1" + }, + { + "name": "nz_chronicle_facts", + "codec": "ledger-consumer-artifact-v1" + }, + { + "name": "nz_holdout_facts", + "codec": "ledger-consumer-artifact-v1" + }, + { + "name": "rulespec_nz", + "codec": "rulespec-tree-v1" + }, + { + "name": "nz_exported_dataset", + "codec": "axiom-entity-table-h5-v1" + } + ], + "nodes": [ + { + "id": "nz.create", + "kernel": "transport.create@1", + "structural": "create", + "sources": [ + "populace_us_donor", + "nz_chronicle_facts" + ], + "params": { + "donor_source": "populace_us_donor", + "facts_source": "nz_chronicle_facts", + "donor_sha256": { + "resource": "transport_inputs", + "path": [ + "donor", + "sha256" + ], + "encoding": "value" + }, + "donor_size": { + "resource": "transport_inputs", + "path": [ + "donor", + "size_bytes" + ], + "encoding": "value" + }, + "donor_pin_sha256": { + "resource": "source_stages", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "mass_reference": { + "resource": "mass_references", + "path": [], + "encoding": "json" + }, + "mass_reference_sha256": { + "resource": "mass_references", + "path": [], + "encoding": "sha256" + }, + "country": "nz", + "concept_schema_sha256": "5a55669d0447a686692911a6327ae298f19741dde29559f2654a75807878a141", + "seed_stream": "nz:takeup:v0" + } + }, + { + "id": "nz.open", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.create", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ] + }, + { + "id": "nz.facts.precal", + "kernel": "targets.compile@1", + "population": "nz.open", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "precal_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "precal_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.geo.support", + "kernel": "geography.support_from_facts@1", + "population": "nz.open", + "params": { + "definition": { + "resource": "transport_atomic_geography_support", + "path": [], + "encoding": "json" + }, + "definition_sha256": { + "resource": "transport_atomic_geography_support", + "path": [], + "encoding": "sha256" + }, + "system": "nz-joint" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.geo.assign", + "kernel": "geography.assign_atomic@1", + "population": "nz.open", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "household", + "column": "nz_atomic_area", + "dtype": "string" + }, + { + "entity": "household", + "column": "nz_area_system", + "dtype": "string" + }, + { + "entity": "household", + "column": "nz_area_basis", + "dtype": "string" + } + ], + "params": { + "definition": { + "resource": "geography_assignment", + "path": [], + "encoding": "json" + }, + "stream": { + "resource": "geography_assignment", + "path": [ + "stream" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "nz-joint", + "producer": "nz.geo.support", + "artifact": "support" + } + ] + }, + { + "id": "nz.geo.derive", + "kernel": "geography.derive@1", + "population": "nz.open", + "inputs": [ + { + "entity": "household", + "columns": [ + "nz_atomic_area", + "nz_area_system", + "nz_area_basis" + ] + } + ], + "outputs": [ + { + "entity": "household", + "column": "ta_code", + "dtype": "string" + }, + { + "entity": "household", + "column": "household_region_code", + "dtype": "string" + }, + { + "entity": "household", + "column": "as_area", + "dtype": "string" + }, + { + "entity": "household", + "column": "as_area_alt", + "dtype": "string" + } + ], + "params": { + "definition": { + "resource": "geography_assignment", + "path": [], + "encoding": "json" + }, + "stream": { + "resource": "geography_assignment", + "path": [ + "stream" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "nz-joint", + "producer": "nz.geo.support", + "artifact": "support" + } + ] + }, + { + "id": "nz.geo.person", + "kernel": "geography.person_location@1", + "population": "nz.open", + "inputs": [ + { + "entity": "household", + "columns": [ + "household_region_code" + ] + }, + { + "entity": "person", + "columns": [ + "age" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "region_code", + "dtype": "string" + } + ], + "params": { + "columns": "{\"household_region_code\":\"region_code\"}" + } + }, + { + "id": "nz.geo.gate", + "kernel": "geography.gate@1", + "population": "nz.open", + "inputs": [ + { + "entity": "household", + "columns": [ + "nz_atomic_area", + "nz_area_system", + "nz_area_basis", + "ta_code", + "household_region_code", + "as_area", + "as_area_alt" + ] + } + ], + "params": { + "definition": { + "resource": "geography_assignment", + "path": [], + "encoding": "json" + }, + "stream": { + "resource": "geography_assignment", + "path": [ + "stream" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "nz-joint", + "producer": "nz.geo.support", + "artifact": "support" + } + ] + }, + { + "id": "nz.units.attributes", + "kernel": "transport.unit_attributes@1", + "population": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "family_type", + "dtype": "string" + }, + { + "entity": "family", + "column": "n_dependent_children", + "dtype": "int64" + }, + { + "entity": "family", + "column": "is_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "is_partnered", + "dtype": "bool" + }, + { + "entity": "family", + "column": "is_single", + "dtype": "bool" + }, + { + "entity": "family", + "column": "n_adults", + "dtype": "int64" + }, + { + "entity": "family", + "column": "youngest_dependent_child_age", + "dtype": "Int64" + }, + { + "entity": "household", + "column": "n_family_units", + "dtype": "int64" + } + ], + "params": { + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.central", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ] + }, + { + "id": "nz.money.normalize", + "kernel": "money.normalize@1", + "population": "nz.central", + "sources": [ + "nz_chronicle_facts" + ], + "inputs": [ + { + "entity": "person", + "columns": [ + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "realized_capital_gains", + "private_pension_income" + ] + }, + { + "entity": "household", + "columns": [ + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nonfarm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "farm_self_employment_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "interest_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "dividend_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "rental_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "realized_capital_gains", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "private_pension_income", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_interest", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "mortgage_principal", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "household", + "column": "property_tax", + "dtype": "float64", + "rewrite": true + }, + { + "entity": "person", + "column": "nonfarm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "farm_self_employment_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "interest_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "dividend_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "rental_income_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "realized_capital_gains_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "private_pension_income_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_interest_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "mortgage_principal_cents", + "dtype": "int64" + }, + { + "entity": "household", + "column": "property_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": { + "resource": "money_normalization", + "path": [], + "encoding": "json" + }, + "declaration_sha256": { + "resource": "money_normalization", + "path": [], + "encoding": "sha256" + }, + "factor_context": { + "resource": "reference_aging", + "path": [], + "encoding": "json" + }, + "factor_context_sha256": { + "resource": "reference_aging", + "path": [], + "encoding": "sha256" + }, + "profile_selection": "{\"aging_index\":\"central\",\"area_column\":\"as_area\",\"asset_test\":\"on\",\"beneficiary_assignment\":\"central\",\"census_residual_allocation\":\"mar\",\"donor_money_index\":\"awe\",\"rent_allocation\":\"reference_unit\",\"rent_stock_factor\":1.0,\"superannuitant_treatment\":\"exclude_and_count\"}" + } + }, + { + "id": "nz.encode.person", + "kernel": "concepts.encode@1", + "population": "nz.central", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_available_for_and_seeking_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_full_time_student", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_has_no_income", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_in_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_income_less_than_zero_rate_cutout", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_losing_earnings_through_health_condition_or_injury", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_section_25_discretionary_student_eligibility", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_support_living_with_parent", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "jobseeker_support_transferred_2013_no_dependent_children", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_support_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_due_to_strike", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_willing_and_able_to_undertake_full_time_employment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_income_test_assessable_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "main_benefit_receiving_another_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_new_zealand_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "main_benefit_receiving_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_birth_year", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_born_on_or_before_30_june_of_birth_year", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_elected_weekly_compensation_instead_of_superannuation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_overseas_application_residence_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_person_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_principal_residence_is_qualifying_accommodation", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_new_zealand_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_20_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_resident_present_since_age_50_total_years", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_shares_residence_with_person_at_least_adult_age", + "dtype": "bool" + }, + { + "entity": "person", + "column": "nz_super_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_after_citizen_or_resident", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_continuous_residence_years_before_application", + "dtype": "int64" + }, + { + "entity": "person", + "column": "social_security_new_zealand_citizen", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_only_temporary_entry_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_new_zealand_on_application", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_ordinarily_resident_in_reciprocity_country", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_refugee_or_protected_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_regulations_treat_person_as_meeting_residence_requirement", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_residence_class_visa_holder", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_section_205_override_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "social_security_unlawfully_resident_or_present_in_new_zealand", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_caring_for_dependent_children_under_age_limit", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_is_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_marriage_or_civil_union_dissolved", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_receiving_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_court_order_exception_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_entitlement_allocated_to_person", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_split_care_situation_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_spouse_or_partner_died", + "dtype": "bool" + }, + { + "entity": "person", + "column": "sole_parent_support_personal_earnings_used_for_childcare", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_youngest_dependent_child_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_blind_average_weekly_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_blind_beneficiary_employed", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_blind_other_weekly_amounts_from_all_sources", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_is_spouse_or_partner", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_cared_person_would_otherwise_receive_institutional_care", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_caring_applicant_has_dependent_child", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_payment_already_granted", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_required_full_time_care_at_home", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_caring_temporary_continuation_days", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_agreed_with_msd", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_open_employment_trial_weeks", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_applicant_age", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_beneficiary_personal_earnings", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_caring", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_dependent_children_count", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_granted_for_restricted_work_capacity", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_main_benefit", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_restricted_or_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_single", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_payment_total_income", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_totally_blind", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_regular_open_employment_capacity_hours_per_week", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_restricting_condition_expected_to_continue_required_period", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_terminal_condition", + "dtype": "bool" + }, + { + "entity": "person", + "column": "supported_living_totally_blind", + "dtype": "bool" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "rulespec_paths": [ + "nz/statutes/social_security/main_benefits/entitlement.yaml", + "nz/statutes/social_security/main_benefits/rates.yaml", + "nz/statutes/new_zealand_superannuation/core.yaml" + ] + } + }, + { + "id": "nz.benefits.entitlement", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.central", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "main_benefits_entitlement", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_jobseeker_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_sole_parent_support", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_restricted_or_blind", + "dtype": "int64" + }, + { + "entity": "person", + "column": "entitled_to_supported_living_payment_caring", + "dtype": "int64" + } + ], + "params": { + "variables": [ + "entitled_to_jobseeker_support", + "entitled_to_sole_parent_support", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring" + ] + } + }, + { + "id": "nz.benefits.super", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.central", + "sources": [ + "rulespec_nz" + ], + "rules_binding": "nz_super", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "entitled_to_new_zealand_superannuation", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax" + ] + } + }, + { + "id": "nz.benefits.rates", + "kernel": "simulate.rules_by_ref@1", + "population": "nz.central", + "structural": "none", + "rules_binding": "main_benefits_rates", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "main_benefit_income_test_assessable_income", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment", + "dtype": "float64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment", + "dtype": "float64" + } + ], + "params": { + "variables": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + }, + { + "id": "nz.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment", + "sole_parent_support_net_weekly_payment", + "supported_living_payment_net_weekly_payment" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_net_weekly_payment_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_net_weekly_payment_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "main_benefits_rates", + "field": "engine_ref" + }, + "period": { + "binding": "main_benefits_rates", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"jobseeker_support_net_weekly_payment\"},{\"output_column\":\"sole_parent_support_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"sole_parent_support_net_weekly_payment\"},{\"output_column\":\"supported_living_payment_net_weekly_payment_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"supported_living_payment_net_weekly_payment\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.gross_up.jobseeker_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"jobseeker_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"jobseeker_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.gross_up.sole_parent_support", + "kernel": "simulate.solve_zero@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "sole_parent_support_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "sole_parent_support_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"source_column\":\"sole_parent_support_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"sole_parent_support_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.gross_up.supported_living_payment", + "kernel": "simulate.solve_zero@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "supported_living_payment_net_weekly_payment_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "supported_living_payment_annual_gross", + "dtype": "float64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "variables": [ + "individual_income_tax_before_credits" + ], + "input_overrides": "[]", + "output_coefficients": "[{\"coefficient\":0.52,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"source_column\":\"supported_living_payment_net_weekly_payment_cents\",\"source_entity\":\"person\"},{\"coefficient\":1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"variable\":\"individual_income_tax_before_credits\"},{\"coefficient\":-1,\"column\":\"supported_living_payment_annual_gross\",\"entity\":\"person\",\"trial\":true}]", + "solve_input": "{\"column\":\"taxable_income\",\"entity\":\"person\"}", + "bracket": [ + 0, + 1000000 + ], + "tolerance": 1e-07, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "certificate_margin": "0.000001", + "quantized_residual_bound": "0.0050001", + "extra_evaluation_budget": 9 + } + }, + { + "id": "nz.gross_up.annual_cents", + "kernel": "money.minor_units@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "jobseeker_support_annual_gross", + "sole_parent_support_annual_gross", + "supported_living_payment_annual_gross" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_cents", + "dtype": "int64" + } + ], + "params": { + "engine_ref": { + "binding": "income_tax_schedule_1", + "field": "engine_ref" + }, + "period": { + "binding": "income_tax_schedule_1", + "field": "period" + }, + "declaration": "{\"columns\":[{\"output_column\":\"jobseeker_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"jobseeker_support_annual_gross\"},{\"output_column\":\"sole_parent_support_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"sole_parent_support_annual_gross\"},{\"output_column\":\"supported_living_payment_annual_gross_cents\",\"quantum\":\"0.01\",\"rounding\":\"exact\",\"source_column\":\"supported_living_payment_annual_gross\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.gross_up.super_cents", + "kernel": "money.minor_units@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "nz_super_weekly_amount_before_tax" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "nz_super_weekly_amount_before_tax_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"columns\":[{\"output_column\":\"nz_super_weekly_amount_before_tax_cents\",\"quantum\":\"0.01\",\"rounding\":\"half_even\",\"source_column\":\"nz_super_weekly_amount_before_tax\",\"source_tax_basis\":\"before_tax\"}],\"entity\":\"person\"}" + } + }, + { + "id": "nz.takeup.assign", + "kernel": "takeup.assign@1", + "population": "nz.central", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "take_up_seed", + "entitled_to_new_zealand_superannuation", + "nz_super_weekly_amount_before_tax", + "entitled_to_supported_living_payment_restricted_or_blind", + "entitled_to_supported_living_payment_caring", + "supported_living_payment_net_weekly_payment", + "entitled_to_sole_parent_support", + "sole_parent_support_net_weekly_payment", + "entitled_to_jobseeker_support", + "jobseeker_support_net_weekly_payment" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "receives_nz_super", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_supported_living_payment", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_sole_parent_support", + "dtype": "bool" + }, + { + "entity": "person", + "column": "receives_jobseeker_support", + "dtype": "bool" + } + ], + "params": { + "receipt_contract": { + "resource": "receipt_contract", + "path": [ + "receipts" + ], + "encoding": "json" + }, + "receipt_contract_sha256": { + "resource": "receipt_contract", + "path": [], + "encoding": "sha256" + } + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.facts.precal", + "artifact": "surface" + } + ] + }, + { + "id": "nz.benefits.annual_transfers", + "kernel": "money.annual_transfers@1", + "population": "nz.central", + "structural": "none", + "inputs": [ + { + "entity": "person", + "columns": [ + "receives_jobseeker_support", + "receives_sole_parent_support", + "receives_supported_living_payment", + "receives_nz_super", + "jobseeker_support_annual_gross_cents", + "sole_parent_support_annual_gross_cents", + "supported_living_payment_annual_gross_cents", + "nz_super_weekly_amount_before_tax_cents" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "jobseeker_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "sole_parent_support_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "supported_living_payment_annual_gross_transfer_cents", + "dtype": "int64" + }, + { + "entity": "person", + "column": "nz_super_annual_gross_transfer_cents", + "dtype": "int64" + } + ], + "params": { + "declaration": "{\"entity\":\"person\",\"exposure\":{\"central\":1,\"convention\":\"full_year_stock_equivalent\"},\"transfers\":[{\"flag_column\":\"receives_jobseeker_support\",\"output_column\":\"jobseeker_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"jobseeker_support_annual_gross_cents\"},{\"flag_column\":\"receives_sole_parent_support\",\"output_column\":\"sole_parent_support_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"sole_parent_support_annual_gross_cents\"},{\"flag_column\":\"receives_supported_living_payment\",\"output_column\":\"supported_living_payment_annual_gross_transfer_cents\",\"source_basis\":\"annual_gross_cents\",\"source_column\":\"supported_living_payment_annual_gross_cents\"},{\"flag_column\":\"receives_nz_super\",\"output_column\":\"nz_super_annual_gross_transfer_cents\",\"source_basis\":\"weekly_before_tax_cents\",\"source_column\":\"nz_super_weekly_amount_before_tax_cents\",\"source_tax_basis\":\"before_tax\"}],\"weeks_per_year\":52}" + } + }, + { + "id": "nz.targets.prepare", + "kernel": "calibration.prepare@1", + "population": "nz.central", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "region_code", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "household_region_code", + "tenure" + ] + } + ], + "outputs": [ + { + "entity": "person", + "column": "people", + "dtype": "int64" + }, + { + "entity": "household", + "column": "households", + "dtype": "int64" + }, + { + "entity": "person", + "column": "population_region_01_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_01_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_02_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_03_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_04_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_05_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_06_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_07_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_08_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_09_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_12_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_13_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_14_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_15_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_16_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_17_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_0_14_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_15_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_40_64_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "population_region_18_age_65_plus_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_01_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_01_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_02_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_02_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_03_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_03_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_04_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_04_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_05_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_05_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_06_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_06_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_07_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_07_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_08_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_08_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_09_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_09_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_12_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_12_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_13_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_13_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_14_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_14_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_15_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_15_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_16_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_16_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_17_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_17_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_18_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_18_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "region_99_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_1_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_2_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_3_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_4_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_5_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_6_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_7_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_size_8_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_owned_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_region_99_not_owned_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_18_24_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_25_39_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_40_54_indicator", + "dtype": "bool" + }, + { + "entity": "person", + "column": "age_55_64_indicator", + "dtype": "bool" + }, + { + "entity": "household", + "column": "household_size", + "dtype": "int64" + } + ], + "params": { + "bindings": { + "resource": "calibration_bindings", + "path": [], + "encoding": "json" + }, + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.targets.compile", + "kernel": "targets.compile@1", + "population": "nz.central", + "sources": [ + "nz_chronicle_facts" + ], + "params": { + "country": "nz", + "references": { + "resource": "target_references", + "path": [], + "encoding": "json" + }, + "references_sha256": { + "resource": "target_references", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.targets.problem", + "kernel": "targets.problem@1", + "population": "nz.central", + "inputs": [ + { + "entity": "person", + "columns": [ + "people", + "population_region_01_age_0_14_indicator", + "population_region_01_age_15_39_indicator", + "population_region_01_age_40_64_indicator", + "population_region_01_age_65_plus_indicator", + "population_region_02_age_0_14_indicator", + "population_region_02_age_15_39_indicator", + "population_region_02_age_40_64_indicator", + "population_region_02_age_65_plus_indicator", + "population_region_03_age_0_14_indicator", + "population_region_03_age_15_39_indicator", + "population_region_03_age_40_64_indicator", + "population_region_03_age_65_plus_indicator", + "population_region_04_age_0_14_indicator", + "population_region_04_age_15_39_indicator", + "population_region_04_age_40_64_indicator", + "population_region_04_age_65_plus_indicator", + "population_region_05_age_0_14_indicator", + "population_region_05_age_15_39_indicator", + "population_region_05_age_40_64_indicator", + "population_region_05_age_65_plus_indicator", + "population_region_06_age_0_14_indicator", + "population_region_06_age_15_39_indicator", + "population_region_06_age_40_64_indicator", + "population_region_06_age_65_plus_indicator", + "population_region_07_age_0_14_indicator", + "population_region_07_age_15_39_indicator", + "population_region_07_age_40_64_indicator", + "population_region_07_age_65_plus_indicator", + "population_region_08_age_0_14_indicator", + "population_region_08_age_15_39_indicator", + "population_region_08_age_40_64_indicator", + "population_region_08_age_65_plus_indicator", + "population_region_09_age_0_14_indicator", + "population_region_09_age_15_39_indicator", + "population_region_09_age_40_64_indicator", + "population_region_09_age_65_plus_indicator", + "population_region_12_age_0_14_indicator", + "population_region_12_age_15_39_indicator", + "population_region_12_age_40_64_indicator", + "population_region_12_age_65_plus_indicator", + "population_region_13_age_0_14_indicator", + "population_region_13_age_15_39_indicator", + "population_region_13_age_40_64_indicator", + "population_region_13_age_65_plus_indicator", + "population_region_14_age_0_14_indicator", + "population_region_14_age_15_39_indicator", + "population_region_14_age_40_64_indicator", + "population_region_14_age_65_plus_indicator", + "population_region_15_age_0_14_indicator", + "population_region_15_age_15_39_indicator", + "population_region_15_age_40_64_indicator", + "population_region_15_age_65_plus_indicator", + "population_region_16_age_0_14_indicator", + "population_region_16_age_15_39_indicator", + "population_region_16_age_40_64_indicator", + "population_region_16_age_65_plus_indicator", + "population_region_17_age_0_14_indicator", + "population_region_17_age_15_39_indicator", + "population_region_17_age_40_64_indicator", + "population_region_17_age_65_plus_indicator", + "population_region_18_age_0_14_indicator", + "population_region_18_age_15_39_indicator", + "population_region_18_age_40_64_indicator", + "population_region_18_age_65_plus_indicator", + "age_18_24_indicator", + "age_25_39_indicator", + "age_40_54_indicator", + "age_55_64_indicator", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "households", + "region_01_indicator", + "household_region_01_size_1_indicator", + "household_region_01_size_2_indicator", + "household_region_01_size_3_indicator", + "household_region_01_size_4_indicator", + "household_region_01_size_5_indicator", + "household_region_01_size_6_indicator", + "household_region_01_size_7_indicator", + "household_region_01_size_8_indicator", + "household_region_01_owned_indicator", + "household_region_01_not_owned_indicator", + "region_02_indicator", + "household_region_02_size_1_indicator", + "household_region_02_size_2_indicator", + "household_region_02_size_3_indicator", + "household_region_02_size_4_indicator", + "household_region_02_size_5_indicator", + "household_region_02_size_6_indicator", + "household_region_02_size_7_indicator", + "household_region_02_size_8_indicator", + "household_region_02_owned_indicator", + "household_region_02_not_owned_indicator", + "region_03_indicator", + "household_region_03_size_1_indicator", + "household_region_03_size_2_indicator", + "household_region_03_size_3_indicator", + "household_region_03_size_4_indicator", + "household_region_03_size_5_indicator", + "household_region_03_size_6_indicator", + "household_region_03_size_7_indicator", + "household_region_03_size_8_indicator", + "household_region_03_owned_indicator", + "household_region_03_not_owned_indicator", + "region_04_indicator", + "household_region_04_size_1_indicator", + "household_region_04_size_2_indicator", + "household_region_04_size_3_indicator", + "household_region_04_size_4_indicator", + "household_region_04_size_5_indicator", + "household_region_04_size_6_indicator", + "household_region_04_size_7_indicator", + "household_region_04_size_8_indicator", + "household_region_04_owned_indicator", + "household_region_04_not_owned_indicator", + "region_05_indicator", + "household_region_05_size_1_indicator", + "household_region_05_size_2_indicator", + "household_region_05_size_3_indicator", + "household_region_05_size_4_indicator", + "household_region_05_size_5_indicator", + "household_region_05_size_6_indicator", + "household_region_05_size_7_indicator", + "household_region_05_size_8_indicator", + "household_region_05_owned_indicator", + "household_region_05_not_owned_indicator", + "region_06_indicator", + "household_region_06_size_1_indicator", + "household_region_06_size_2_indicator", + "household_region_06_size_3_indicator", + "household_region_06_size_4_indicator", + "household_region_06_size_5_indicator", + "household_region_06_size_6_indicator", + "household_region_06_size_7_indicator", + "household_region_06_size_8_indicator", + "household_region_06_owned_indicator", + "household_region_06_not_owned_indicator", + "region_07_indicator", + "household_region_07_size_1_indicator", + "household_region_07_size_2_indicator", + "household_region_07_size_3_indicator", + "household_region_07_size_4_indicator", + "household_region_07_size_5_indicator", + "household_region_07_size_6_indicator", + "household_region_07_size_7_indicator", + "household_region_07_size_8_indicator", + "household_region_07_owned_indicator", + "household_region_07_not_owned_indicator", + "region_08_indicator", + "household_region_08_size_1_indicator", + "household_region_08_size_2_indicator", + "household_region_08_size_3_indicator", + "household_region_08_size_4_indicator", + "household_region_08_size_5_indicator", + "household_region_08_size_6_indicator", + "household_region_08_size_7_indicator", + "household_region_08_size_8_indicator", + "household_region_08_owned_indicator", + "household_region_08_not_owned_indicator", + "region_09_indicator", + "household_region_09_size_1_indicator", + "household_region_09_size_2_indicator", + "household_region_09_size_3_indicator", + "household_region_09_size_4_indicator", + "household_region_09_size_5_indicator", + "household_region_09_size_6_indicator", + "household_region_09_size_7_indicator", + "household_region_09_size_8_indicator", + "household_region_09_owned_indicator", + "household_region_09_not_owned_indicator", + "region_12_indicator", + "household_region_12_size_1_indicator", + "household_region_12_size_2_indicator", + "household_region_12_size_3_indicator", + "household_region_12_size_4_indicator", + "household_region_12_size_5_indicator", + "household_region_12_size_6_indicator", + "household_region_12_size_7_indicator", + "household_region_12_size_8_indicator", + "household_region_12_owned_indicator", + "household_region_12_not_owned_indicator", + "region_13_indicator", + "household_region_13_size_1_indicator", + "household_region_13_size_2_indicator", + "household_region_13_size_3_indicator", + "household_region_13_size_4_indicator", + "household_region_13_size_5_indicator", + "household_region_13_size_6_indicator", + "household_region_13_size_7_indicator", + "household_region_13_size_8_indicator", + "household_region_13_owned_indicator", + "household_region_13_not_owned_indicator", + "region_14_indicator", + "household_region_14_size_1_indicator", + "household_region_14_size_2_indicator", + "household_region_14_size_3_indicator", + "household_region_14_size_4_indicator", + "household_region_14_size_5_indicator", + "household_region_14_size_6_indicator", + "household_region_14_size_7_indicator", + "household_region_14_size_8_indicator", + "household_region_14_owned_indicator", + "household_region_14_not_owned_indicator", + "region_15_indicator", + "household_region_15_size_1_indicator", + "household_region_15_size_2_indicator", + "household_region_15_size_3_indicator", + "household_region_15_size_4_indicator", + "household_region_15_size_5_indicator", + "household_region_15_size_6_indicator", + "household_region_15_size_7_indicator", + "household_region_15_size_8_indicator", + "household_region_15_owned_indicator", + "household_region_15_not_owned_indicator", + "region_16_indicator", + "household_region_16_size_1_indicator", + "household_region_16_size_2_indicator", + "household_region_16_size_3_indicator", + "household_region_16_size_4_indicator", + "household_region_16_size_5_indicator", + "household_region_16_size_6_indicator", + "household_region_16_size_7_indicator", + "household_region_16_size_8_indicator", + "household_region_16_owned_indicator", + "household_region_16_not_owned_indicator", + "region_17_indicator", + "household_region_17_size_1_indicator", + "household_region_17_size_2_indicator", + "household_region_17_size_3_indicator", + "household_region_17_size_4_indicator", + "household_region_17_size_5_indicator", + "household_region_17_size_6_indicator", + "household_region_17_size_7_indicator", + "household_region_17_size_8_indicator", + "household_region_17_owned_indicator", + "household_region_17_not_owned_indicator", + "region_18_indicator", + "household_region_18_size_1_indicator", + "household_region_18_size_2_indicator", + "household_region_18_size_3_indicator", + "household_region_18_size_4_indicator", + "household_region_18_size_5_indicator", + "household_region_18_size_6_indicator", + "household_region_18_size_7_indicator", + "household_region_18_size_8_indicator", + "household_region_18_owned_indicator", + "household_region_18_not_owned_indicator", + "region_99_indicator", + "household_region_99_size_1_indicator", + "household_region_99_size_2_indicator", + "household_region_99_size_3_indicator", + "household_region_99_size_4_indicator", + "household_region_99_size_5_indicator", + "household_region_99_size_6_indicator", + "household_region_99_size_7_indicator", + "household_region_99_size_8_indicator", + "household_region_99_owned_indicator", + "household_region_99_not_owned_indicator", + "household_size" + ] + }, + { + "entity": "family", + "columns": [ + "family_head_person_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "surface", + "producer": "nz.targets.compile", + "artifact": "surface" + }, + { + "name": "preparation", + "producer": "nz.targets.prepare", + "artifact": "preparation" + } + ] + }, + { + "id": "nz.calibrate", + "kernel": "calibrate.ordered_adam@1", + "structural": "reweight", + "base": "nz.central", + "mass": "free", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "weights": { + "entity": "household", + "to_kind": "calibrated", + "mass": "free" + }, + "params": { + "epochs": { + "resource": "calibration_settings", + "path": [ + "epochs" + ], + "encoding": "value" + }, + "learning_rate": { + "resource": "calibration_settings", + "path": [ + "learning_rate" + ], + "encoding": "value" + }, + "mass": { + "resource": "calibration_settings", + "path": [ + "mass" + ], + "encoding": "value" + }, + "max_weight_ratio": { + "resource": "calibration_settings", + "path": [ + "max_weight_ratio" + ], + "encoding": "value" + }, + "weight_anchor": { + "resource": "calibration_settings", + "path": [ + "weight_anchor" + ], + "encoding": "value" + } + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.targets.problem", + "artifact": "problem" + } + ] + }, + { + "id": "nz.as", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.calibrate", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ] + }, + { + "id": "nz.as.inputs", + "kernel": "concepts.encode_groups@1", + "population": "nz.as", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + "liquid_financial_assets", + "employment_income", + "nonfarm_self_employment_income", + "farm_self_employment_income", + "interest_income", + "dividend_income", + "rental_income", + "private_pension_income", + "enrolled_full_time", + "legal_marital_status", + "has_disability", + "receives_nz_super", + "receives_supported_living_payment", + "receives_sole_parent_support", + "receives_jobseeker_support" + ] + }, + { + "entity": "household", + "columns": [ + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "as_area", + "as_area_alt" + ] + }, + { + "entity": "family", + "columns": [ + "family_household_id", + "family_head_person_id", + "family_source_household_id" + ] + } + ], + "outputs": [ + { + "entity": "family", + "column": "accommodation_supplement_additional_resident_in_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_area_let_to_nonresidents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_boarder", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_business_use_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_cash_assets", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_costs_are_homeownership", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_accommodation_costs", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_has_two_or_more_dependent_children", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_in_relationship", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_non_beneficiary", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_payment_share", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owner_weekly_required_payments", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_partner_receiving_accommodation_supplement", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_relevant_weekly_income", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_kainga_ora", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_residential_care_funded_under_residential_care_act", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_1", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_2", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_resides_in_area_3", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_section_68_joint_tenant_exception_applies", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_self_contained_area_let_to_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_social_housing_weekly_contributions_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_sole_parent", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "dtype": "bool" + }, + { + "entity": "family", + "column": "accommodation_supplement_total_premises_area", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_board_and_lodgings_paid", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_boarder_payments_received", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "dtype": "int64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_paid", + "dtype": "float64" + }, + { + "entity": "family", + "column": "accommodation_supplement_weekly_rent_received_from_other_residents", + "dtype": "int64" + } + ], + "params": { + "mapping": { + "resource": "concept_mapping", + "path": [], + "encoding": "json" + }, + "mapping_sha256": { + "resource": "concept_mapping", + "path": [], + "encoding": "sha256" + }, + "closure": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "json" + }, + "closure_sha256": { + "resource": "axiom_input_closure", + "path": [], + "encoding": "sha256" + }, + "unit_rule": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "json" + }, + "unit_rule_sha256": { + "resource": "benefit_unit_rule", + "path": [], + "encoding": "sha256" + }, + "engine_entity": "Family", + "rulespec_paths": [ + "nz/statutes/social_security/accommodation_supplement/core.yaml" + ], + "knobs": { + "resource": "as_encoding", + "path": [], + "encoding": "json" + }, + "scenario_sha256": { + "resource": "as_encoding", + "path": [], + "encoding": "sha256" + } + } + }, + { + "id": "nz.terminal", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.as", + "inputs": [ + { + "entity": "person", + "columns": [ + "age" + ] + } + ] + }, + { + "id": "nz.calibration.diagnostics", + "kernel": "diagnostics.calibration@1", + "population": "nz.terminal", + "inputs": [ + { + "entity": "household", + "columns": [ + "source_household_id" + ] + } + ], + "params": { + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.targets.problem", + "artifact": "problem" + }, + { + "name": "solution", + "producer": "nz.calibrate", + "artifact": "solution" + }, + { + "name": "result", + "producer": "nz.calibrate", + "artifact": "result" + }, + { + "name": "surface", + "producer": "nz.targets.compile", + "artifact": "surface" + } + ] + }, + { + "id": "nz.gates.terminal", + "kernel": "gates.battery@1", + "population": "nz.terminal", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "dividend_income", + "farm_self_employment_income", + "interest_income", + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_income_test_assessable_income", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "nonfarm_self_employment_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "private_pension_income", + "realized_capital_gains", + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment", + "rental_income", + "sex", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + }, + { + "entity": "household", + "columns": [ + "donor_support_stratum", + "household_region_code", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "rent", + "source_household_id", + "tenure" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents", + "family_household_id", + "family_source_household_id" + ] + } + ], + "params": { + "country": "nz", + "gates": { + "resource": "gates", + "path": [], + "encoding": "json" + }, + "gates_sha256": { + "resource": "gates", + "path": [], + "encoding": "sha256" + }, + "phase": "terminal", + "release_candidate": false, + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household" + }, + "artifact_inputs": [ + { + "name": "problem", + "producer": "nz.targets.problem", + "artifact": "problem" + }, + { + "name": "solution", + "producer": "nz.calibrate", + "artifact": "solution" + }, + { + "name": "diagnostics", + "producer": "nz.calibration.diagnostics", + "artifact": "diagnostics" + }, + { + "name": "surface", + "producer": "nz.targets.compile", + "artifact": "surface" + } + ] + }, + { + "id": "nz.export.prepare", + "kernel": "export.prepare@1", + "population": "nz.terminal", + "inputs": [ + { + "entity": "person", + "columns": [ + "age", + "dividend_income", + "farm_self_employment_income", + "interest_income", + "jobseeker_applicant_age", + "jobseeker_available_for_and_seeking_full_time_employment", + "jobseeker_full_time_student", + "jobseeker_has_dependent_child", + "jobseeker_has_no_income", + "jobseeker_health_condition_injury_or_disability_limits_capacity_to_seek_or_undertake_work", + "jobseeker_in_full_time_employment", + "jobseeker_income_less_than_zero_rate_cutout", + "jobseeker_losing_earnings_through_health_condition_or_injury", + "jobseeker_section_25_discretionary_student_eligibility", + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + "jobseeker_support_youngest_dependent_child_age", + "jobseeker_taken_reasonable_steps_to_find_full_time_employment", + "jobseeker_temporary_income_reduces_rate_to_zero_but_otherwise_entitled", + "jobseeker_unemployed_due_to_strike", + "jobseeker_unemployed_or_on_leave_for_employment_related_training", + "jobseeker_willing_and_able_to_undertake_full_time_employment", + "jobseeker_would_satisfy_available_for_work_but_for_work_test_exemption_circumstances", + "main_benefit_income_test_assessable_income", + "main_benefit_receiving_another_main_benefit", + "main_benefit_receiving_new_zealand_superannuation", + "main_benefit_receiving_veterans_pension", + "nonfarm_self_employment_income", + "nz_super_all_shared_adults_are_exempt_dependent_children_or_temporary_visitors", + "nz_super_birth_year", + "nz_super_born_on_or_before_30_june_of_birth_year", + "nz_super_elected_weekly_compensation_instead_of_superannuation", + "nz_super_ordinarily_resident_in_new_zealand_on_application", + "nz_super_overseas_application_residence_exception_applies", + "nz_super_person_age", + "nz_super_principal_residence_is_qualifying_accommodation", + "nz_super_resident_present_since_age_20_new_zealand_years", + "nz_super_resident_present_since_age_20_total_years", + "nz_super_resident_present_since_age_50_total_years", + "nz_super_shares_residence_with_person_at_least_adult_age", + "nz_super_single", + "private_pension_income", + "realized_capital_gains", + "receives_jobseeker_support", + "receives_nz_super", + "receives_sole_parent_support", + "receives_supported_living_payment", + "rental_income", + "sex", + "social_security_continuous_residence_years_after_citizen_or_resident", + "social_security_continuous_residence_years_before_application", + "social_security_new_zealand_citizen", + "social_security_only_temporary_entry_class_visa_holder", + "social_security_ordinarily_resident_in_new_zealand_on_application", + "social_security_ordinarily_resident_in_reciprocity_country", + "social_security_refugee_or_protected_person", + "social_security_regulations_treat_person_as_meeting_residence_requirement", + "social_security_residence_class_visa_holder", + "social_security_section_205_override_applies", + "social_security_unlawfully_resident_or_present_in_new_zealand", + "sole_parent_applicant_age", + "sole_parent_caring_for_dependent_children_under_age_limit", + "sole_parent_is_mother_or_father_or_child_regarded_as_child", + "sole_parent_is_single", + "sole_parent_living_apart_and_lost_or_lacks_partner_support", + "sole_parent_lost_regular_support_due_to_partner_sentence_conditions", + "sole_parent_marriage_or_civil_union_dissolved", + "sole_parent_receiving_sole_parent_support", + "sole_parent_split_care_court_order_exception_applies", + "sole_parent_split_care_entitlement_allocated_to_person", + "sole_parent_split_care_situation_applies", + "sole_parent_spouse_or_partner_died", + "sole_parent_support_personal_earnings_used_for_childcare", + "sole_parent_support_total_income", + "sole_parent_youngest_dependent_child_age", + "supported_living_applicant_age", + "supported_living_blind_average_weekly_earnings", + "supported_living_blind_beneficiary_employed", + "supported_living_blind_other_weekly_amounts_from_all_sources", + "supported_living_capacity_restricted_by_health_condition_injury_or_disability", + "supported_living_cared_person_is_spouse_or_partner", + "supported_living_cared_person_would_otherwise_receive_institutional_care", + "supported_living_caring_applicant_age", + "supported_living_caring_applicant_has_dependent_child", + "supported_living_caring_payment_already_granted", + "supported_living_caring_required_full_time_care_at_home", + "supported_living_caring_temporary_continuation_days", + "supported_living_open_employment_trial_agreed_with_msd", + "supported_living_open_employment_trial_weeks", + "supported_living_payment_applicant_age", + "supported_living_payment_beneficiary_personal_earnings", + "supported_living_payment_caring", + "supported_living_payment_dependent_children_count", + "supported_living_payment_granted_for_restricted_work_capacity", + "supported_living_payment_partner_receives_main_benefit", + "supported_living_payment_partner_receives_new_zealand_superannuation_or_veterans_pension", + "supported_living_payment_partnered_long_term_residential_care_halving_applies", + "supported_living_payment_restricted_or_blind", + "supported_living_payment_single", + "supported_living_payment_total_income", + "supported_living_payment_totally_blind", + "supported_living_regular_open_employment_capacity_hours_per_week", + "supported_living_restricted_capacity_or_blindness_self_inflicted_to_qualify", + "supported_living_restricting_condition_expected_to_continue_required_period", + "supported_living_terminal_condition", + "supported_living_totally_blind" + ] + }, + { + "entity": "household", + "columns": [ + "donor_support_stratum", + "household_region_code", + "mortgage_interest", + "mortgage_principal", + "property_tax", + "rent", + "source_household_id", + "tenure" + ] + }, + { + "entity": "family", + "columns": [ + "accommodation_supplement_additional_resident_in_social_housing", + "accommodation_supplement_area_let_to_nonresidents", + "accommodation_supplement_boarder", + "accommodation_supplement_business_use_area", + "accommodation_supplement_cash_assets", + "accommodation_supplement_concessionary_mortgage_payments_to_kainga_ora_or_crown", + "accommodation_supplement_costs_are_homeownership", + "accommodation_supplement_disability_accommodation_or_care_funded_under_pae_ora_act", + "accommodation_supplement_has_accommodation_costs", + "accommodation_supplement_has_dependent_children", + "accommodation_supplement_has_two_or_more_dependent_children", + "accommodation_supplement_in_relationship", + "accommodation_supplement_joint_owner_with_resident", + "accommodation_supplement_non_beneficiary", + "accommodation_supplement_owner_weekly_payment_share", + "accommodation_supplement_owner_weekly_required_payments", + "accommodation_supplement_owns_premises_and_not_joint_owner_with_resident", + "accommodation_supplement_partner_receiving_accommodation_supplement", + "accommodation_supplement_receiving_or_eligible_for_student_allowance_grant", + "accommodation_supplement_relevant_weekly_income", + "accommodation_supplement_rent_paid_to_kainga_ora", + "accommodation_supplement_rent_paid_to_registered_community_housing_provider_social_housing", + "accommodation_supplement_residential_care_funded_under_residential_care_act", + "accommodation_supplement_resides_in_area_1", + "accommodation_supplement_resides_in_area_2", + "accommodation_supplement_resides_in_area_3", + "accommodation_supplement_section_68_joint_tenant_exception_applies", + "accommodation_supplement_self_contained_area_let_to_residents", + "accommodation_supplement_social_housing_weekly_contributions_paid", + "accommodation_supplement_sole_parent", + "accommodation_supplement_super_or_veterans_pension_income_above_schedule_5_limit", + "accommodation_supplement_total_premises_area", + "accommodation_supplement_weekly_board_and_lodgings_paid", + "accommodation_supplement_weekly_boarder_payments_received", + "accommodation_supplement_weekly_contributions_received_from_additional_residents", + "accommodation_supplement_weekly_rent_paid", + "accommodation_supplement_weekly_rent_received_from_other_residents", + "family_household_id", + "family_source_household_id" + ] + } + ], + "params": { + "entities": [ + "person", + "household", + "family" + ], + "weight_entity": "household", + "time_period": { + "resource": "export_contract", + "path": [ + "_period", + "dataset_time_period" + ], + "encoding": "value" + }, + "bindings": { + "resource": "export_replay_bindings", + "path": [], + "encoding": "json" + } + }, + "artifact_inputs": [ + { + "name": "gate_report", + "producer": "nz.gates.terminal", + "artifact": "gate_report" + } + ] + }, + { + "id": "nz.export.readback", + "kernel": "export.readback@1", + "population": "nz.terminal", + "sources": [ + "nz_exported_dataset" + ], + "artifact_inputs": [ + { + "name": "export_descriptor", + "producer": "nz.export.prepare", + "artifact": "export_descriptor" + } + ] + }, + { + "id": "nz.package", + "kernel": "transport.package@1", + "population": "nz.terminal", + "params": { + "bindings": { + "prepared": "engine_refs" + } + }, + "artifact_inputs": [ + { + "name": "export_readback", + "producer": "nz.export.readback", + "artifact": "export_readback" + }, + { + "name": "gate_report", + "producer": "nz.gates.terminal", + "artifact": "gate_report" + }, + { + "name": "diagnostics", + "producer": "nz.calibration.diagnostics", + "artifact": "diagnostics" + }, + { + "name": "surface", + "producer": "nz.targets.compile", + "artifact": "surface" + } + ] + } + ], + "endpoints": { + "geography": "nz.geo.gate", + "calibration": "nz.calibrate", + "terminal": [ + "nz.export.prepare", + "nz.package" + ] + }, + "pending_outputs": [ + "w4 support, release-input coverage and weight audit evidence", + "r2c income stand-in and reconciliation", + "P1 earnings, Census rent and liquid-assets quantile producers" + ] +} diff --git a/packages/microcosm-build/src/microcosm/build/nz/transport_inputs.json b/packages/microcosm-build/src/microcosm/build/nz/transport_inputs.json new file mode 100644 index 0000000000..d10e37d5b9 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/nz/transport_inputs.json @@ -0,0 +1,20 @@ +{ + "donor": { + "kind": "public_microdata", + "format": "hdf5", + "vintage": "2024", + "locator": "populace_us_2024.h5", + "revision": "populace-us-2024-buildp-sparse-rmloss100-cae8640-20260728T011454Z", + "repository": { + "provider": "huggingface", + "owner": "policyengine", + "name_parts": [ + "populace-us" + ], + "repo_type": "dataset" + }, + "sha256": "48b9d479fb4fd1c3537f9383ce4697d130b6f618658409d74f6233c43b994c7e", + "size_bytes": 462915783, + "integrity_note": "The revision is the immutable release tag named by the public latest.json pointer on 2026-08-29. Execution must verify both SHA-256 and byte size before reading; main/latest fallback is forbidden." + } +} diff --git a/packages/microcosm-build/src/microcosm/build/transport/compose.py b/packages/microcosm-build/src/microcosm/build/transport/compose.py index 3cf0c437b6..506c8f0e62 100644 --- a/packages/microcosm-build/src/microcosm/build/transport/compose.py +++ b/packages/microcosm-build/src/microcosm/build/transport/compose.py @@ -87,6 +87,7 @@ from microcosm.build.reference_profiles import resolve_reference_profiles from microcosm.calibrate.ordered_kernels import OUTPUT_TYPES from microcosm.frame.kernels import missing_relation_inputs +from microcosm.frame.materialize import _WEIGHT_COLUMN_SUFFIX from microcosm.graph import ( ROWS_ALL, ArtifactInput, @@ -175,6 +176,7 @@ "geography.support_from_facts@1", "geography.assign_atomic@1", "geography.derive@1", + "geography.person_location@1", "geography.gate@1", "diagnostics.calibration@1", "gates.battery@1", @@ -205,6 +207,7 @@ "endpoints", "pending_outputs", "mass_partition", + "export_contract", } ) _NODE_FIELDS = frozenset( @@ -1272,6 +1275,148 @@ def transport_graph_document(spec: Mapping[str, object]) -> Mapping: return document +def _check_export_contract( + spec: Mapping[str, object], graph: Graph, compiled: CompiledGraph +) -> None: + """Enforce an opt-in closed roster on export and terminal gate slices. + + The declaration names the resource; its entity-qualified slices govern the + actual node inputs. This composition check changes no kernel implementation. + """ + resource = transport_graph_document(spec).get("export_contract") + if resource is None: + return + if not _is_text(resource): + raise ValueError("Transport export_contract must name a resource.") + declaration = _versioned_create_units(spec) + if declaration is None: + declaration = create_unit_declaration( + CREATE_V1_REF, transport_resource(spec, "benefit_unit_rule") + ) + schema = declaration.entity_schema()[0] + automatic = { + entity: {schema.entity_id_column(entity)} for entity in schema.entities + } + automatic[schema.person_entity].update( + schema.membership_column(group) for group in schema.group_entities + ) + contract = transport_resource(spec, resource) + if contract.get("closed") is not True: + raise ValueError("Transport export_contract requires a closed roster.") + rosters = _mapping(contract.get("entity_slices"), "export_contract.entity_slices") + if set(rosters) != {"export", "gates"}: + raise ValueError("Export contract entity_slices must name export and gates.") + required = set(_sequence(contract.get("required"), "export_contract.required")) + allowed = required | set( + _sequence(contract.get("optional", ()), "export_contract.optional") + ) + excluded = set( + _sequence(contract.get("forbidden", ()), "export_contract.forbidden") + ) | set( + _sequence( + contract.get("formula_owned_excluded", ()), + "export_contract.formula_owned_excluded", + ) + ) + replay_by_version: dict[str, set[tuple[str, str]]] = {} + scratch = { + (binding["entity"], column) + for binding in transport_resource(spec, "axiom_rules_bindings").get( + "bindings", () + ) + for column in binding.get("variables", ()) + } + for node in graph.nodes: + outputs = {(item.entity, item.column) for item in node.outputs} + if node.kernel in { + "concepts.encode@1", + "concepts.encode_groups@1", + "takeup.assign@1", + }: + replay_by_version.setdefault(compiled.versions[node.id], set()).update( + outputs + ) + elif node.kernel == MONEY_NORMALIZE_REF: + replay_by_version.setdefault(compiled.versions[node.id], set()).update( + (item.entity, item.column) for item in node.outputs if item.rewrite + ) + scratch.update( + (item.entity, item.column) for item in node.outputs if not item.rewrite + ) + elif node.kernel in _MONEY_BRIDGES or node.kernel.startswith("reporting."): + scratch.update(outputs) + for role, kernel in ( + ("export", "export.prepare@1"), + ("gates", "gates.battery@1"), + ): + nodes = [ + node + for node in graph.nodes + if node.kernel == kernel + and (role != "gates" or node.params.get("phase") == "terminal") + ] + if not nodes: + raise ValueError(f"Export contract requires its {role} node.") + replay = set() + for node in nodes: + version = compiled.versions[node.id] + while version is not None: + replay.update(replay_by_version.get(version, ())) + version = graph.node(version).base + roster = _mapping(rosters[role], f"export_contract.entity_slices.{role}") + expected = set() + for entity, columns in roster.items(): + if not _is_text(entity): + raise ValueError("Export contract entities must be nonempty text.") + names = _sequence(columns, f"export_contract {role} {entity}") + if ( + not names + or any(not _is_text(name) for name in names) + or len(set(names)) != len(names) + ): + raise ValueError("Export contract columns must be distinct text.") + expected.update((entity, name) for name in names) + names = {column for _, column in expected} + # Export materializes typed weights; no table-column owner supplies them. + materialized_weights = { + f"{node.params['weight_entity']}{_WEIGHT_COLUMN_SUFFIX}" + for node in nodes + if _is_text(node.params.get("weight_entity")) + } + # The executor projects ids and person memberships for sliced entities. + automatic_names = { + column + for node in nodes + for item in node.inputs + for column in automatic.get(item.entity, ()) + } + effective_names = names | materialized_weights | automatic_names + if ( + effective_names - allowed + or effective_names & excluded + or expected & scratch + ): + raise ValueError( + f"Export contract {role} includes columns outside its closed roster " + "or includes scratch, reporting or formula outputs." + ) + missing_required = required - names - materialized_weights - automatic_names + if missing_required or replay - expected: + raise ValueError( + f"Export contract {role} omits required replay inputs: " + f"{sorted(replay - expected)}; required columns {sorted(missing_required)}." + ) + for node in nodes: + actual = { + (item.entity, column) for item in node.inputs for column in item.columns + } + if any(item.rows != ROWS_ALL for item in node.inputs) or actual != expected: + raise ValueError( + f"Export contract {role} node {node.id!r} must select its exact " + "entity-qualified whole-row slice." + ) + + def _ancestor_closure( predecessors: Mapping[str, Sequence[str]], roots: set[str] ) -> set[str]: @@ -3172,6 +3317,7 @@ def compose_transport_graph( and not gate_inputs ): _check_extension_checkpoints(spec, config, skeleton, compiled) + _check_export_contract(spec, skeleton, compiled) return skeleton skeleton_nodes = [] for node in skeleton.nodes: @@ -3201,6 +3347,7 @@ def compose_transport_graph( # Money ownership is checked after each graph pass of the ancestry guard. _check_single_money_normalization(spec, graph, extended) _check_money_bridge_owners(graph, extended) + _check_export_contract(spec, graph, extended) for node in skeleton.nodes: expected = ( set(compiled.predecessors[node.id]) diff --git a/packages/microcosm-build/src/microcosm/build/transport/person_location_kernels.py b/packages/microcosm-build/src/microcosm/build/transport/person_location_kernels.py new file mode 100644 index 0000000000..988a6db5d8 --- /dev/null +++ b/packages/microcosm-build/src/microcosm/build/transport/person_location_kernels.py @@ -0,0 +1,156 @@ +"""Carry assigned household location strings to persons. + +``geography.derive@1`` owns household strings only. ``geography.person_location@1`` +projects declared household string columns to person string columns through +the structural household membership. Its ``columns`` parameter is a closed +canonical JSON object from household column to person column. Every person +receives exactly their own household's value, in the person table's row +order. A person whose household id names no household row, a missing +household value or a non-string value refuses, naming the rows. The kernel +changes no weights, rows, memberships or household columns. +""" + +from __future__ import annotations + +import json +from collections.abc import Mapping + +import numpy as np +import pandas as pd + +from microcosm.frame import EntitySchema +from microcosm.graph import ( + Capabilities, + Determinism, + KernelBase, + KernelContext, + KernelRegistry, + KernelResult, + Numeric, + SeedSource, + source_hash, +) +from microcosm.graph.canonical import canonical_json + +__all__ = [ + "GEOGRAPHY_PERSON_LOCATION", + "GeographyPersonLocationKernel", + "register_person_location_kernels", +] + +_DEPENDENCIES = ("numpy", "pandas") +#: The household partition and the person membership that projects it. +_SCHEMA = EntitySchema(group_entities=("household",)) +_HOUSEHOLD = "household" + + +def _columns(params: Mapping[str, object]) -> dict[str, str]: + if set(params) != {"columns"} or not isinstance(params["columns"], str): + raise ValueError( + "geography.person_location@1 requires exactly its canonical columns map." + ) + try: + columns = json.loads(params["columns"]) + except ValueError as error: + raise ValueError("Person location columns must be valid JSON.") from error + if ( + not isinstance(columns, dict) + or not columns + or canonical_json(columns).decode("utf-8") != params["columns"] + or any( + not isinstance(key, str) + or not key + or not isinstance(value, str) + or not value + for key, value in columns.items() + ) + or len(set(columns.values())) != len(columns) + ): + raise ValueError( + "Person location columns must be a canonical nonempty map of distinct " + "household and person column names." + ) + structural = { + _SCHEMA.person_id_column, + _SCHEMA.membership_column(_HOUSEHOLD), + _SCHEMA.id_column(_HOUSEHOLD), + } + if structural & (set(columns) | set(columns.values())): + raise ValueError("Person location columns cannot name structural columns.") + return columns + + +def _refuse(mask, ids, message): + if mask.any(): + raise ValueError( + f"geography.person_location@1 {message}; rows {ids[mask].tolist()!r}." + ) + + +class GeographyPersonLocationKernel(KernelBase): + """Project household location strings to persons through membership.""" + + ref = "geography.person_location@1" + capabilities = Capabilities( + determinism=Determinism.DETERMINISTIC, + numeric=Numeric.BITWISE, + seed_source=SeedSource.NONE, + dependencies=_DEPENDENCIES, + ) + + def implementation_hash(self) -> str: + return source_hash(type(self), canonical_json, dependencies=_DEPENDENCIES) + + def run(self, context: KernelContext) -> KernelResult: + columns = _columns(context.params) + declared = {(o.entity, o.column, o.dtype) for o in context.node.outputs} + if declared != {(_SCHEMA.person_entity, c, "string") for c in columns.values()}: + raise ValueError( + "Person location owned outputs must be exactly the mapped person " + "string columns." + ) + if ( + _HOUSEHOLD not in context.tables + or _SCHEMA.person_entity not in context.tables + ): + raise ValueError("Person location requires household and person tables.") + households = context.tables[_HOUSEHOLD] + persons = context.tables[_SCHEMA.person_entity] + missing = sorted(set(columns) - set(households.columns)) + if missing: + raise ValueError(f"Person location requires household columns {missing!r}.") + household_ids = pd.Index(households[_SCHEMA.id_column(_HOUSEHOLD)]) + if not household_ids.is_unique: + raise ValueError("Person location requires unique household ids.") + membership = persons[_SCHEMA.membership_column(_HOUSEHOLD)].to_numpy() + person_ids = persons[_SCHEMA.person_id_column].to_numpy() + positions = household_ids.get_indexer(membership) + _refuse(positions < 0, person_ids, "person household ids match no household") + index = pd.Index(person_ids, name=_SCHEMA.person_id_column) + result = {} + receipt = {} + for source, target in columns.items(): + values = households[source].to_numpy(dtype=object) + invalid = np.asarray( + [not isinstance(value, str) for value in values], dtype=bool + ) + _refuse( + invalid, + household_ids.to_numpy(), + f"household {source} must hold a string on every household", + ) + projected = values[positions] + result[(_SCHEMA.person_entity, target)] = pd.Series( + pd.array(projected, dtype="string"), index=index, name=target + ) + receipt[target] = {"source": f"{_HOUSEHOLD}.{source}", "n": len(projected)} + return KernelResult(columns=result, receipt={"columns": receipt}) + + +GEOGRAPHY_PERSON_LOCATION = GeographyPersonLocationKernel() + + +def register_person_location_kernels(registry: KernelRegistry) -> KernelRegistry: + """Install the person-location kernel; repeating it is idempotent.""" + registry.register(GEOGRAPHY_PERSON_LOCATION) + return registry diff --git a/packages/microcosm-build/src/microcosm/build/transport/registry.py b/packages/microcosm-build/src/microcosm/build/transport/registry.py index 82a5cec524..23b4262e38 100644 --- a/packages/microcosm-build/src/microcosm/build/transport/registry.py +++ b/packages/microcosm-build/src/microcosm/build/transport/registry.py @@ -48,6 +48,7 @@ from .gate_kernels import register_gate_kernel from .geography_kernels import register_geography_kernels from .money_kernels import register_money_kernels +from .person_location_kernels import register_person_location_kernels from .population_kernels import register_population_kernels from .reporting_kernels import register_reporting_kernels from .takeup_kernels import register_takeup_kernels @@ -510,6 +511,7 @@ def build_transport_registry( register_transport_codecs(codecs) register_transport_population_kernels(kernels) register_atomic_geography_kernels(kernels) + register_person_location_kernels(kernels) register_target_kernels(kernels) kernels.register(CALIBRATE_ORDERED_ADAM) register_gate_kernel(kernels, TRANSPORT_GATE_REGISTRY) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_atomic_geography.py b/packages/microcosm-build/tests/engine_free/shared/test_atomic_geography.py index ccc4b172c8..ac93c30fbd 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_atomic_geography.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_atomic_geography.py @@ -1,6 +1,7 @@ """Invented support controls; no survey, Census or administrative files are read.""" from copy import deepcopy +from dataclasses import replace import numpy as np import pandas as pd @@ -509,3 +510,125 @@ def test_typed_geography_gate_edge_refuses_invalid_producer_contract(defect): (base, *nodes, consumer), ) ) + + +def _person_location_run(persons, households, *, columns=None, unmatched=None): + from microcosm.build.transport.person_location_kernels import ( + GEOGRAPHY_PERSON_LOCATION, + ) + from microcosm.graph import Slice + from test_support.microcosm_frame.kernels import _context + + schema = EntitySchema(group_entities=("household",)) + frame = Frame( + {"person": persons, "household": households}, + schema, + {"household": Weights(np.ones(len(households)), WeightKind.DESIGN)}, + ) + node = Node( + "toy.geo.person", + GEOGRAPHY_PERSON_LOCATION.ref, + inputs=( + Slice("household", ("household_region_code",)), + Slice("person", ("person_household_id",)), + ), + outputs=(Owned("person", "region_code", "string"),), + params={ + "columns": canonical_json( + columns or {"household_region_code": "region_code"} + ).decode() + }, + ) + context = _context(frame, node, weighted_entities=("household",)) + if unmatched is not None: + # Frame refuses a membership that names no household, so the kernel's + # own guard is reached only through a hand-built view. + person, household = unmatched + tables = dict(context.tables) + view = tables["person"].copy() + view.loc[view["person_id"] == person, "person_household_id"] = household + tables["person"] = view + context = replace(context, tables=tables) + return GEOGRAPHY_PERSON_LOCATION.run(context) + + +def _location_tables(): + # Persons sit in an order unrelated to household rows, so a projection by + # row position gives some persons another household's code. + persons = pd.DataFrame( + { + "person_id": [17, 3, 11, 5, 8], + "person_household_id": [30, 10, 20, 30, 10], + } + ) + households = pd.DataFrame( + { + "household_id": [10, 20, 30], + "household_region_code": pd.array(["01", "99", "13"], dtype="string"), + } + ) + return persons, households + + +def test_person_location_gives_every_person_their_own_households_code(): + persons, households = _location_tables() + result = _person_location_run(persons, households) + values = result.columns["person", "region_code"] + # Row order and count hold: the result indexes the persons as given. + assert values.index.tolist() == persons["person_id"].tolist() + assert str(values.dtype) == "string" + by_household = dict( + zip( + households["household_id"], + households["household_region_code"], + strict=True, + ) + ) + assert values.tolist() == [ + by_household[household] for household in persons["person_household_id"] + ] + assert values.tolist() == ["13", "01", "99", "13", "01"] + # The household table is read, never written. + assert set(result.columns) == {("person", "region_code")} + + +@pytest.mark.parametrize("missing", [None, pd.NA]) +def test_person_location_refuses_a_missing_household_value(missing): + persons, households = _location_tables() + households["household_region_code"] = pd.array( + ["01", missing, "13"], dtype="string" + ) + with pytest.raises(ValueError, match=r"must hold a string.*rows \[20\]"): + _person_location_run(persons, households) + + +def test_person_location_refuses_a_person_whose_household_is_absent(): + persons, households = _location_tables() + with pytest.raises(ValueError, match=r"match no household; rows \[11\]"): + _person_location_run(persons, households, unmatched=(11, 40)) + + +@pytest.mark.parametrize( + "columns", + [ + {"household_region_code": "person_household_id"}, + {"household_id": "region_code"}, + ], +) +def test_person_location_refuses_structural_column_maps(columns): + persons, households = _location_tables() + with pytest.raises(ValueError, match="structural"): + _person_location_run(persons, households, columns=columns) + + +def test_person_location_registers_outside_the_shared_geography_module(): + from microcosm.build.transport.person_location_kernels import ( + register_person_location_kernels, + ) + + shared = KernelRegistry() + register_atomic_geography_kernels(shared) + assert "geography.person_location@1" not in shared.refs() + registry = register_person_location_kernels(KernelRegistry()) + register_person_location_kernels(registry) + assert registry.refs() == ("geography.person_location@1",) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_as_bridge.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_as_bridge.py new file mode 100644 index 0000000000..5673c99b77 --- /dev/null +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_as_bridge.py @@ -0,0 +1,955 @@ +"""The packaged reg 17 base rate and reg 18 cutout, run on labelled fixture engines. + +``JobseekerShapeFixture`` copies only the shape of rulespec-nz's +``jobseeker_support_gross_weekly_rate``, ``..._weekly_income_test_reduction`` +and ``..._net_weekly_payment`` formulas. Its default numbers are fixture +values: three of them (the single-with-children rate 521.52, the lower +threshold 160 and the Income Test 3 rate 0.7) and the eldest-child tax credit +7921 reproduce golden-08's compiled quantities; every other number is +invented so the branches differ. None is a statement of NZ law. The tests +execute the packaged node declarations through the real kernels. +""" + +from __future__ import annotations + +import copy +import json +from dataclasses import dataclass +from decimal import Decimal + +import numpy as np +import pandas as pd +import pytest +from hypothesis import assume, given, settings +from hypothesis import strategies as st + +from microcosm.build.transport.compose import ( + TransportGraphConfig, + _artifact_outputs, + load_transport_spec, +) +from microcosm.build.transport.entitlement import _parameter, _rows +from microcosm.build.transport.target_kernels import CalibrationPrepareKernel +from microcosm.frame import ExportContract, Frame, VariableMetadata, WeightKind, Weights +from microcosm.frame.adapters.axiom import NZ_SCHEMA +from microcosm.frame.rules_kernels import ( + SimulateCounterfactualKernel, + SimulateSolveZeroKernel, +) +from microcosm.graph import Node, Owned, Slice +from test_support.microcosm_frame.kernels import _context +from test_support.paths import paths_for + +_FIXTURES = paths_for("microcosm-build").tests / "fixtures/nz" +_SPEC = load_transport_spec("nz") +_BRIDGE = _SPEC["resources"]["as_rate_bridge"] +_BASE = "accommodation_supplement_base_rate_weekly_amount" +_CUTOUT = "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount" +_HAS_CHILD = "accommodation_supplement_bridge_has_dependent_child" +_GROSS = "accommodation_supplement_bridge_sole_parent_gross_rate" +_YOUNGEST = "jobseeker_support_youngest_dependent_child_age" +_JS_BINDINGS = ( + "main_benefits_rates", + "family_tax_credits", + "nz_super", + "accommodation_supplement", +) +_REFS = {name: f"fixture:{name}" for name in _JS_BINDINGS} +_CONFIG = TransportGraphConfig( + engine_refs=_REFS, create_outputs=(Owned("person", "age", "int64"),) +) + + +@dataclass +class JobseekerShapeFixture: + """Fixture numbers for the Jobseeker Support formula shape; not NZ law.""" + + single_with_children: float = 521.52 + single_youngest_14_or_older: float = 480.10 + single_under_20_living_with_parent: float = 250.0 + single_under_25: float = 300.0 + single_transferred_2013: float = 340.0 + single_standard: float = 360.0 + partner_ineligible_with_children: float = 410.0 + partner_ineligible_without_children: float = 330.0 + both_main_with_children: float = 430.0 + both_main_without_children: float = 310.0 + super_partner_with_children: float = 420.0 + super_partner_without_children: float = 300.0 + no_benefit_partner_with_children: float = 450.0 + no_benefit_partner_without_children: float = 320.0 + lower: float = 160.0 + upper: float = 250.0 + test_1_lower_rate: float = 0.3 + test_1_upper_rate: float = 0.7 + test_3_rate: float = 0.7 + test_4_rate: float = 0.35 + + def gross(self, row): + children = row["jobseeker_support_dependent_children_count"] >= 1 + if row["jobseeker_support_single"]: + if children: + if row[_YOUNGEST] >= 14: + return self.single_youngest_14_or_older + return self.single_with_children + if ( + row["jobseeker_support_applicant_age"] < 20 + and row["jobseeker_support_living_with_parent"] + and row["jobseeker_support_benefit_commenced_on_or_after_1998_07_01"] + ): + return self.single_under_20_living_with_parent + if row["jobseeker_support_applicant_age"] < 25: + return self.single_under_25 + if row["jobseeker_support_transferred_2013_no_dependent_children"]: + return self.single_transferred_2013 + return self.single_standard + if row["jobseeker_support_partner_ineligible_due_to_sanction_or_strike"]: + return ( + self.partner_ineligible_with_children + if children + else self.partner_ineligible_without_children + ) + if row["jobseeker_support_partner_receives_main_benefit"]: + return ( + self.both_main_with_children + if children + else self.both_main_without_children + ) + if row[ + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension" + ]: + return ( + self.super_partner_with_children + if children + else self.super_partner_without_children + ) + return ( + self.no_benefit_partner_with_children + if children + else self.no_benefit_partner_without_children + ) + + def _test_1(self, income): + return ( + min(max(0, income - self.lower), max(0, self.upper - self.lower)) + * self.test_1_lower_rate + + max(0, income - self.upper) * self.test_1_upper_rate + ) + + def reduction(self, row): + income = row["jobseeker_support_total_income"] + if row["jobseeker_support_single"]: + if row["jobseeker_support_dependent_children_count"] >= 1: + return self._test_1(income) + if row["jobseeker_support_transferred_2013_no_dependent_children"]: + return self._test_1(income) + return max(0, income - self.lower) * self.test_3_rate + if ( + row["jobseeker_support_partner_ineligible_due_to_sanction_or_strike"] + or row["jobseeker_support_partner_receives_main_benefit"] + or row[ + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension" + ] + ): + return max(0, income - self.lower) * self.test_4_rate + return max(0, income - self.lower) * self.test_3_rate + + def net(self, row): + return max(0, self.gross(row) - self.reduction(row)) + + +_JS_INPUTS = ( + "jobseeker_support_applicant_age", + "jobseeker_support_benefit_commenced_on_or_after_1998_07_01", + "jobseeker_support_dependent_children_count", + "jobseeker_support_living_with_parent", + "jobseeker_support_partner_ineligible_due_to_sanction_or_strike", + "jobseeker_support_partner_receives_main_benefit", + "jobseeker_support_partner_receives_new_zealand_superannuation_or_veterans_pension", + "jobseeker_support_single", + "jobseeker_support_total_income", + "jobseeker_support_transferred_2013_no_dependent_children", + _YOUNGEST, +) + + +class _FixtureEngine: + """Engine protocol double that records each input column it receives.""" + + entity = "person" + inputs: tuple[str, ...] = () + outputs: tuple[str, ...] = () + + def __init__(self): + self.received: list[pd.DataFrame] = [] + + def entity_schema(self): + return NZ_SCHEMA + + def variables(self): + return self.inputs + + def variable_metadata(self, name): + if name not in self.outputs: + raise ValueError("Input variables have no engine output metadata") + return VariableMetadata( + name=name, entity=self.entity, dtype="float", period="year" + ) + + def export_contract(self): + return ExportContract.empty() + + def write_dataset(self, bundle, path, period): + return None + + def _batch(self, table): + """Read inputs by column dtype, as the Axiom adapter's batch builder does.""" + batch = {} + for name in self.inputs: + column = table[name] + kind = column.dtype.kind + if kind == "b": + batch[name] = column.to_numpy(dtype=bool) + elif kind in ("i", "u"): + batch[name] = column.to_numpy(dtype=np.int64) + elif kind == "f": + batch[name] = column.to_numpy(dtype=np.float64) + else: + raise ValueError(f"Column {name!r} has dtype kind {kind!r}.") + return batch + + +class JobseekerEngine(_FixtureEngine): + inputs = _JS_INPUTS + outputs = ( + "jobseeker_support_gross_weekly_rate", + "jobseeker_support_weekly_income_test_reduction", + "jobseeker_support_net_weekly_payment", + ) + + def __init__(self, schedule=None): + super().__init__() + self.schedule = JobseekerShapeFixture() if schedule is None else schedule + + def materialize(self, bundle, variables, period): + assert period == "2026-27" + table = bundle.table("person") + self.received.append(table.copy()) + batch = self._batch(table) + rows = [ + {name: batch[name][index] for name in self.inputs} + for index in range(len(table)) + ] + functions = { + "jobseeker_support_gross_weekly_rate": self.schedule.gross, + "jobseeker_support_weekly_income_test_reduction": self.schedule.reduction, + "jobseeker_support_net_weekly_payment": self.schedule.net, + } + return { + name: np.asarray([functions[name](row) for row in rows], dtype=np.float64) + for name in variables + } + + +class TaxCreditEngine(_FixtureEngine): + """Prescribed amount = care units times fixture annual amounts.""" + + entity = "family" + inputs = ( + "family_tax_credit_eldest_dependent_child_care_units", + "family_tax_credit_subsequent_dependent_child_care_units", + ) + outputs = ("family_tax_credit_prescribed_amount",) + eldest = 7921.0 + subsequent = 6438.0 + + def materialize(self, bundle, variables, period): + table = bundle.table("family") + self.received.append(table.copy()) + batch = self._batch(table) + return { + "family_tax_credit_prescribed_amount": batch[self.inputs[0]] * self.eldest + + batch[self.inputs[1]] * self.subsequent + } + + +class SuperannuationEngine(_FixtureEngine): + """A fixture weekly amount before tax for adults aged 65 or older.""" + + inputs = ("nz_super_person_age",) + outputs = ("nz_super_weekly_amount_before_tax",) + weekly = 538.0 + + def materialize(self, bundle, variables, period): + table = bundle.table("person") + self.received.append(table.copy()) + age = self._batch(table)["nz_super_person_age"] + return { + "nz_super_weekly_amount_before_tax": np.where(age >= 65, self.weekly, 0.0) + } + + +class AccommodationSupplementEngine(_FixtureEngine): + """Pays half the rent, rounded, and judges a fixture cash-asset limit. + + As in rulespec-nz's core.yaml, the rounded payment never reads the + non-rate judgment: only the host's gate can withhold it. + """ + + entity = "family" + outputs = ( + "accommodation_supplement_rounded_weekly_payment", + "accommodation_supplement_non_rate_entitlement_requirements", + ) + cash_limit = 8100.0 + + def __init__(self, undetermined=()): + super().__init__() + self.undetermined = set(undetermined) + + def variables(self): + return tuple( + entry["input"] + for entry in _SPEC["resources"]["axiom_input_closure"]["entries"] + if entry["entity"] == "Family" + and entry["rulespec_path"].endswith("accommodation_supplement/core.yaml") + ) + + def materialize(self, bundle, variables, period): + table = bundle.table("family") + self.received.append(table.copy()) + payment = np.round( + table["accommodation_supplement_weekly_rent_paid"].to_numpy(float) / 2 + ) + judgment = np.where( + table["accommodation_supplement_cash_assets"].to_numpy(float) + > self.cash_limit, + -1, + 1, + ) + judgment = np.where( + table["family_id"].isin(self.undetermined).to_numpy(), 0, judgment + ) + values = { + "accommodation_supplement_rounded_weekly_payment": payment, + "accommodation_supplement_non_rate_entitlement_requirements": judgment, + } + return {name: values[name] for name in variables} + + +def _row(node_id): + for row, scenario in _rows(_SPEC)[0]: + if row["id"] == node_id: + return copy.deepcopy(row), scenario + raise AssertionError(f"No packaged node {node_id!r}.") + + +def _node(row, scenario): + return Node( + row["id"], + row["kernel"], + inputs=tuple( + Slice(item["entity"], tuple(item["columns"])) for item in row["inputs"] + ), + outputs=tuple( + Owned(item["entity"], item["column"], item["dtype"]) + for item in row["outputs"] + ), + params={ + key: _parameter(_SPEC, _CONFIG, value, scenario) + for key, value in row["params"].items() + }, + artifact_outputs=_artifact_outputs(row), + ) + + +@dataclass +class Unit: + """One invented benefit unit; every amount is fixture data.""" + + partnered: bool = False + children: tuple[int, ...] = () + receipt_group: str = "beneficiary" + adult_age: int = 30 + cash_assets: float = 0.0 + rent: float = 400.0 + + +_RECEIPT_FLAGS = { + "superannuitant": "receives_nz_super", + "beneficiary": "receives_jobseeker_support", +} + + +def _closure_inputs(binding, entity): + path = next( + row["rulespec_path"] + for row in _SPEC["resources"]["axiom_rules_bindings"]["bindings"] + if row["id"] == binding + ) + return { + entry["input"]: entry.get("value", 0) + for entry in _SPEC["resources"]["axiom_input_closure"]["entries"] + if entry["rulespec_path"] == path and entry["entity"] == entity + } + + +def _frame(units): + flags = { + flag + for predicate in _SPEC["resources"]["reporting_classifiers"]["receipt_group"][ + "predicates" + ].values() + for flag in predicate["columns"] + } + person_defaults = { + **_closure_inputs("main_benefits_rates", "Person"), + **_closure_inputs("nz_super", "Person"), + } + family_defaults = _closure_inputs("accommodation_supplement", "Family") + person, family = [], [] + next_person = 1 + for index, unit in enumerate(units): + family_id = 100 + index + adults = 2 if unit.partnered else 1 + for member in range(adults + len(unit.children)): + adult = member < adults + age = unit.adult_age if adult else unit.children[member - adults] + row = { + "person_id": next_person, + "person_household_id": family_id, + "person_family_id": family_id, + **person_defaults, + "age": age, + "nz_super_person_age": age, + **{ + flag: adult and _RECEIPT_FLAGS.get(unit.receipt_group) == flag + for flag in sorted(flags) + }, + } + person.append(row) + next_person += 1 + youngest = min(unit.children) if unit.children else None + family_type = ( + ("couple_with_children" if unit.children else "couple") + if unit.partnered + else ("sole_parent" if unit.children else "single") + ) + family.append( + { + "family_id": family_id, + **{ + name: (0.0 if value == 0 else value) + for name, value in family_defaults.items() + }, + "accommodation_supplement_cash_assets": unit.cash_assets, + "accommodation_supplement_weekly_rent_paid": unit.rent, + "n_dependent_children": len(unit.children), + "is_partnered": unit.partnered, + "is_single": not unit.partnered, + "is_sole_parent": not unit.partnered and bool(unit.children), + "youngest_dependent_child_age": youngest, + "family_type": family_type, + "receipt_group": unit.receipt_group, + } + ) + family = pd.DataFrame(family) + family["youngest_dependent_child_age"] = family[ + "youngest_dependent_child_age" + ].astype("Int64") + family["receipt_group"] = family["receipt_group"].astype("string") + family["family_type"] = family["family_type"].astype("string") + ids = family["family_id"].to_numpy() + return Frame( + { + "person": pd.DataFrame(person), + "household": pd.DataFrame({"household_id": ids}), + "family": family, + }, + NZ_SCHEMA, + {"household": Weights(np.ones(len(ids)), WeightKind.DESIGN)}, + ) + + +def _engines(schedule=None, *, undetermined=()): + return { + _REFS["main_benefits_rates"]: JobseekerEngine(schedule), + _REFS["family_tax_credits"]: TaxCreditEngine(), + _REFS["nz_super"]: SuperannuationEngine(), + _REFS["accommodation_supplement"]: AccommodationSupplementEngine(undetermined), + } + + +def _run(frame, row, scenario, engines): + node = _node(row, scenario) + if row["kernel"] == "calibration.prepare@1": + kernel = CalibrationPrepareKernel() + elif row["kernel"] == "simulate.solve_zero@1": + kernel = SimulateSolveZeroKernel(engines) + else: + kernel = SimulateCounterfactualKernel(engines) + result = kernel.run(_context(frame, node, weighted_entities=("household",))) + for (entity, column), values in result.columns.items(): + frame.table(entity)[column] = values.to_numpy() + return result + + +def _bridge(units, *, schedule=None, prefix="nz.as", branch="nz.scn.S0"): + """Run masks, gross rate, cutout and the branch's base rate in order.""" + frame = _frame(units) + engines = _engines(schedule) + for node_id in ( + f"{prefix}.bridge.masks", + f"{prefix}.bridge.sole_parent_gross_rate", + f"{prefix}.bridge.cutout", + f"{branch}.bridge.base_rate", + ): + _run(frame, *_row(node_id), engines) + family = frame.table("family") + ids = family["family_id"] + base = dict(zip(ids, family[_BASE], strict=True)) + return frame, engines, base, dict(zip(ids, family[_CUTOUT], strict=True)) + + +# --- Golden-08 -------------------------------------------------------------- + + +def test_fixture_run_reproduces_golden_08_base_rate_and_cutout(): + """Golden-08: a sole parent with children aged 0, 1 and 10 and no income. + + Tolerance: 1e-9 absolute, the solve's declared tolerance; the base rate's + float64 sum carries representation error near 1e-13. + """ + golden = json.loads( + (_FIXTURES / "axiom_oracle_golden_08_accommodation_supplement.json").read_text() + ) + (case,) = _BRIDGE["differential_expectations"]["cases"] + assert case["request_id"] == "golden-08" and case["branch"] == "sole_parent" + _, _, base, cutout = _bridge([Unit(children=(0, 1, 10))]) + for column, actual in ((_BASE, base[100]), (_CUTOUT, cutout[100])): + expected = Decimal(case[column]) + assert Decimal(golden["inputs"][column]["value"]) == expected + assert abs(Decimal(repr(actual)) - expected) <= Decimal("1e-9"), column + + +# --- Reg 18 ----------------------------------------------------------------- + +_BOUNDED = settings(max_examples=40, deadline=None, derandomize=True) + + +@_BOUNDED +@given( + lower=st.floats(min_value=0, max_value=400), + slope=st.floats(min_value=0.05, max_value=1), + rate=st.floats(min_value=1, max_value=1500), + children=st.lists(st.integers(min_value=0, max_value=17), min_size=1, max_size=3), +) +def test_solved_sole_parent_cutout_equals_lower_plus_rate_over_slope( + lower, slope, rate, children +): + assume(lower + rate / slope < 4999) + schedule = JobseekerShapeFixture( + single_with_children=rate, lower=lower, test_3_rate=slope + ) + _, _, _, cutout = _bridge([Unit(children=tuple(children))], schedule=schedule) + assert abs(cutout[100] - (lower + rate / slope)) <= 1e-9 + + +@_BOUNDED +@given( + lower=st.floats(min_value=0, max_value=450), + test_3=st.floats(min_value=0.05, max_value=1), + test_4=st.floats(min_value=0.05, max_value=1), + single=st.floats(min_value=1, max_value=1500), + couple=st.floats(min_value=1, max_value=1500), + couple_children=st.lists( + st.integers(min_value=0, max_value=17), min_size=0, max_size=2 + ), +) +def test_solved_other_unit_cutout_equals_the_harness_anchor_extrapolation( + lower, test_3, test_4, single, couple, couple_children +): + schedule = JobseekerShapeFixture( + single_standard=single, + both_main_with_children=couple, + both_main_without_children=couple, + lower=lower, + test_3_rate=test_3, + test_4_rate=test_4, + ) + + def payment(gross, rate, income): + return max(0.0, gross - max(0.0, income - lower) * rate) + + expected = [] + for gross, rate in ((single, test_3), (couple, test_4)): + at, after = payment(gross, rate, 500), payment(gross, rate, 501) + assume(after > 0 and lower + gross / rate < 4999) + expected.append(500 + at / (at - after)) + _, _, _, cutout = _bridge( + [Unit(), Unit(partnered=True, children=tuple(couple_children))], + schedule=schedule, + ) + for actual, harness in zip((cutout[100], cutout[101]), expected, strict=True): + assert abs(actual - harness) <= 1e-9 * max(1.0, harness) + + +def test_solve_covers_a_zero_anchor_payment_where_the_extrapolation_refuses(): + schedule = JobseekerShapeFixture(single_standard=40.0, lower=160, test_3_rate=0.7) + anchor = { + **{name: 0 for name in _JS_INPUTS}, + "jobseeker_support_single": True, + "jobseeker_support_applicant_age": 25, + "jobseeker_support_total_income": 500, + } + assert schedule.net(anchor) == 0 + _, _, _, cutout = _bridge([Unit()], schedule=schedule) + assert abs(cutout[100] - (160 + 40 / 0.7)) <= 1e-9 + + +def test_sole_parent_reaches_income_test_3_not_income_test_1(): + # Income Test 1's two tiers give 250 + (521.52 - 27) / 0.7 = 956.46. + _, _, _, cutout = _bridge([Unit(children=(4,))]) + assert abs(cutout[100] - (160 + 521.52 / 0.7)) <= 1e-9 + assert abs(cutout[100] - (250 + (521.52 - 27) / 0.7)) > 1 + + +def test_sole_parent_cutout_uses_the_gross_rate_overrides_not_the_units_schedule(): + # A youngest child of 15 selects the 14-or-older rate on the unit's own + # schedule; reg 18(3)(b) reads the single-with-children rate. + frame, _, _, cutout = _bridge([Unit(children=(15,)), Unit()]) + assert frame.table("family")[_GROSS].tolist() == [521.52, 0.0] + assert abs(cutout[100] - (160 + 521.52 / 0.7)) <= 1e-9 + assert abs(cutout[100] - (160 + 480.10 / 0.7)) > 1 + + +def test_upper_bracket_refuses_a_positive_residual(): + schedule = JobseekerShapeFixture(single_with_children=5000.0) + with pytest.raises(ValueError, match="upper endpoint has a positive residual"): + _bridge([Unit(children=(1,))], schedule=schedule) + + +def test_cutout_declaration_matches_the_ruling(): + row, _ = _row("nz.as.bridge.cutout") + params = row["params"] + assert (params["bracket"], params["tolerance"], params["iterations"]) == ( + [0, 5000], + 1e-9, + 43, + ) + assert np.ldexp(5000.0, -43) <= params["tolerance"] + assert params["solve_input"] == { + "entity": "person", + "column": "jobseeker_support_total_income", + } + assert not {"quantum", "certificate_margin"} & set(params) + terms = params["output_coefficients"] + assert [(term.get("variable"), term["coefficient"]) for term in terms] == [ + ("jobseeker_support_net_weekly_payment", 1), + ("jobseeker_support_weekly_income_test_reduction", -1), + (None, 1), + ] + assert terms[0]["mask"]["equals"] is False + assert terms[1]["mask"]["equals"] is True + assert terms[2]["source_column"] == _GROSS + overrides = {item["column"]: item for item in params["input_overrides"]} + assert overrides["jobseeker_support_single"]["source_column"] == ( + "accommodation_supplement_bridge_single_without_dependent_child" + ) + assert "jobseeker_support_total_income" not in overrides + assert _BRIDGE["outputs"][1]["method"] == "solve_zero" + assert "awaiting D1" not in json.dumps(_BRIDGE) + + +# --- Reg 17 ----------------------------------------------------------------- + + +def test_base_rate_sums_jobseeker_once_or_twice_and_the_credit_only_with_a_child(): + units = [ + Unit(), + Unit(partnered=True), + Unit(partnered=True, children=(3, 9)), + Unit(children=(0, 1, 10)), + ] + _, engines, base, _ = _bridge(units) + schedule = engines[_REFS["main_benefits_rates"]].schedule + credit = TaxCreditEngine.eldest / 52 + expected = { + 100: schedule.single_standard, + 101: 2 * schedule.both_main_without_children, + 102: 2 * schedule.both_main_with_children + credit, + 103: schedule.single_with_children + credit, + } + for family_id, value in expected.items(): + assert abs(base[family_id] - value) <= 1e-9, family_id + + +def test_base_rate_declaration_matches_the_ruling(): + row, _ = _row("nz.scn.S0.bridge.base_rate") + params = row["params"] + terms = params["output_coefficients"] + shape = [ + ( + term["variable"], + term["coefficient"], + term.get("aggregation"), + term["mask"]["column"], + term["mask"]["equals"], + ) + for term in terms + ] + assert shape == [ + ("jobseeker_support_net_weekly_payment", 1, "first", "is_partnered", False), + ("jobseeker_support_net_weekly_payment", 2, "first", "is_partnered", True), + ("family_tax_credit_prescribed_amount", 1 / 52, None, _HAS_CHILD, True), + ] + assert terms[2]["engine_ref"] == { + "binding": "family_tax_credits", + "field": "engine_ref", + } + (component,) = params["components"] + assert component["engine_ref"]["binding"] == "family_tax_credits" + + +def _youngest_received(units, *, masked=True): + row, scenario = _row("nz.scn.S0.bridge.base_rate") + if not masked: + for item in row["params"]["input_overrides"]: + if item["column"] == _YOUNGEST: + item.pop("mask") + frame = _frame(units) + engines = _engines() + _run(frame, *_row("nz.as.bridge.masks"), engines) + try: + _run(frame, row, scenario, engines) + finally: + received = engines[_REFS["main_benefits_rates"]].received + return received[-1][_YOUNGEST] + + +def test_a_childless_family_keeps_the_closure_default_youngest_child_age(): + units = [Unit(), Unit(children=(4, 7))] + received = _youngest_received(units) + # 0 for the childless family's adult, 4 for the parent and both children. + assert pd.Series(received).to_numpy(dtype=np.int64).tolist() == [0, 4, 4, 4] + + +def test_unmasked_youngest_child_override_carries_a_missing_age_to_the_engine(): + """Without the mask the childless unit's null age reaches the engine input. + + pandas 3 reads the nullable Int64 source as float64 with NaN, so the + adapter's int64 conversion raises under numpy's invalid-value check and + otherwise yields int64's minimum. + """ + units = [Unit(), Unit(children=(4, 7))] + received = _youngest_received(units, masked=False) + assert received.isna().tolist() == [True, False, False, False] + with np.errstate(invalid="raise"), pytest.raises(FloatingPointError): + pd.Series(received).to_numpy(dtype=np.int64) + + +def test_bridge_scratch_columns_stay_out_of_the_export_contract(): + contract = _SPEC["resources"]["export_contract"] + persisted = set(contract["required"]) | set(contract["optional"]) + persisted |= { + column + for roster in contract["entity_slices"].values() + for columns in roster.values() + for column in columns + } + scratch = {column["name"] for column in _BRIDGE["mask_bindings"]["columns"]} + assert not persisted & (scratch | {_GROSS}) + + +def test_every_as_population_runs_its_own_bridge_and_every_branch_its_base_rate(): + rows = {row["id"]: row for row, _ in _rows(_SPEC)[0]} + scenarios = _SPEC["resources"]["scenarios"]["scenarios"] + for node_id in ("masks", "sole_parent_gross_rate", "cutout"): + assert rows[f"nz.as.bridge.{node_id}"]["population"] == "nz.as.bridge" + shared = rows["nz.as.bridge"] + assert (shared["structural"], shared["base"]) == ("filter", "nz.as") + for scenario in scenarios: + if scenario["tier"] == "entitlement": + prefix, population = f"nz.scn.{scenario['id']}", f"nz.scn.{scenario['id']}" + assert rows[prefix]["base"] == "nz.as.bridge" + else: + prefix = f"nz.v.{scenario['id']}" + population = prefix + ".housing" + for node_id in ("masks", "sole_parent_gross_rate", "cutout"): + assert rows[f"{prefix}.bridge.{node_id}"]["population"] == population + assert rows[f"{prefix}.bridge.base_rate"]["population"] == population + + +# --- Entitlement gate and MC11 (H25, H26) ------------------------------------- + +_PAYMENT = "accommodation_supplement_rounded_weekly_payment" +_JUDGMENT = "accommodation_supplement_non_rate_entitlement_requirements" +_POSITIVE = "accommodation_supplement_positive_payment_indicator" +_ENTITLED = "accommodation_supplement_entitled_weekly_payment" +_BRANCHES = ( + *(f"nz.scn.{name}" for name in ("S0", "S1", "S2", "S3", "S5")), + *(f"nz.v.{name}" for name in ("V1", "V2", "V3", "V4", "VHF")), +) + + +def _as_engine_outputs(frame, engines): + """Write the AS engine's payment and judgment as the branch's .as node would.""" + engine = engines[_REFS["accommodation_supplement"]] + values = engine.materialize(frame, engine.outputs, "2026-27") + for name, data in values.items(): + frame.table("family")[name] = data + + +def _entitle(units, branch, *, undetermined=(), frame=None): + """Run the branch's packaged positive-payment and entitled nodes.""" + frame = _frame(units) if frame is None else frame + engines = _engines(undetermined=undetermined) + _as_engine_outputs(frame, engines) + for suffix in (".positive_payment", ".as.entitled"): + _run(frame, *_row(branch + suffix), engines) + family = frame.table("family") + return frame, dict(zip(family["family_id"], family[_ENTITLED], strict=True)) + + +def test_a_unit_failing_the_non_rate_judgment_reads_zero(): + _, entitled = _entitle([Unit(), Unit(cash_assets=20000.0)], "nz.scn.S0") + assert entitled == {100: 200.0, 101: 0.0} + + +def test_an_undetermined_judgment_reads_zero(): + frame, entitled = _entitle([Unit(), Unit()], "nz.scn.S0", undetermined={101}) + assert frame.table("family")[_JUDGMENT].tolist() == [1, 0] + assert entitled == {100: 200.0, 101: 0.0} + + +def test_s1_differs_from_s0_for_a_unit_over_the_asset_limit(): + from microcosm.frame.input_closure import InputClosure + + unit = Unit(cash_assets=20000.0) + _, central = _entitle([unit], "nz.scn.S0") + # S1's encoding knob zeroes the cash-asset input the encoder supplies. + s1 = next( + row for row in _SPEC["resources"]["scenarios"]["scenarios"] if row["id"] == "S1" + ) + closure = InputClosure.from_dict(_SPEC["resources"]["axiom_input_closure"]) + zeroed = closure.group_knobs(s1["encoding_knobs"]).zeroed + assert zeroed == frozenset({"accommodation_supplement_cash_assets"}) + frame = _frame([unit]) + for column in zeroed: + frame.table("family")[column] = 0.0 + _, asset_test_off = _entitle([unit], "nz.scn.S1", frame=frame) + assert central == {100: 0.0} + assert asset_test_off == {100: 200.0} + + +@pytest.mark.parametrize("branch", [b for b in _BRANCHES if not b.endswith("S5")]) +def test_a_superannuitant_unit_reads_zero_outside_s5(branch): + _, entitled = _entitle( + [Unit(receipt_group="superannuitant", adult_age=70), Unit()], branch + ) + assert entitled == {100: 0.0, 101: 200.0} + + +def test_s5_keeps_a_superannuitant_units_payment(): + _, entitled = _entitle( + [Unit(receipt_group="superannuitant", adult_age=70)], "nz.scn.S5" + ) + assert entitled == {100: 200.0} + + +def test_the_excluded_set_equals_the_superannuitant_receipt_group_cell(): + from microcosm.build.transport.reporting_kernels import ( + register_reporting_kernels, + ) + from microcosm.graph import KernelRegistry + + units = [ + Unit(receipt_group="superannuitant", adult_age=70), + Unit(receipt_group="superannuitant", adult_age=68, partnered=True), + Unit(receipt_group="beneficiary"), + Unit(receipt_group="other", children=(3,)), + ] + frame = _frame(units) + frame.table("family").drop(columns="receipt_group", inplace=True) + registry = register_reporting_kernels(KernelRegistry()) + row, scenario = _row("nz.scn.S0.receipt_group") + node = _node(row, scenario) + result = registry.get(node.kernel).run( + _context(frame, node, weighted_entities=("household",)) + ) + for (entity, column), values in result.columns.items(): + frame.table(entity)[column] = values.to_numpy() + _, entitled = _entitle(units, "nz.scn.S0", frame=frame) + family = frame.table("family") + excluded = set( + family.loc[ + (family[_PAYMENT] > 0) & (family[_JUDGMENT] == 1) & ~family[_POSITIVE], + "family_id", + ] + ) + cell = set(family.loc[family["receipt_group"] == "superannuitant", "family_id"]) + assert excluded == cell == {100, 101} + assert all(entitled[unit] == 0 for unit in cell) + + +def _s5_base_rate(units): + frame = _frame(units) + engines = _engines() + for node_id in ( + "nz.as.bridge.masks", + "nz.scn.S5.bridge.superannuitant_masks", + "nz.scn.S5.bridge.base_rate", + ): + _run(frame, *_row(node_id), engines) + family = frame.table("family") + return dict(zip(family["family_id"], family[_BASE], strict=True)) + + +def test_s5_pays_a_superannuitant_unit_from_its_nzs_base_rate(): + base = _s5_base_rate( + [Unit(receipt_group="superannuitant", adult_age=70), Unit(adult_age=30)] + ) + schedule = JobseekerShapeFixture() + assert base[100] == SuperannuationEngine.weekly + assert base[101] == schedule.single_standard + + +def test_a_partnered_superannuitant_unit_takes_coefficient_two_in_s5(): + base = _s5_base_rate( + [ + Unit(receipt_group="superannuitant", adult_age=70, partnered=True), + Unit(receipt_group="superannuitant", adult_age=70, children=(12,)), + ] + ) + assert base[100] == 2 * SuperannuationEngine.weekly + credit = TaxCreditEngine.eldest / 52 + assert abs(base[101] - (SuperannuationEngine.weekly + credit)) <= 1e-9 + + +def test_the_central_base_rate_keeps_jobseeker_for_superannuitant_units(): + _, _, base, _ = _bridge( + [Unit(receipt_group="superannuitant", adult_age=70, partnered=True)] + ) + assert base[100] == 2 * JobseekerShapeFixture().both_main_without_children + + +def test_reporting_and_gap_read_the_entitled_payment(): + resources = _SPEC["resources"] + conventions = resources["scenarios"]["gap_conventions"] + assert conventions["reporting_cells"]["measure"] == _ENTITLED + rows = { + row["metadata"]["holdout_use"]: row + for row in resources["holdout_references"]["target_references"] + if row["metadata"].get("activation_status") == "active" + } + assert rows["accommodation_supplement_recipient_comparator"]["measure"] == _POSITIVE + assert rows["accommodation_supplement_dollar_comparator"]["measure"] == _ENTITLED + for branch in _BRANCHES: + (family,) = [ + item + for item in _row(branch + ".gap")[0]["inputs"] + if item["entity"] == "family" + ] + assert _ENTITLED in family["columns"] and _PAYMENT not in family["columns"] + excluded = resources["export_contract"]["formula_owned_excluded"] + assert _ENTITLED in excluded diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_axiom_input_closure.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_axiom_input_closure.py index 236e06caff..ea86fae457 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_axiom_input_closure.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_axiom_input_closure.py @@ -212,7 +212,9 @@ def test_the_bridge_values_come_from_their_nodes(self) -> None: assert { ref.name: node for ref, node in CLOSURE.graph_node_inputs().items() } == { - "accommodation_supplement_base_rate_weekly_amount": "nz.as.bridge.base_rate", + "accommodation_supplement_base_rate_weekly_amount": ( + "nz.scn.S0.bridge.base_rate" + ), "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount": ( "nz.as.bridge.cutout" ), @@ -263,13 +265,19 @@ def _with_state(tables, data) -> dict[str, pd.DataFrame]: dtype=bool, ) for column in ("as_area", "as_area_alt"): - household[column] = np.asarray( - data.draw( - st.lists( - st.integers(1, 4), min_size=len(household), max_size=len(household) + # The state bindings compare the declared string geography codes. + household[column] = pd.array( + [ + str(code) + for code in data.draw( + st.lists( + st.integers(1, 4), + min_size=len(household), + max_size=len(household), + ) ) - ), - dtype=np.int64, + ], + dtype="string", ) return {"person": person, "household": household} @@ -407,7 +415,7 @@ def _golden_frame() -> dict[str, pd.DataFrame]: "mortgage_interest": [0.0], "mortgage_principal": [0.0], "property_tax": [0.0], - "as_area": np.asarray([1], dtype=np.int64), + "as_area": pd.array(["1"], dtype="string"), } ) return {"person": person, "household": household} diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_benefit_gross_up.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_benefit_gross_up.py index 467081a36d..0357a9a043 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_benefit_gross_up.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_benefit_gross_up.py @@ -10,22 +10,44 @@ import copy import json +import math import re from dataclasses import replace +from fractions import Fraction +import numpy as np +import pandas as pd import pytest +from hypothesis import given, settings +from hypothesis import strategies as st from microcosm.build.transport.compose import ( compose_transport_graph, load_transport_spec, ) -from microcosm.frame.adapters.axiom import axiom_concept_mapping +from microcosm.build.transport.money_kernels import MONEY_MINOR_UNITS +from microcosm.frame import Frame, WeightKind, Weights +from microcosm.frame.adapters.axiom import NZ_SCHEMA, axiom_concept_mapping from microcosm.frame.adapters.axiom_input_surface import load_axiom_input_surface from microcosm.frame.input_closure import ClosureClass, EncodedBy, InputClosure +from microcosm.frame.rules_kernels import SimulateSolveZeroKernel from microcosm.graph import Owned, StructuralDelta +from test_support.microcosm_build.nz_msd_gross_up import ( + ScheduleFixtureEngine, + _node, + exact_inverse, + exact_tax, + schedule_fixture, +) from test_support.microcosm_build.transport_composed import make_composed_fixture +from test_support.microcosm_frame.kernels import _context from test_support.paths import paths_for -from tools.build_nz_benefit_gross_up import DISCLOSURE, PROGRAMMES, documents +from tools.build_nz_benefit_gross_up import ( + DISCLOSURE, + NET_ROUNDING, + PROGRAMMES, + documents, +) _BUILD = paths_for("microcosm-build") _NZ = _BUILD.package / "src/microcosm/build/nz" @@ -124,17 +146,19 @@ def test_schedule_binding_is_compiled_and_taxable_income_is_solver_owned(): assert all("taxable_income" not in row["columns"] for row in node["inputs"]) -def test_affine_residual_uses_after_abatement_nets_and_engine_tax_only(): +def test_affine_residual_uses_whole_cent_nets_and_engine_tax_only(): document = _load("benefit_gross_up") assert document["disclosure"] == DISCLOSURE + assert document["net_rounding"] == NET_ROUNDING solves = [ node for node in document["nodes"] if node["kernel"] == "simulate.solve_zero@1" ] assert len(solves) == 3 for programme, node in zip(PROGRAMMES, solves, strict=True): params = node["params"] - net, gross = f"{programme}_net_weekly_payment", f"{programme}_annual_gross" - assert node["inputs"] == [{"entity": "person", "columns": [net]}] + cents = f"{programme}_net_weekly_payment_cents" + gross = f"{programme}_annual_gross" + assert node["inputs"] == [{"entity": "person", "columns": [cents]}] assert params["engine_ref"] == { "binding": "income_tax_schedule_1", "field": "engine_ref", @@ -147,8 +171,8 @@ def test_affine_residual_uses_after_abatement_nets_and_engine_tax_only(): assert terms == [ { "source_entity": "person", - "source_column": net, - "coefficient": 52, + "source_column": cents, + "coefficient": 0.52, "entity": "person", "column": gross, }, @@ -160,6 +184,8 @@ def test_affine_residual_uses_after_abatement_nets_and_engine_tax_only(): }, {"trial": True, "coefficient": -1, "entity": "person", "column": gross}, ] + # 0.52 enters the quantized solve as its shortest decimal, exactly 52/100. + assert Fraction(str(terms[0]["coefficient"])) == Fraction(52, 100) assert params["variables"] == ["individual_income_tax_before_credits"] assert json.loads(params["solve_input"]) == { "entity": "person", @@ -180,6 +206,44 @@ def test_affine_residual_uses_after_abatement_nets_and_engine_tax_only(): ) +def test_net_cents_node_rounds_half_even_ahead_of_every_gross_up(): + nodes = _load("benefit_gross_up")["nodes"] + ids = [node["id"] for node in nodes] + cents_node = nodes[ids.index("nz.benefits.net_cents")] + assert ids.index("nz.benefits.rates") < ids.index("nz.benefits.net_cents") + assert all( + ids.index("nz.benefits.net_cents") < ids.index(f"nz.gross_up.{p}") + for p in PROGRAMMES + ) + assert cents_node["kernel"] == "money.minor_units@1" + assert cents_node["params"]["engine_ref"] == { + "binding": "main_benefits_rates", + "field": "engine_ref", + } + declaration = json.loads(cents_node["params"]["declaration"]) + assert declaration == { + "entity": "person", + "columns": [ + { + "source_column": f"{p}_net_weekly_payment", + "output_column": f"{p}_net_weekly_payment_cents", + "quantum": "0.01", + "rounding": "half_even", + } + for p in PROGRAMMES + ], + } + assert {row["dtype"] for row in cents_node["outputs"]} == {"int64"} + (rates,) = [ + stage + for stage in _load("precalibration_stages")["stages"] + if stage["rules_binding"] == "main_benefits_rates" + ] + assert [row["column"] for row in rates["derived_outputs"]] == [ + f"{p}_net_weekly_payment_cents" for p in PROGRAMMES + ] + + def test_direct_annual_cents_exposure_and_super_before_tax_are_explicit(): document = _load("benefit_gross_up") nodes = {node["id"]: node for node in document["nodes"]} @@ -237,6 +301,18 @@ def composed_gross_up(tmp_path): spec["resources"]["axiom_rules_bindings"]["bindings"].extend(bindings) spec["resources"]["precalibration_stages"] = _load("precalibration_stages") rows = spec["resources"]["transport_graph"]["nodes"] + rows.append( + { + "id": "nz.central", + "kernel": "transport.boundary@1", + "structural": "filter", + "base": "nz.open", + "inputs": [{"entity": "person", "columns": ["age"]}], + } + ) + for row in rows: + if row["id"] == "nz.calibrate": + row["base"] = "nz.central" rows.extend(nodes) produced = {output["column"] for node in nodes for output in node["outputs"]} required = { @@ -264,6 +340,7 @@ def composed_gross_up(tmp_path): }, ) problem = next(row for row in rows if row["id"] == "nz.targets.problem") + problem["population"] = "nz.central" problem["inputs"].append( { "entity": "person", @@ -293,6 +370,7 @@ def test_real_gross_up_declarations_compose_with_all_stage_nodes_nonstructural( # the same non-structural assertion above covers that metadata node. assert { "nz.benefits.rates", + "nz.benefits.net_cents", "nz.gross_up.annual_cents", *(f"nz.gross_up.{p}" for p in PROGRAMMES), } <= set(found) @@ -314,3 +392,179 @@ def test_private_tax_output_cannot_leak_to_calibration(composed_gross_up): ] with pytest.raises(ValueError, match="undeclared pre-calibration stage output"): compose_transport_graph(spec, config) + + +def _solve_weekly_nets(nets, ids): + """Run the packaged net-cents node, then the packaged JS gross-up solve.""" + spec = load_transport_spec("nz") + rows = {row["id"]: row for row in spec["resources"]["benefit_gross_up"]["nodes"]} + engine_ref = "fractional-net-schedule-fixture" + frame = Frame( + { + "person": pd.DataFrame( + { + "person_id": ids, + "person_household_id": ids, + "person_family_id": ids, + **{ + f"{p}_net_weekly_payment": [ + float(net) if p == "jobseeker_support" else 0.0 + for net in nets + ] + for p in PROGRAMMES + }, + } + ), + "household": pd.DataFrame({"household_id": ids}), + "family": pd.DataFrame({"family_id": ids}), + }, + NZ_SCHEMA, + {"household": Weights(np.ones(len(ids)), WeightKind.DESIGN)}, + ) + cents = _node(rows["nz.benefits.net_cents"], spec, engine_ref) + result = MONEY_MINOR_UNITS.run( + _context(frame, cents, weighted_entities=("household",)) + ) + for (entity, column), values in result.columns.items(): + frame.table(entity)[column] = values.to_numpy() + node = _node(rows["nz.gross_up.jobseeker_support"], spec, engine_ref) + kernel = SimulateSolveZeroKernel({engine_ref: ScheduleFixtureEngine()}) + solved = kernel.run(_context(frame, node, weighted_entities=("household",))) + return frame, solved + + +def _rounded_net_oracle(net, brackets): + """The half-even cent net and the half-even cent inverse of its annual net.""" + rounded = Fraction(round(net * 100), 100) + return rounded, Fraction(round(exact_inverse(rounded * 52, brackets) * 100), 100) + + +# 801 and 802 carry fractional-cent nets. 901 and 902 put the exact root of +# their unrounded nets on a half-cent, which refused before nets entered as +# whole cents; rounded first, both solve. +_FRACTIONAL_NETS = ( + (801, Fraction("123.4567")), + (802, Fraction("123.4567") - Fraction("12.3456")), + (901, Fraction("0.00111875")), + (902, Fraction("0.01111875") - Fraction("0.01")), +) + + +def test_fractional_cent_nets_solve_against_the_exact_inverse_of_the_rounded_net(): + ids = [row for row, _ in _FRACTIONAL_NETS] + nets = [net for _, net in _FRACTIONAL_NETS] + assert all((net * 100).denominator != 1 for net in nets) + brackets = schedule_fixture() + # The unrounded 901 and 902 nets tie exactly on the 0.065 half-cent. + boundary = Fraction("0.065") + assert all( + net * 52 + exact_tax(boundary, brackets) - boundary == 0 for net in nets[2:] + ) + frame, result = _solve_weekly_nets(nets, ids) + cents = frame.table("person")["jobseeker_support_net_weekly_payment_cents"] + actual = result.columns["person", "jobseeker_support_annual_gross"] + for net, cent, gross in zip(nets, cents.tolist(), actual.tolist(), strict=True): + rounded, oracle = _rounded_net_oracle(net, brackets) + assert Fraction(cent, 100) == rounded + assert Fraction(str(gross)) == oracle + residual = rounded * 52 + exact_tax(oracle, brackets) - oracle + assert abs(residual) + Fraction("0.000001") <= Fraction("0.0050001") + + +def test_gross_up_refuses_an_unrounded_net_tie_when_it_reads_the_net_directly(): + """The declared margin still refuses an exact tie: only rounding removes it.""" + spec = load_transport_spec("nz") + row = copy.deepcopy( + next( + row + for row in spec["resources"]["benefit_gross_up"]["nodes"] + if row["id"] == "nz.gross_up.jobseeker_support" + ) + ) + terms = json.loads(row["params"]["output_coefficients"]) + terms[0].update( + source_column="jobseeker_support_net_weekly_payment", coefficient=52 + ) + row["params"]["output_coefficients"] = json.dumps(terms) + row["inputs"] = [ + {"entity": "person", "columns": ["jobseeker_support_net_weekly_payment"]} + ] + ids = [901, 902] + frame = Frame( + { + "person": pd.DataFrame( + { + "person_id": ids, + "person_household_id": ids, + "person_family_id": ids, + "jobseeker_support_net_weekly_payment": [ + float(net) for _, net in _FRACTIONAL_NETS[2:] + ], + } + ), + "household": pd.DataFrame({"household_id": ids}), + "family": pd.DataFrame({"family_id": ids}), + }, + NZ_SCHEMA, + {"household": Weights(np.ones(len(ids)), WeightKind.DESIGN)}, + ) + engine_ref = "fractional-net-schedule-fixture" + kernel = SimulateSolveZeroKernel({engine_ref: ScheduleFixtureEngine()}) + with pytest.raises( + ValueError, + match=r"ambiguous quantization certificate within margin.*rows \[901, 902\]", + ): + kernel.run( + _context( + frame, _node(row, spec, engine_ref), weighted_entities=("household",) + ) + ) + + +def _bracket_q(gross, brackets): + """q in r = 1 - p/q for the bracket holding gross, in lowest terms.""" + rate = Fraction(brackets[0]["rate"]) + for bracket in brackets: + if gross >= Fraction(bracket["lower"]): + rate = Fraction(bracket["rate"]) + return (1 - rate).denominator + + +@settings(max_examples=300, deadline=None, derandomize=True) +@given(st.integers(min_value=0, max_value=1_500_000)) +def test_cent_exact_nets_keep_every_half_cent_boundary_clear_of_the_margin(cents): + """H13 item 5: |F(b)| >= 1/(200q) >= 2.5e-5 at the boundaries around the root. + + F is monotone non-increasing, so the two half-cent boundaries next to the + exact root hold its smallest absolute residuals. + """ + brackets = schedule_fixture() + net_annual = Fraction(cents, 100) * 52 + root = exact_inverse(net_annual, brackets) + below = (Fraction(math.floor(root * 100 - Fraction(1, 2))) + Fraction(1, 2)) / 100 + for boundary in (below, below + Fraction(1, 100)): + if boundary < 0: + continue + residual = net_annual + exact_tax(boundary, brackets) - boundary + bound = Fraction(1, 200 * _bracket_q(boundary, brackets)) + assert abs(residual) >= bound >= Fraction("0.000025") + assert abs(residual) >= 25 * Fraction("0.000001") + + +@settings(max_examples=10, deadline=None, derandomize=True) +@given( + st.lists( + st.integers(min_value=0, max_value=200_000_000).map( + lambda units: Fraction(units, 10_000) + ), + min_size=1, + max_size=6, + ) +) +def test_any_four_decimal_net_solves_against_its_rounded_exact_inverse(nets): + ids = list(range(1, len(nets) + 1)) + brackets = schedule_fixture() + _, result = _solve_weekly_nets(nets, ids) + actual = result.columns["person", "jobseeker_support_annual_gross"] + for net, gross in zip(nets, actual.tolist(), strict=True): + assert Fraction(str(gross)) == _rounded_net_oracle(net, brackets)[1] diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_money_normalization.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_money_normalization.py index 7ec6639e84..1e94149fb0 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_money_normalization.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_money_normalization.py @@ -378,9 +378,16 @@ def test_the_rate_has_one_source_and_the_bridge_points_to_it(): assert rate == Fraction(827, 500) assert evidence["citation"]["url"].startswith("https://www.irs.gov/") assert evidence["citation"]["column"] == "2024" + # The VHF sibling declaration copies the central rate; only its four + # index families differ (tools/build_nz_transport_graph.py). assert _spec_rate_locations(rate) == [ - ("money_normalization.json", ("rate", "text")) + ("money_normalization.json", ("rate", "text")), + ("money_normalization_hold_fixed.json", ("rate", "text")), ] + assert ( + _load("money_normalization_hold_fixed.json")["rate"] + == _load("money_normalization.json")["rate"] + ) assert _load("money_normalization.json")["rate"]["text"] == "1.654" bridge = _load("currency_bridge.json") assert bridge["rate"] == {"resource": "money_normalization.json", "path": ["rate"]} @@ -490,6 +497,15 @@ def test_a_tax_year_factor_is_refused_on_donor_money(profile): check_money_factor(relabelled, _declaration()) -def test_no_graph_reads_it_yet_so_preflight_names_no_money_gap(): +def test_preflight_names_exactly_the_three_pending_quantile_maps(): + """The packaged graph now reads donor money; only quantile maps remain.""" spec = compose_module.load_transport_spec("nz") - assert compose_module._money_producer_gaps(spec) == [] + gaps = compose_module._money_producer_gaps(spec) + assert [gap.split(" <- ")[0] for gap in gaps] == [ + f"money column {name} awaits quantile map" + for name in ( + "household.rent", + "person.employment_income", + "person.liquid_financial_assets", + ) + ] diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_spec_package.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_spec_package.py index b02b7d00dd..10e77b6e67 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_spec_package.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_spec_package.py @@ -148,6 +148,7 @@ import subprocess import unicodedata from collections.abc import Callable, Iterator, Mapping, Sequence +from fractions import Fraction from functools import cache from pathlib import PurePosixPath from types import SimpleNamespace @@ -170,6 +171,7 @@ ) from microcosm.build.spec_engine import load_yaml12 from microcosm.frame import concepts as frame_concepts +from microcosm.frame.concept_mapping import MAPPING_FORMAT from microcosm.frame.input_closure import INPUT_CLOSURE_FORMAT from test_support.paths import paths_for @@ -992,7 +994,7 @@ def dotted_symbol_citations(value: object) -> set[str]: for key, child in value.items() for nested in ( [str(key)] - if key == "format" and child == INPUT_CLOSURE_FORMAT + if key == "format" and child in {INPUT_CLOSURE_FORMAT, MAPPING_FORMAT} else [str(key), child] ) for dotted in dotted_symbol_citations(nested) @@ -1865,7 +1867,9 @@ def test_export_contract_excludes_exactly_the_bound_outputs(self) -> None: # Differential: the export gate's formula-owned list and the bindings. contract = _load("export_contract.json") bound = {v for binding in _bindings().values() for v in binding["variables"]} - assert set(contract["formula_owned_excluded"]) == bound + # H25: the gated entitlement payment is a formula output too. + entitled = "accommodation_supplement_entitled_weekly_payment" + assert set(contract["formula_owned_excluded"]) == bound | {entitled} assert contract["closed"] is True assert set(contract["forbidden"]) == {"person_weight", "family_weight"} assert ( @@ -1878,21 +1882,44 @@ def test_bridge_evaluates_only_bound_variables_under_real_input_names(self) -> N bindings = _bindings() surface = _input_surface() assert set(bridge["rate_bindings"]) <= set(bindings) - evaluations = [] - for output in bridge["outputs"]: - evaluations += output.get("terms", []) - for branch in output.get("branches", []): - evaluations += branch["evaluations"] + reg17, reg18 = bridge["outputs"] + s5 = bridge["superannuitant_units"]["s5_base_rate"] + # Each declaration's overrides apply to its primary binding; component + # overrides apply to their own binding. + override_sets = [ + (reg17["primary_binding"], reg17["input_overrides"]), + (reg18["gross_rate"]["binding"], reg18["gross_rate"]["input_overrides"]), + (reg18["solve"]["binding"], reg18["solve"]["input_overrides"]), + *( + (component["binding"], component["input_overrides"]) + for declaration in (reg17, s5) + for component in declaration["components"] + ), + ] + evaluations = [ + *reg17["terms"], + reg18["gross_rate"], + *(term for term in reg18["solve"]["terms"] if "variable" in term), + *s5["terms"], + ] assert evaluations + allowed = set(bridge["rate_bindings"]) | {"nz_super"} for evaluation in evaluations: binding = bindings[evaluation["binding"]] - assert evaluation["binding"] in bridge["rate_bindings"] + assert evaluation["binding"] in allowed assert evaluation["variable"] in binding["variables"] assert evaluation["engine_entity"] == binding["engine_entity"] - inputs = set(surface[binding["rulespec_path"]]["canonical_inputs"]) - overrides = [row["variable"] for row in evaluation["input_overrides"]] + for name, rows in override_sets: + inputs = set(surface[bindings[name]["rulespec_path"]]["canonical_inputs"]) + overrides = [row["variable"] for row in rows] assert len(set(overrides)) == len(overrides) assert set(overrides) <= inputs + solve_input = reg18["solve"]["solve_input"]["column"] + assert solve_input in set( + surface[bindings["main_benefits_rates"]["rulespec_path"]][ + "canonical_inputs" + ] + ) def test_bridge_targets_are_the_two_as_inputs_the_module_leaves_open(self) -> None: bridge = _load("as_rate_bridge.json") @@ -1914,12 +1941,28 @@ def test_bridge_targets_are_the_two_as_inputs_the_module_leaves_open(self) -> No def test_bridge_reads_only_unit_attributes_the_unit_rule_declares(self) -> None: declared = set(_load("benefit_unit_rule.json")["unit_attributes"]["columns"]) - bridge_text = json.dumps(_load("as_rate_bridge.json")) + bridge = _load("as_rate_bridge.json") + bridge_text = json.dumps(bridge) used = { f"family.{name}" for name in re.findall(r"family\.([a-z_]+)", bridge_text) } + # The bridge's own mask node derives these columns from unit attributes. + derived = { + f"family.{column['name']}" + for bindings in ( + bridge["mask_bindings"], + bridge["superannuitant_units"]["s5_mask_bindings"], + ) + for column in bindings["columns"] + } | {f"family.{bridge['outputs'][1]['gross_rate']['column']}"} assert used - assert used <= declared + assert used - derived <= declared + for bindings in ( + bridge["mask_bindings"], + bridge["superannuitant_units"]["s5_mask_bindings"], + ): + for column in bindings["required_inputs"]["family"]: + assert f"family.{column}" in declared or column == "receipt_group" def test_reg17_family_tax_credit_term_uses_the_statutory_divisor(self) -> None: (base_rate,) = [ @@ -1927,8 +1970,12 @@ def test_reg17_family_tax_credit_term_uses_the_statutory_divisor(self) -> None: for output in _load("as_rate_bridge.json")["outputs"] if output["id"] == "reg17_base_rate" ] - (ftc,) = [term for term in base_rate["terms"] if "divisor" in term] - assert ftc["divisor"] == 52 + (ftc,) = [ + term + for term in base_rate["terms"] + if term["variable"] == "family_tax_credit_prescribed_amount" + ] + assert Fraction(ftc["coefficient"]) == Fraction(1, 52) # --------------------------------------------------------------------------- @@ -2300,11 +2347,15 @@ def test_committed_grid_satisfies_the_scenario_contract(self) -> None: "V2", "V3", "V4", + "VHF", ] branch_points = { tier: row["branch_point"] for tier, row in document["tiers"].items() } - assert branch_points == {"entitlement": "nz.as", "calibration": "nz.open"} + assert branch_points == { + "entitlement": "nz.as.bridge", + "calibration": "nz.open", + } assert [s["id"] for s in document["scenarios"] if not s["knobs"]] == ["S0"] def test_input_overrides_name_real_accommodation_supplement_inputs(self) -> None: @@ -4101,7 +4152,12 @@ def test_income_names_assigned_receipt_and_gross_components_only(self) -> None: } assert all(row["annualisation_factor"] == 1 for row in market) benefits = [row for row in classifier["components"] if row["kind"] == "benefit"] - assert all(row["annualisation_factor"] == 52 for row in benefits) + # Main benefits read the gross-up's annual gross; NZ Super stays weekly. + assert all( + row["annualisation_factor"] + == (52 if row["receipt_column"] == "receives_nz_super" else 1) + for row in benefits + ) assert all(row["tax_basis"] == "before_tax" for row in classifier["components"]) super_income = next( row for row in benefits if row["receipt_column"] == "receives_nz_super" @@ -4128,7 +4184,7 @@ def test_before_tax_paid_amounts_resolve_without_blocked_inputs(self) -> None: for row in classifier["components"] if row["kind"] == "benefit" and row["receipt_column"] != "receives_nz_super" } == { - f"{program}_gross_weekly_payment" + f"{program}_annual_gross" for program in ( "jobseeker_support", "sole_parent_support", @@ -4298,17 +4354,18 @@ def test_pinned_donor_unit_ids_survive_rebuilds_and_row_permutations(self) -> No assert units["family_id"].tolist() == [102, 201, 202] assert units["family_source_household_id"].tolist() == ["same_source"] * 3 - def test_s0_through_s3_structural_zero_cells_are_listed_on_support_entry( + def test_every_scenario_but_s5_lists_the_superannuitant_structural_zero( self, ) -> None: document = _load("reporting_classifiers.json") zeros = document["structural_zero_cells"] + # H26: MC11 excludes superannuitants everywhere but S5. assert zeros == [ { - "scenario": f"S{index}", + "scenario": scenario, "cell": "beneficiary_superannuitant_other/superannuitant", } - for index in range(4) + for scenario in ("S0", "S1", "S2", "S3", "V1", "V2", "V3", "V4", "VHF") ] support = next( row diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_target_references.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_target_references.py index abcfef6bca..5dcda94b99 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_target_references.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_target_references.py @@ -818,7 +818,7 @@ def test_h1_count_and_h2_historical_annual_dollars_pin_distinct_source_cells(art h1, h2 = rows assert h1["measure"] == "accommodation_supplement_positive_payment_indicator" assert h1["metadata"]["indicator_input_column"] == ( - "accommodation_supplement_rounded_weekly_payment" + "accommodation_supplement_entitled_weekly_payment" ) assert h1["metadata"]["indicator_operator"] == "positive" assert h1["metadata"]["indicator_threshold"] == "0" @@ -826,7 +826,7 @@ def test_h1_count_and_h2_historical_annual_dollars_pin_distinct_source_cells(art assert h1["ledger_selector"]["geography_level"] == "country" assert h1["ledger_selector"]["geography_id"] == "NZ" assert h1["period"] == "2026-06" - assert h2["measure"] == "accommodation_supplement_rounded_weekly_payment" + assert h2["measure"] == "accommodation_supplement_entitled_weekly_payment" assert h2["metadata"]["annualisation_factor"] == "52" assert h2["ledger_selector"]["record_set_id"] == "msd.benefit_expenses.fy2024" assert h2["ledger_selector"]["dimension_values"] == { diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_declarations.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_declarations.py index ec0259c7f4..9b66723888 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_declarations.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_declarations.py @@ -2,10 +2,13 @@ from __future__ import annotations +import copy import json import os import subprocess import sys +from functools import cache +from hashlib import sha256 from pathlib import Path import numpy as np @@ -28,10 +31,15 @@ def _prove_mutant_import(): print(f"Mutant loaded compose.__file__={loaded}") -def _spec(): +@cache +def _pristine_spec(): return compose.load_transport_spec("nz") +def _spec(): + return copy.deepcopy(_pristine_spec()) + + def _references(spec): for resource, document in spec["resources"].items(): if "target_references" in document: @@ -211,17 +219,17 @@ def test_h1_counts_positive_rounded_payments_and_h2_annualises_dollars(): assert h1["measure"] != h2["measure"] assert h1["measure"] == "accommodation_supplement_positive_payment_indicator" assert h1["metadata"]["indicator_input_column"] == ( - "accommodation_supplement_rounded_weekly_payment" + "accommodation_supplement_entitled_weekly_payment" ) assert h1["metadata"]["indicator_operator"] == "positive" assert h1["metadata"]["indicator_threshold"] == "0" - assert h2["measure"] == "accommodation_supplement_rounded_weekly_payment" + assert h2["measure"] == "accommodation_supplement_entitled_weekly_payment" assert h2["ledger_selector"]["record_set_id"] assert h2["metadata"]["source_period_start"] == "2024-07-01" assert str(h1["metadata"]["annualisation_factor"]) == "1" assert str(h2["metadata"]["annualisation_factor"]) == "52" measure = resources["scenarios"]["gap_conventions"]["reporting_cells"]["measure"] - assert measure == "accommodation_supplement_rounded_weekly_payment" + assert measure == "accommodation_supplement_entitled_weekly_payment" def test_non_exempt_inactive_rows_still_name_their_activation_gap(): @@ -290,3 +298,667 @@ def test_declaration_generators_round_trip_through_check(generator): check=False, ) assert result.returncode == 0, result.stdout + result.stderr + + +@pytest.mark.parametrize( + "builder", + [ + "build_nz_benefit_gross_up.py", + "build_nz_entitlement_graph.py", + "build_nz_transport_graph.py", + ], +) +def test_packaged_graph_resources_match_their_builders(builder): + # The transport builder reads the adapter's nz.json, so this also keeps the + # transport kernels and the Axiom adapter on one concept mapping. + root = paths_for("microcosm-build").repository + result = subprocess.run( + [sys.executable, str(root / "tools" / builder), "--check"], + cwd=root, + capture_output=True, + text=True, + check=False, + ) + assert result.returncode == 0, result.stdout + result.stderr + + +def _instantiated_nz_rows(spec): + from microcosm.build.transport.entitlement import _rows + + return [ + *spec["resources"]["transport_graph"]["nodes"], + *[row for row, _ in _rows(spec)[0]], + ] + + +def test_nz_every_variant_id_reaches_entitlement_rows_with_explicit_populations(): + from microcosm.build.transport.entitlement import _rows + + spec = _spec() + rows, gaps = _rows(spec) + variants = { + row["id"] + for row in spec["resources"]["scenarios"]["scenarios"] + if row["tier"] == "calibration" + } + assert variants == {"V1", "V2", "V3", "V4", "VHF"} + ids = [row["id"] for row, _ in rows] + assert len(ids) == len(set(ids)) + for variant in variants: + prefix = f"nz.v.{variant}" + branch = [ + row for row, scenario in rows if scenario and scenario["id"] == variant + ] + assert branch + start = next(row for row in branch if row["id"] == prefix) + assert start["structural"] == "filter" + assert start["base"] == "nz.open" + assert gaps[variant] == prefix + ".gap" + for row in branch: + if row.get("structural", "none") == "none": + assert row["population"].startswith(prefix), row["id"] + else: + assert row.get("base"), row["id"] + + +def test_nz_s5_ancestry_keeps_as_holds_and_inventory_after_each_calibration(): + spec = _spec() + compose.validate_transport_calibration_ancestry(spec) + rows = _instantiated_nz_rows(spec) + structural = { + row["id"]: row for row in rows if row.get("structural", "none") != "none" + } + by_id = {row["id"]: row for row in rows} + + def lineage(population): + result = [] + while population: + result.append(population) + population = structural[population].get("base") + return result + + for scenario in spec["resources"]["scenarios"]["scenarios"]: + variant = scenario["tier"] == "calibration" + prefix = ("nz.v." if variant else "nz.scn.") + scenario["id"] + calibration = prefix + ".calibrate" if variant else "nz.calibrate" + for suffix in (".as", ".positive_payment", ".gap", ".bridge.base_rate"): + row = by_id[prefix + suffix] + assert calibration in lineage(row["population"]), row["id"] + for row in rows: + if row["kernel"] == "transport.package@1": + assert "nz.calibrate" in lineage(row["population"]) + if variant: + target = by_id[prefix + ".targets.compile"] + assert target["params"]["references"]["resource"] == "target_references" + listed = { + stage["rules_binding"] + for stage in spec["resources"]["precalibration_stages"]["stages"] + } + for row in rows: + if row.get("structural", "none") != "none": + assert row.get("rules_binding") not in listed + text = json.dumps(row.get("params", {})) + assert not any(f'"binding": "{name}"' in text for name in listed) + + +@pytest.mark.parametrize("encoding", ["json", "sha256"]) +def test_nz_variant_holdout_selection_refuses_before_calibration(encoding): + spec, config = _nz_composition_spec_and_config() + variant = next( + row for row in spec["resources"]["scenarios"]["scenarios"] if row["id"] == "V1" + ) + target = next( + row for row in variant["nodes"] if row["id"] == "nz.v.V1.targets.compile" + ) + key = "references" if encoding == "json" else "references_sha256" + target["params"][key] = {"resource": "holdout_references", "encoding": encoding} + with pytest.raises( + ValueError, match="nz.v.V1.targets.compile.*holdout_references selection" + ): + compose.compose_transport_graph(spec, config) + + +def test_nz_money_profile_selection_equals_each_scenarios_own_knobs(): + from microcosm.build.transport.entitlement import _parameter, _rows + from microcosm.graph import Owned + + spec = _spec() + config = compose.TransportGraphConfig( + engine_refs={ + row["id"]: "fixture:" + row["id"] + for row in spec["resources"]["axiom_rules_bindings"]["bindings"] + }, + create_outputs=(Owned("person", "age", "int64"),), + ) + for row, scenario in _rows(spec)[0]: + if row["kernel"] != "money.normalize@1": + continue + parameters = { + key: _parameter(spec, config, value, scenario) + for key, value in row["params"].items() + } + resolved = compose._node( + spec, + row, + config, + {}, + resolved_params=parameters, + profile_selection=scenario["knobs"], + ) + assert json.loads(resolved.params["profile_selection"]) == scenario["knobs"], ( + row["id"] + ) + central = next( + row + for row in spec["resources"]["transport_graph"]["nodes"] + if row["kernel"] == "money.normalize@1" + ) + assert ( + json.loads(central["params"]["profile_selection"]) + == spec["resources"]["scenarios"]["central_knobs"] + ) + + +def test_nz_hold_fixed_has_identity_families_in_its_own_normalization_scenario(): + spec = _spec() + scenarios = spec["resources"]["scenarios"] + row = next(row for row in scenarios["scenarios"] if row["id"] == "VHF") + assert row["knobs"] == {"donor_money_index": "hold_fixed"} + assert "hold_fixed" not in scenarios["knob_domains"]["aging_index"] + normalizers = [ + node for node in row["nodes"] if node["kernel"] == "money.normalize@1" + ] + assert len(normalizers) == 1 + declaration = normalizers[0]["params"]["declaration"]["resource"] + assert declaration == "money_normalization_hold_fixed" + factors = spec["resources"][declaration]["index_family_factors"] + assert set(factors) == { + "mixed_income", + "capital_income", + "pensions", + "owner_housing_costs", + } + assert all(family.get("identity") is True for family in factors.values()) + + +def test_nz_only_s0_computes_deciles_and_every_other_scenario_carries_by_id(): + from microcosm.build.transport.entitlement import _rows + + spec = _spec() + rows = _rows(spec)[0] + classifiers = [ + (row, scenario) + for row, scenario in rows + if row["kernel"] + in {"reporting.income_decile@1", "reporting.carry_income_decile@1"} + ] + baseline = [ + row + for row, scenario in classifiers + if row["kernel"] == "reporting.income_decile@1" + ] + assert [row["id"] for row in baseline] == ["nz.scn.S0.income_decile"] + for row, scenario in classifiers: + assert row["params"]["scenario"] == scenario["id"] + if scenario["id"] == "S0": + continue + assert row["kernel"] == "reporting.carry_income_decile@1" + assert row["artifact_inputs"] == [ + { + "name": "baseline_cells", + "producer": baseline[0]["id"], + "artifact": "baseline_cells", + } + ] + assert all( + component["column"] not in item["columns"] + for component in spec["resources"]["reporting_classifiers"][ + "income_decile" + ]["components"] + for item in row["inputs"] + ) + assert ( + spec["resources"]["reporting_classifiers"]["income_decile"]["unit_id_column"] + == "family_id" + ) + + +def test_nz_h1_has_a_positive_payment_producer_and_native_annualisation_factors(): + from microcosm.build.transport.entitlement import _rows + + spec = _spec() + factors = spec["resources"]["gap_annualisation"] + assert factors == { + "msd_accommodation_supplement_recipients_national": 1, + "msd_annual_report_accommodation_assistance_expenditure": 52, + } + assert all(type(value) is int for value in factors.values()) + rows = _rows(spec)[0] + bindings = spec["resources"]["holdout_comparator_bindings"] + # H25 and H26: payment > 0, the judgment holds, and outside S5 the unit is + # not superannuitant. + payment = { + "column": "accommodation_supplement_rounded_weekly_payment", + "operator": "gt", + "value": 0, + } + holds = { + "column": "accommodation_supplement_non_rate_entitlement_requirements", + "operator": "eq", + "value": 1, + } + receipt = { + "column": "receipt_group", + "operator": "in", + "value": ["beneficiary", "other"], + } + (predicate,) = bindings["central"]["columns"] + assert predicate["predicates"] == [payment, holds, receipt] + (alternative,) = bindings["s5"]["columns"] + assert alternative["predicates"] == [payment, holds] + assert alternative["name"] == predicate["name"] + for row, _ in rows: + if row["kernel"] == "takeup.gap@1": + assert ( + row["params"]["annualisation_factors"]["resource"] + == "gap_annualisation" + ) + positive = next( + producer + for producer, _ in rows + if producer["id"] + == row["id"].removesuffix(".gap") + ".positive_payment" + ) + assert positive["kernel"] == "calibration.prepare@1" + assert positive["population"] == row["population"] + branch = "s5" if row["id"] == "nz.scn.S5.gap" else "central" + assert positive["params"]["bindings"]["path"] == [branch] + assert positive["outputs"] == [ + {"entity": "family", "column": predicate["name"], "dtype": "bool"} + ] + + +def test_nz_packaged_declaration_never_rewrites_a_money_bridge_column_later(): + rows = _instantiated_nz_rows(_spec()) + versions = { + row["id"]: row for row in rows if row.get("structural", "none") != "none" + } + bridge_outputs = [] + for index, row in enumerate(rows): + if row["kernel"] in {"money.minor_units@1", "money.annual_transfers@1"}: + bridge_outputs.extend( + (index, row["population"], output["entity"], output["column"]) + for output in row["outputs"] + ) + bridge_outputs.extend( + (index, row["population"], item["entity"], column) + for item in row.get("inputs", ()) + for column in item["columns"] + ) + assert bridge_outputs + for index, row in enumerate(rows): + population = row.get("population", row["id"]) + lineage = [] + while population: + lineage.append(population) + population = versions[population].get("base") + for output in row.get("outputs", ()): + for owner_index, owner_version, entity, column in bridge_outputs: + if ( + owner_index < index + and owner_version in lineage + and (entity, column) == (output["entity"], output["column"]) + ): + assert not output.get("rewrite"), row["id"] + + +def test_nz_packaged_declaration_has_no_entrant_expand_that_supplies_bridge_columns(): + rows = _instantiated_nz_rows(_spec()) + bridges = { + (output["entity"], output["column"]) + for row in rows + if row["kernel"] in {"money.minor_units@1", "money.annual_transfers@1"} + for output in row["outputs"] + } + bridges.update( + (item["entity"], column) + for row in rows + if row["kernel"] in {"money.minor_units@1", "money.annual_transfers@1"} + for item in row.get("inputs", ()) + for column in item["columns"] + ) + assert bridges + for row in rows: + if row.get("structural") == "expand" and row.get("entrants") is True: + assert not bridges.intersection( + (output["entity"], output["column"]) + for output in row.get("outputs", ()) + ), row["id"] + + +def test_nz_executable_support_keeps_region99_separate_from_ta999(): + spec = _spec() + resources = spec["resources"] + support_node = next( + row + for row in resources["transport_graph"]["nodes"] + if row["kernel"] == "geography.support_from_facts@1" + ) + resource = support_node["params"]["definition"]["resource"] + assert resource == "transport_atomic_geography_support" + rows = resources[resource]["rows"] + residual = [row for row in rows if row["codes"]["region_code"] == "99"] + assert residual + assert {row["codes"]["ta_code"] for row in residual} == {"067"} + assert all(row["codes"]["ta_code"] != "999" for row in rows) + assert all( + row["target"] == "stats_nz_population_by_territorial_authority__ta067" + for row in residual + ) + + +_BRIDGE_AND_REGION = { + ("person", "region_code"), + ("family", "accommodation_supplement_base_rate_weekly_amount"), + ("family", "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount"), +} + + +def _nz_composition_spec_and_config(): + """Supply compiler-only toy pins, the three money producers and CREATE's inventory. + + The synthetic quantile declarations certify no distribution or runtime + result. They only remove the three deliberate money-producer gaps while + the compiler checks the complete packaged node and population structure. + CREATE's inventory holds canonical concepts and unit outputs only: no + bridge or region column enters as a root. + """ + from microcosm.graph import Owned + + spec = _spec() + resources = spec["resources"] + resources["axiom_rules_bindings"]["engine"].update( + commit="1" * 40, wheel_sha256="2" * 64 + ) + + def add_quantiles(rows): + money = next(row for row in rows if row["kernel"] == "money.normalize@1") + at = rows.index(money) + 1 + synthetic = [] + for entity, columns in resources["money_normalization"][ + "quantile_mapped" + ].items(): + for column in columns: + synthetic.append( + { + "id": money["id"] + ".synthetic_quantile." + column, + "kernel": "transport.quantile_map@1", + "population": money["population"], + "inputs": [{"entity": entity, "columns": [column]}], + "outputs": [ + { + "entity": entity, + "column": column, + "dtype": "float64", + "rewrite": True, + } + ], + "params": {}, + } + ) + rows[at:at] = synthetic + + add_quantiles(resources["transport_graph"]["nodes"]) + for scenario in resources["scenarios"]["scenarios"]: + if scenario["tier"] == "calibration": + add_quantiles(scenario["nodes"]) + rows = _instantiated_nz_rows(spec) + produced = { + (output["entity"], output["column"]) + for row in rows + for output in row.get("outputs", ()) + if not output.get("rewrite") + } + needed = { + (item["entity"], column) + for row in rows + for item in row.get("inputs", ()) + for column in item["columns"] + } - produced + assert needed.isdisjoint(_BRIDGE_AND_REGION), sorted(needed & _BRIDGE_AND_REGION) + from microcosm.frame import EntitySchema + from microcosm.frame.concepts import CONCEPTS, TransportRule + from microcosm.frame.unit_construction import BenefitUnitRule + + kinds = {"int": "int64", "float": "float64", "bool": "bool", "str": "string"} + inventory = { + (item.entity, item.name): "Int64" if item.nullable else kinds[item.dtype] + for item in CONCEPTS + if item.transport is not TransportRule.DROP + } + rule = BenefitUnitRule.from_spec(resources["benefit_unit_rule"]) + schema = EntitySchema(group_entities=("household", rule.entity)) + automatic = { + (schema.person_entity, schema.person_id_column), + *( + (schema.person_entity, schema.membership_column(group)) + for group in schema.group_entities + ), + *((group, schema.id_column(group)) for group in schema.group_entities), + } + # CLI preparation excludes these columns; frame projection carries them. + # A node must not name them as data reads that require a column owner. + needed -= automatic + inventory.update( + { + ("household", "donor_support_stratum"): "string", + (rule.entity, rule.household_column): "int64", + (rule.entity, rule.head_column): "int64", + (rule.entity, rule.source_household_column): "string", + } + ) + assert needed <= inventory.keys(), ( + "The declaration reads donor columns outside the canonical concepts and actual CREATE/unit outputs", + sorted(needed - inventory.keys()), + ) + config = compose.TransportGraphConfig( + engine_refs={ + row["id"]: "synthetic:" + row["id"] + for row in resources["axiom_rules_bindings"]["bindings"] + }, + create_outputs=tuple( + Owned(entity, column, inventory[entity, column]) + for entity, column in sorted(needed) + ), + ) + return spec, config + + +def test_nz_terminal_filter_keeps_the_skeletons_predecessors_and_ancestry(): + from microcosm.graph import compile_graph + + spec, config = _nz_composition_spec_and_config() + extended = compile_graph(compose.compose_transport_graph(spec, config)) + bare = copy.deepcopy(spec) + del bare["resources"]["entitlement_graph"] + skeleton = compile_graph(compose.compose_transport_graph(bare, config)) + assert set(extended.predecessors["nz.terminal"]) == set( + skeleton.predecessors["nz.terminal"] + ) + # Export and the terminal gates descend from here, so no bridge column can. + seen, frontier = set(), ["nz.terminal"] + while frontier: + fresh = set(extended.predecessors[frontier.pop()]) - seen + seen |= fresh + frontier += fresh + assert seen <= set(skeleton.order) + assert not {name for name in seen if ".bridge" in name} + + +def test_nz_packaged_graph_produces_region_and_bridge_columns_from_named_nodes(): + spec = _spec() + rows = _instantiated_nz_rows(spec) + producers = {} + for row in rows: + for output in row.get("outputs", ()): + producers.setdefault((output["entity"], output["column"]), set()).add( + row["kernel"] + ) + assert producers["person", "region_code"] == {"geography.person_location@1"} + assert producers["family", "accommodation_supplement_base_rate_weekly_amount"] == { + "simulate.counterfactual@1" + } + assert producers[ + "family", + "accommodation_supplement_non_beneficiary_income_cutout_weekly_amount", + ] == {"simulate.solve_zero@1"} + pending = " ".join(spec["resources"]["transport_graph"]["pending_outputs"]) + assert "region" not in pending and "Reg 17" not in pending + + +def test_nz_packaged_graph_compiles_with_only_pins_and_money_producers(): + from microcosm.graph import compile_graph + + spec, config = _nz_composition_spec_and_config() + # No bridge or region root stays synthetic: CREATE declares none of them. + assert _BRIDGE_AND_REGION.isdisjoint( + (owned.entity, owned.column) for owned in config.create_outputs + ) + graph = compose.compose_transport_graph(spec, config) + compiled = compile_graph(graph) + assert "nz.package" in compiled.order + assert "nz.scn.S0.income_decile" in compiled.order + for variant in ("V1", "V2", "V3", "V4", "VHF"): + assert f"nz.v.{variant}.calibrate" in compiled.order + assert f"nz.v.{variant}.gap" in compiled.order + + +def test_nz_as_area_state_bindings_compare_the_declared_string_geography_codes(): + resources = _spec()["resources"] + support = resources["transport_atomic_geography_support"]["rows"] + codes = {row["codes"]["as_area"] for row in support} + alternative = {row["codes"]["as_area_alt"] for row in support} + assert codes == {"1", "2", "3", "4"} + assert alternative <= codes + for area in ("1", "2", "3"): + entry = next( + row + for row in resources["axiom_input_closure"]["entries"] + if row["input"] == f"accommodation_supplement_resides_in_area_{area}" + ) + assert entry["state_binding"]["test"] == "equals" + value = entry["state_binding"]["value"] + assert type(value) is str + assert value == area + assert value in codes + + +_IMMUTABLE_PROFILE_VIEWS = {} + + +@pytest.fixture(autouse=True) +def _memoize_immutable_reference_profile_views(monkeypatch): + """Reuse real resolved views by content while isolating each test's copy. + + This file leaves profile resources unchanged within a test. Each new spec + gets a content digest of every input the resolver reads, so mutations in a + later test select a different cache entry. Deep copies isolate returned + views from the file-level immutable cache. + """ + original = compose.reference_profile_view + views = {} + retained_specs = {} + input_digests = {} + + def cached(spec, selection=None): + if not compose._has_resource(spec, "reference_profiles"): + return original(spec, selection) + declarations = compose._raw_transport_resource(spec, "reference_profiles") + dimensions = declarations.get("dimensions", {}) + selected = { + name: value + for name, value in (selection or {}).items() + if name in dimensions + } + selected_json = json.dumps(selected, sort_keys=True) + key = (id(spec), selected_json) + retained_specs[id(spec)] = spec + if id(spec) not in input_digests: + names = { + "reference_profiles", + declarations.get("reference_resource", "target_references"), + *( + declarations[field] + for field in ("interval_resource", "factor_context_resource") + if declarations.get(field) is not None + ), + } + if compose._has_resource(spec, compose.CHRONICLE_FEED_RESOURCE): + names.add(compose.CHRONICLE_FEED_RESOURCE) + documents = { + name: compose._raw_transport_resource(spec, name) + for name in sorted(names) + } + input_digests[id(spec)] = sha256( + json.dumps(documents, sort_keys=True, separators=(",", ":")).encode() + ).hexdigest() + if key not in views: + content_key = (input_digests[id(spec)], selected_json) + if content_key not in _IMMUTABLE_PROFILE_VIEWS: + _IMMUTABLE_PROFILE_VIEWS[content_key] = original(spec, selection) + views[key] = copy.deepcopy(_IMMUTABLE_PROFILE_VIEWS[content_key]) + return views[key] + + monkeypatch.setattr(compose, "reference_profile_view", cached) + + +def test_nz_every_instantiated_encoder_output_declares_an_explicit_graph_dtype(): + from microcosm.graph import DTYPES + + encoders = { + "concepts.encode@1", + "concepts.encode_groups@1", + "transport.scenario_override@1", + } + rows = [row for row in _instantiated_nz_rows(_spec()) if row["kernel"] in encoders] + assert rows + for row in rows: + assert row["outputs"], row["id"] + for output in row["outputs"]: + assert output.get("dtype") in DTYPES, (row["id"], output) + + +def test_nz_export_slices_need_no_ids_because_compile_refuses_them(): + """_check_export_contract counts projected ids; no slice may name one. + + The executor projects ids and memberships for every sliced entity, so a + slice that names one asks for a cell that no node owns. + """ + from microcosm.frame import EntitySchema + from microcosm.frame.unit_construction import BenefitUnitRule + from microcosm.graph import GraphError + + spec, config = _nz_composition_spec_and_config() + resources = spec["resources"] + rule = BenefitUnitRule.from_spec(resources["benefit_unit_rule"]) + schema = EntitySchema(group_entities=("household", rule.entity)) + automatic = { + schema.person_id_column, + *(schema.membership_column(group) for group in schema.group_entities), + *(schema.id_column(group) for group in schema.group_entities), + } + for roster in resources["export_contract"]["entity_slices"].values(): + assert not automatic & {column for names in roster.values() for column in names} + for role in ("export", "gates"): + resources["export_contract"]["entity_slices"][role]["household"].append( + "household_id" + ) + for row in resources["transport_graph"]["nodes"]: + if row["id"] in {"nz.export.prepare", "nz.gates.terminal"}: + for item in row["inputs"]: + if item["entity"] == "household": + item["columns"].append("household_id") + with pytest.raises( + GraphError, match=r"reads household\.household_id, which no node owns" + ): + compose.compose_transport_graph(spec, config) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_toy_graph.py b/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_toy_graph.py new file mode 100644 index 0000000000..5a1398d9e7 --- /dev/null +++ b/packages/microcosm-build/tests/engine_free/shared/test_nz_transport_toy_graph.py @@ -0,0 +1,484 @@ +"""Execute the synthetic NZ-shaped transport without an installed country engine.""" + +from __future__ import annotations + +import copy +import importlib +import json +import os +from fractions import Fraction +from hashlib import sha256 +from pathlib import Path + +import numpy as np +import pandas as pd +import pytest + +from microcosm.build.transport.artifact_types import INCOME_CELLS_TYPE +from microcosm.build.transport.cli import through +from microcosm.build.transport.compose import ( + compose_transport_graph, + validate_transport_activation, +) +from microcosm.build.transport.reporting_kernels import ( + REPORTING_INCOME_DECILE, + decode_income_cells, +) +from microcosm.build.transport.takeup_kernels import ( + decode_bands, + decode_cell_diagnostics, + decode_gap, + source_cell_diagnostics, +) +from microcosm.build.transport.target_kernels import decode_target_surface +from microcosm.frame import WeightKind, Weights +from microcosm.frame.reporting import carry_baseline_deciles +from microcosm.graph import ( + ArtifactOutput, + KernelContext, + Node, + NodeRejectedError, + Owned, + compile_graph, + run_graph, +) +from microcosm.graph.canonical import canonical_json +from test_support.microcosm_build.money_normalization import DIMENSION +from test_support.microcosm_build.transport_composed import _slice +from test_support.microcosm_build.transport_entitlement import run_entitlement_graph +from test_support.microcosm_build.transport_nz_toy import ( + DEMOGRAPHY, + SCENARIOS, + _cell_gates, + _classifiers, + make_nz_toy_fixture, + toy_donor_factor, +) + + +@pytest.fixture(scope="module", autouse=True) +def prove_mutant_import_paths(): + root = os.environ.get("NZ_MUTANT_PATH") + if root is None: + return + root = Path(root).resolve() + for name in ( + "microcosm.build.transport.compose", + "microcosm.build.transport.reporting_kernels", + "microcosm.frame.reporting", + "microcosm.build.transport.takeup_kernels", + "test_support.microcosm_build.transport_nz_toy", + ): + module = importlib.import_module(name) + path = Path(module.__file__).resolve() + print(f"MUTANT_IMPORT {name} {path}", flush=True) + assert path.is_relative_to(root), (name, path, root) + + +def _artifact(run, node, name): + manifest, store, _ = run + return store.load_bytes(manifest.nodes[node].opaque_artifacts[name]) + + +@pytest.fixture(scope="module") +def toy(tmp_path_factory): + root = tmp_path_factory.mktemp("synthetic-nz") + fixture = make_nz_toy_fixture(root / "fixture") + run = run_entitlement_graph(root / "run", fixture) + return fixture, run + + +def test_synthetic_nz_graph_exports_and_packages_every_scenario(toy): + fixture, run = toy + manifest, _, exported = run + assert exported.exists() + assert "nz.package" in manifest.nodes + assert len(manifest.populations["nz.create"].table("household")) == 40 + assert len(manifest.populations["nz.create"].table("person")) == 120 + assert validate_transport_activation(fixture.spec) is None + assert set(compile_graph(fixture.graph()).order) == set(manifest.nodes) + bands = decode_bands(_artifact(run, "nz.as.bands", "bands")) + assert bands["baseline_scenario"] == "S0" + diagnostics = decode_cell_diagnostics( + _artifact(run, "nz.as.bands.cell_diagnostics", "cell_diagnostics") + ) + assert {row["scenario"] for row in diagnostics["scenarios"]} == set(SCENARIOS) + report = json.loads(_artifact(run, "nz.gates.terminal", "gate_report")) + assert report["enforcement"]["artifact_permitted"] is True + + +def test_bridge_filter_keeps_every_person_unit_and_weight(toy): + populations = toy[1][0].populations + whole, bridge = populations["nz.as"], populations["nz.as.bridge"] + for entity, identifiers in ( + ("person", ["person_id", "person_household_id", "person_family_id"]), + ("family", ["family_id"]), + ("household", ["household_id"]), + ): + pd.testing.assert_frame_equal( + bridge.table(entity)[identifiers], whole.table(entity)[identifiers] + ) + np.testing.assert_array_equal( + bridge.resolve_weights(entity).values, whole.resolve_weights(entity).values + ) + assert bridge.resolve_weights(entity).kind == whole.resolve_weights(entity).kind + + +def test_s0_deciles_carry_by_unit_id_and_each_scenario_reports_shares(toy): + fixture, run = toy + manifest = run[0] + graph = fixture.graph() + baseline = manifest.populations["nz.scn.S0"].table("family").set_index("family_id") + cells = decode_income_cells( + _artifact(run, "nz.scn.S0.reporting.income_decile", "baseline_cells") + ) + assert ( + dict(zip(cells["unit_ids"], cells["deciles"], strict=True)) + == baseline.income_decile.to_dict() + ) + for scenario in SCENARIOS[1:]: + population = ( + f"nz.scn.{scenario}" + if scenario.startswith("S") + else f"nz.v.{scenario}.housing" + ) + prefix = ( + f"nz.scn.{scenario}" if scenario.startswith("S") else f"nz.v.{scenario}" + ) + current = ( + manifest.populations[population].table("family").set_index("family_id") + ) + pd.testing.assert_series_equal( + current.income_decile.sort_index(), baseline.income_decile.sort_index() + ) + node = graph.node(f"{prefix}.reporting.income_decile") + assert node.kernel == "reporting.carry_income_decile@1" + assert node.artifact_inputs[0].producer == "nz.scn.S0.reporting.income_decile" + receipt = manifest.nodes[node.id].receipt + assert sum(receipt["weighted_shares"]) == pytest.approx(1) + assert len(receipt["weighted_shares"]) == 10 + + +def test_income_decile_carry_joins_reordered_units(): + labels = carry_baseline_deciles([70, 10, 40], [10, 40, 70], [2, 8, 5], 10) + np.testing.assert_array_equal(labels, [5, 2, 8]) + + +def test_superannuitant_reporting_equals_the_member_receipt_exclusion_set(toy): + _, run = toy + frame = run[0].populations["nz.scn.S0"] + person = frame.table("person") + family = frame.table("family").set_index("family_id") + pension_units = set(person.loc[person.receives_pension, "person_family_id"]) + assert pension_units + assert set(family.index[family.receipt_group == "superannuitant"]) == pension_units + assert ( + not person.loc[person.receives_pension, ["receives_main", "receives_other"]] + .any() + .any() + ) + + +def test_source_household_ess_survives_a_clone_split(): + original = source_cell_diagnostics([2.0, 3.0], [10.0, 20.0], [100, 200]) + split = source_cell_diagnostics( + [0.75, 1.25, 3.0], [10.0, 10.0, 20.0], [100, 100, 200] + ) + for metric in ( + "source_household_ess", + "dollar_contribution_ess", + "contribution_cv", + "maximum_single_donor_dollar_share", + ): + assert split[metric] == pytest.approx(original[metric]) + assert split["source_household_ess"] == pytest.approx(25 / 13) + + +def test_variants_normalize_once_with_their_knobs_and_hold_fixed_uses_identity(toy): + fixture, run = toy + manifest = run[0] + raw = manifest.populations["nz.open"].table("person").set_index("person_id") + scenarios = { + row["id"]: row for row in fixture.spec["resources"]["scenarios"]["scenarios"] + } + graph = fixture.graph() + for name, population, node in ( + ("S0", "nz.central", "nz.central.normalize"), + ("V1", "nz.v.V1", "nz.v.V1.central.normalize"), + ("V3", "nz.v.V3", "nz.v.V3.central.normalize"), + ("VHF", "nz.v.VHF", "nz.v.VHF.central.normalize"), + ): + assert ( + json.loads(graph.node(node).params["profile_selection"]) + == scenarios[name]["knobs"] + ) + person = manifest.populations[population].table("person").set_index("person_id") + factor = ( + Fraction(1) + if name == "VHF" + else toy_donor_factor(scenarios[name]["knobs"][DIMENSION]) + ) + expected = [ + round(round(Fraction(str(value)) * Fraction(5, 4) * 100) * factor) + for value in raw.interest_income + ] + np.testing.assert_array_equal(person.interest_income_cents, expected) + assert ( + manifest.populations["nz.central"] + .table("person") + .interest_income_cents.tolist() + != manifest.populations["nz.v.VHF"] + .table("person") + .interest_income_cents.tolist() + ) + + +def test_each_activated_calibration_row_compiles_once_and_exempt_rows_stay_out(toy): + fixture, run = toy + expected = { + row["name"] + for row in fixture.spec["resources"]["target_references"]["target_references"] + if row["metadata"]["activation_status"] == "active" + } + surface = decode_target_surface(_artifact(run, "nz.targets.compile", "surface")) + names = [row.name for row in surface.registry.specs] + assert len(names) == len(set(names)) + assert set(names) == expected + + +def test_as_reporting_alias_and_count_dollar_comparators_use_declared_measures(): + resources = {"scenarios": {}, "gates": {"gates": []}} + _cell_gates(resources) + reporting = resources["scenarios"]["gap_conventions"]["reporting_cells"] + assert reporting["measure"] == "toy_as_weekly" + assert reporting["annualisation_factor"] == 52 + + +def test_count_dollar_comparators_execute_with_separate_native_factors(toy): + fixture, run = toy + resources = fixture.spec["resources"] + factors = resources["entitlement_annualisation"] + assert factors["toy_as_recipients"] == 1 + assert factors["toy_as_expenditure"] == 52 + gap = decode_gap(_artifact(run, "nz.scn.S0.gap", "gap")) + assert gap["scenario"] == "S0" + + +def test_toy_support_gate_blocks_export_with_its_name(toy, tmp_path): + fixture, run = toy + spec = copy.deepcopy(fixture.spec) + spec["resources"]["gates"]["gates"].append( + { + "id": "synthetic_support_pending", + "gate": "support", + "phase": "terminal", + "criticality": "release_blocking", + "evidence_absent_blocks": True, + "parameters": {}, + } + ) + fixture = fixture.reprepare(spec) + graph = fixture.graph() + blocked = run_graph( + compile_graph(through(graph, "nz.gates.terminal")), + sources=fixture.sources, + store=run[1], + kernels=fixture.registry.kernels, + ) + report = json.loads( + _artifact((blocked, run[1], None), "nz.gates.terminal", "gate_report") + ) + assert report["enforcement"]["blocking"] == ["synthetic_support_pending"] + assert report["enforcement"]["artifact_permitted"] is False + with pytest.raises(NodeRejectedError, match="blocking gate report"): + run_entitlement_graph(tmp_path / "blocked", fixture, store=run[1], graph=graph) + + +def test_second_variant_normalization_refuses(toy): + fixture, _ = toy + spec = copy.deepcopy(fixture.spec) + variant = next( + row for row in spec["resources"]["scenarios"]["scenarios"] if row["id"] == "V1" + ) + normalizer = copy.deepcopy( + next(row for row in variant["nodes"] if row["kernel"] == "money.normalize@1") + ) + normalizer["id"] += ".again" + variant["nodes"].append(normalizer) + with pytest.raises(ValueError, match="normaliz|money producer"): + compose_transport_graph(spec, fixture.config) + + +def test_consumed_pending_money_names_its_missing_producer(toy): + fixture, _ = toy + spec = copy.deepcopy(fixture.spec) + row = next( + row + for row in spec["resources"]["transport_graph"]["nodes"] + if row["id"] == "nz.encode.person" + ) + row["inputs"].append(_slice("person", ["dividend_income"])) + # A pending column's gap names what it awaits, here a carrying donor. + with pytest.raises( + ValueError, + match=r"money column person\.dividend_income awaits a donor that carries it", + ): + validate_transport_activation(spec) + + +def test_parked_unexempt_reference_refuses_preflight_with_its_name(toy): + fixture, _ = toy + spec = copy.deepcopy(fixture.spec) + spec["resources"]["reference_selection"]["resources"]["target_references"][ + "exempt" + ] = [] + with pytest.raises(ValueError, match="toy_parked_calibration"): + validate_transport_activation(spec) + + +def test_required_exempt_receipt_target_refuses_preflight_with_its_name(toy): + fixture, _ = toy + spec = copy.deepcopy(fixture.spec) + name = "toy_receipt_pension" + row = next( + row + for row in spec["resources"]["precal_references"]["target_references"] + if row["name"] == name + ) + row["metadata"]["activation_status"] = "pending" + spec["resources"]["reference_selection"]["resources"]["precal_references"] = { + "exempt": [ + { + "name": name, + "activation_status": "pending", + "reason": "Synthetic tripwire.", + } + ] + } + with pytest.raises(ValueError, match="toy_receipt_pension"): + validate_transport_activation(spec) + + +def test_variant_decile_recomputation_refuses(): + classifier = _classifiers()["income"] + params = { + "classifier": canonical_json(classifier).decode(), + "classifier_sha256": sha256(canonical_json(classifier)).hexdigest(), + "scenario": "V1", + "entities": ("person", "household", "family"), + } + person = pd.DataFrame( + { + "person_id": [1, 2], + "person_household_id": [10, 20], + "person_family_id": [101, 102], + "employment_income": [100.0, 200.0], + "interest_income": [1.0, 2.0], + "rental_income": [-1.0, 0.0], + "toy_pension_payment": [10.0, 20.0], + "receives_pension": [False, True], + "receives_main": [True, False], + "receives_other": [False, False], + "toy_main_annual_gross": [50.0, 60.0], + "toy_other_annual_gross": [30.0, 40.0], + } + ) + node = Node( + "variant.income", + REPORTING_INCOME_DECILE.ref, + population="variant", + outputs=(Owned("family", "income_decile", "int64"),), + params=params, + artifact_outputs=(ArtifactOutput("baseline_cells", INCOME_CELLS_TYPE),), + ) + context = KernelContext( + node=node, + tables={ + "person": person, + "household": pd.DataFrame({"household_id": [10, 20]}), + "family": pd.DataFrame( + {"family_id": [101, 102], "family_household_id": [10, 20]} + ), + }, + weights={"household": Weights(np.array([1.0, 2.0]), WeightKind.CALIBRATED)}, + strata=pd.Series(["synthetic", "synthetic"]), + params=params, + rng=np.random.default_rng(0), + sources={}, + artifacts={}, + ) + with pytest.raises( + ValueError, match="only computes the declared baseline scenario" + ): + REPORTING_INCOME_DECILE.run(context) + + +def test_synthetic_create_covers_both_teen_parent_branches_and_nonpartnered_coparents( + toy, +): + frame = toy[1][0].populations["nz.create"] + person = frame.table("person").set_index("person_id") + assert person.loc[10007, "age"] == 16 + assert ( + person.loc[10007, "person_family_id"] != person.loc[10006, "person_family_id"] + ) + assert person.loc[10010, "age"] == 15 + assert ( + person.loc[10010, "person_family_id"] == person.loc[10009, "person_family_id"] + ) + assert pd.isna(person.loc[10012, "partner_person_id"]) + assert pd.isna(person.loc[10013, "partner_person_id"]) + assert person.loc[10014, "parent_1_person_id"] == 10012 + assert person.loc[10014, "parent_2_person_id"] == 10013 + assert ( + person.loc[10014, "person_family_id"] == person.loc[10012, "person_family_id"] + ) + assert pd.isna(person.loc[10017, "parent_1_person_id"]) + + +def test_receipt_v2_integrates_stratified_targets_and_independent_draw_profile(toy): + fixture, run = toy + manifest = run[0] + central = manifest.nodes["nz.takeup.assign"].receipt + variant = manifest.nodes["nz.v.V3.takeup.assign"].receipt + for program in central["programs"].values(): + for stratum in program["strata"]: + assert stratum["rate"] * stratum["eligible_mass"] == pytest.approx( + stratum["target"] + ) + assert ( + fixture.spec["resources"]["receipt_contract"]["receipts"]["contract_version"] + == 2 + ) + assert central["assignment_profile"] != variant["assignment_profile"] + + +def test_integer_annual_transfers_follow_quantized_gross_and_assigned_flags(toy): + person = toy[1][0].populations["nz.central"].table("person") + for short in ("main", "other"): + gross = person[f"toy_{short}_annual_gross"] + net = person[f"toy_{short}_payment"] + assert (abs(gross * 0.8 - net * 52) <= 0.0050001).all() + cents = person[f"toy_{short}_annual_gross_cents"] + np.testing.assert_array_equal( + person[f"toy_{short}_transfer_cents"], + cents * person[f"receives_{short}"].astype("int64"), + ) + np.testing.assert_array_equal( + person.toy_pension_transfer_cents, + person.toy_pension_weekly_cents * 52 * person.receives_pension.astype("int64"), + ) + + +def test_four_regional_age_cells_prepare_and_calibrate_once(toy): + fixture, run = toy + frame = run[0].populations["nz.central"] + names = [name + "_indicator" for name, _, _, _ in DEMOGRAPHY] + assert frame.table("person")[names].sum(axis=1).eq(1).all() + assert run[0].nodes["nz.targets.problem"].receipt["n_targets"] == 4 + rows = fixture.spec["resources"]["target_references"]["target_references"] + assert { + row["measure"] + for row in rows + if row["metadata"]["activation_status"] == "active" + } == set(names) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_spec_engine_country_bundles.py b/packages/microcosm-build/tests/engine_free/shared/test_spec_engine_country_bundles.py index 2eeff5bdf8..5b4c45ee6c 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_spec_engine_country_bundles.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_spec_engine_country_bundles.py @@ -237,6 +237,7 @@ def test_nz_generation_zero_views_come_from_the_country_spec_seam() -> None: assert not spec.release_contract.artifact_repo_private assert {row.path for row in spec.resource_rows if row.kind == "legacy_json"} == { "as_area_crosswalk.json", + "as_encoding.json", "as_rate_bridge.json", "atomic_geography_support.json", "axiom_input_closure.json", @@ -246,14 +247,21 @@ def test_nz_generation_zero_views_come_from_the_country_spec_seam() -> None: "calibration_bindings.json", "calibration_settings.json", "chronicle_feed.json", + "concept_mapping.json", "currency_bridge.json", + "entitlement_graph.json", "export_contract.json", + "export_replay_bindings.json", "family_reconciliation.json", + "gap_annualisation.json", "gates.json", + "geography_assignment.json", "geography_spine.json", + "holdout_comparator_bindings.json", "holdout_references.json", "mass_references.json", "money_normalization.json", + "money_normalization_hold_fixed.json", "msd_benefit_rates_20260401.json", "msd_pre_activation_reconciliation.json", "precal_references.json", @@ -269,6 +277,9 @@ def test_nz_generation_zero_views_come_from_the_country_spec_seam() -> None: "scenarios.json", "source_stages.json", "target_references.json", + "transport_atomic_geography_support.json", + "transport_graph.json", + "transport_inputs.json", } diff --git a/packages/microcosm-build/tests/engine_free/shared/test_spec_only_country_packages.py b/packages/microcosm-build/tests/engine_free/shared/test_spec_only_country_packages.py index 4225969967..373f7e1670 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_spec_only_country_packages.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_spec_only_country_packages.py @@ -224,6 +224,30 @@ def test__given_schema_kernel_reference__then_it_is_not_an_entrypoint() -> None: assert not _looks_like_python_entrypoint("kernel:fit_qrf") +@pytest.mark.parametrize( + ("location", "value", "refused"), + [ + ("pkg/nz/concept_mapping.json.bindings[0]", "nz/statutes/a/b.yaml", False), + ("pkg/be/concept_mapping.json.bindings[0]", "be-vlg/statutes/a/b.yaml", False), + ("pkg/be/concept_mapping.json.bindings[0]", "be/statutes/a/37-10.yaml", False), + ("pkg/nz/concept_mapping.json.bindings[0]", "dotted.module", True), + ("pkg/nz/concept_mapping.json.bindings[0]", "dotted.module:callable", True), + ("pkg/nz/concept_mapping.json.bindings[0]", "../outside.yaml", True), + ("pkg/nz/concept_mapping.json.bindings[0]", "nz/statutes/a/b.py", True), + ("pkg/nz/concept_mapping.json", "nz/statutes/a/b.yaml", True), + ("pkg/nz/transport_graph.json.bindings[0]", "nz/statutes/a/b.yaml", True), + ], +) +def test__given_a_concept_mapping_module__then_only_a_rulespec_path_is_data( + location, + value, + refused, +) -> None: + offenders = [] + _collect_executable_content({"module": value}, location, offenders) + assert (f"{location}.module" in offenders) is refused + + def _partition_fact_key_roster() -> dict: keys = [ "ledger.aggregate_fact.v2:" + "a" * 24, @@ -619,4 +643,20 @@ def _is_compiler_identity_field(*, key: str, value: object, location: str) -> bo and isinstance(value, str) and re.fullmatch(r"ledger\.[a-z_]+\.v\d+:[0-9a-f]{24}", value) is not None ) - return virtual_resource_label or generated_lock_count or ledger_fact_identity + # A concept mapping's ``module`` names the RuleSpec file that scopes one + # binding. ``ConceptMapping.from_dict`` reads that field and the transport + # kernels select bindings by it, so a packaged mapping has to spell it so. + # Anything other than a country's RuleSpec YAML path stays refused. + concept_mapping_module = ( + key == "module" + and isinstance(value, str) + and re.fullmatch(r"[a-z]{2}(?:-[a-z]+)?(?:/[a-z0-9_-]+)+\.yaml", value) + is not None + and re.search(r"/concept_mapping\.json\.bindings\[\d+\]$", location) is not None + ) + return ( + virtual_resource_label + or generated_lock_count + or ledger_fact_identity + or concept_mapping_module + ) diff --git a/packages/microcosm-build/tests/engine_free/shared/test_transport_composed_graph.py b/packages/microcosm-build/tests/engine_free/shared/test_transport_composed_graph.py index 843bf54a89..7a6ef3cb9f 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_transport_composed_graph.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_transport_composed_graph.py @@ -39,6 +39,7 @@ import copy import hashlib import json +import os import re import shutil import time @@ -59,7 +60,10 @@ from microcosm.build.transport import cli as cli_module from microcosm.build.transport import compose as compose_module from microcosm.build.transport import target_kernels as target_kernels_module -from microcosm.build.transport.artifact_types import COMPARISON_TYPE +from microcosm.build.transport.artifact_types import ( + CALIBRATION_PREPARATION_TYPE, + COMPARISON_TYPE, +) from microcosm.build.transport.cli import ( EXPORT_FILENAME, execute_transport_graph, @@ -79,6 +83,7 @@ from microcosm.build.transport.target_kernels import CALIBRATION_PREPARE from microcosm.build.transport.terminal_kernels import materialize_export from microcosm.frame.kernels import SimulateRulesKernel +from microcosm.frame.unit_construction import MultiUnitRule, UnitDeclaration from microcosm.graph import ( ArtifactInput, ArtifactOutput, @@ -129,6 +134,7 @@ make_entitlement_fixture, ) from test_support.microcosm_build.transport_graph import descendants +from test_support.microcosm_build.transport_population import UNIT_RULE from test_support.paths import paths_for TRANSPORT = paths_for("microcosm-build").package / "src/microcosm/build/transport" @@ -2059,6 +2065,307 @@ def _run_prepare(node, incomes): ) +def _positive_payment_preparation(payments): + """Run the existing preparation kernel on invented comparator payments.""" + bindings = { + "schema_version": 1, + "required_inputs": {"family": ["weekly_payment"]}, + "input_domains": {"family": {"weekly_payment": {"kind": "nonnegative_number"}}}, + "columns": [ + { + "entity": "family", + "name": "positive_payment", + "predicates": [ + {"column": "weekly_payment", "operator": "gt", "value": 0} + ], + } + ], + } + node = Node( + id="positive_payment", + kernel=CALIBRATION_PREPARE.ref, + population="open", + inputs=(Slice("family", ("weekly_payment",)),), + outputs=(Owned("family", "positive_payment", "bool"),), + params={ + "bindings": canonical_json(bindings).decode(), + "references": canonical_json({"target_references": []}).decode(), + "references_sha256": "0" * 64, + }, + artifact_outputs=(ArtifactOutput("preparation", CALIBRATION_PREPARATION_TYPE),), + ) + return CALIBRATION_PREPARE.run( + KernelContext( + node=node, + tables={ + "family": pd.DataFrame( + {"family_id": range(len(payments)), "weekly_payment": payments} + ) + }, + weights={}, + strata=pd.Series([], dtype=object), + params=node.params, + rng=np.random.default_rng(0), + ) + ) + + +def test_h1_positive_payment_producer_counts_recipients_and_h2_annualises_dollars(): + payments = [0, 0.5, 3.25] + result = _positive_payment_preparation(payments) + indicator = result.columns["family", "positive_payment"] + assert indicator.tolist() == [False, True, True] + weights = np.asarray([2, 3, 5]) + assert np.sum(weights * indicator.to_numpy() * 1) == 8 + assert np.sum(weights * np.asarray(payments) * 52) == 923 + receipt = json.loads(result.artifacts["preparation"]) + assert receipt["bindings"]["columns"][0]["predicates"][0]["operator"] == "gt" + + +@pytest.mark.parametrize("payment", [-0.01, float("nan"), float("inf"), True, "1"]) +def test_h1_positive_payment_producer_refuses_invalid_money(payment): + with pytest.raises(ValueError, match="missing values|outside its declared domain"): + _positive_payment_preparation([payment]) + + +def _closed_export_spec(fixture): + """Opt a synthetic package into exact terminal slices without formula outputs.""" + spec = copy.deepcopy(fixture.spec) + document = spec["resources"]["transport_graph"] + formula = { + variable + for row in spec["resources"]["axiom_rules_bindings"]["bindings"] + for variable in row["variables"] + } + structural = { + "person": {"person_id", "person_household_id", "person_family_id"}, + "household": {"household_id"}, + "family": {"family_id"}, + } + rosters = {} + for row in document["nodes"]: + if row["kernel"] == "export.prepare@1": + role = "export" + elif ( + row["kernel"] == "gates.battery@1" and row["params"]["phase"] == "terminal" + ): + role = "gates" + else: + continue + for item in row["inputs"]: + item["columns"] = [ + name + for name in item["columns"] + if name not in formula | structural[item["entity"]] + ] + rosters[role] = {item["entity"]: item["columns"] for item in row["inputs"]} + spec["resources"]["closed_export"] = { + "closed": True, + "required": [ + "person_id", + "person_household_id", + "person_family_id", + "household_id", + "family_id", + "family_household_id", + "household_weight", + ], + "optional": sorted( + { + name + for roster in rosters.values() + for columns in roster.values() + for name in columns + } + - {"person_id", "household_id", "family_id"} + ), + "formula_owned_excluded": sorted(formula), + "entity_slices": rosters, + } + document["export_contract"] = "closed_export" + return spec + + +def test_closed_export_contract_enforces_exact_entity_slices(composed): + spec = _closed_export_spec(composed) + graph = compose_transport_graph(spec, composed.config) + compile_graph(graph) + export = graph.node("nz.export.prepare") + selected = {name for item in export.inputs for name in item.columns} + assert not selected & { + "toy_main_payment", + "person_id", + "person_household_id", + "person_family_id", + "household_id", + "family_id", + } + assert "family_household_id" in selected + # Keep every sliced entity, so ids still project, and drop one roster + # column: only the exact-slice check can refuse. + for row in spec["resources"]["transport_graph"]["nodes"]: + if row["id"] == "nz.export.prepare": + for item in row["inputs"]: + if item["entity"] == "person": + item["columns"] = item["columns"][:-1] + with pytest.raises(ValueError, match="exact entity-qualified whole-row slice"): + compose_transport_graph(spec, composed.config) + + +def test_closed_export_contract_refuses_missing_replay_inputs(composed): + spec = _closed_export_spec(composed) + for roster in spec["resources"]["closed_export"]["entity_slices"].values(): + roster["person"].remove("input_income") + with pytest.raises(ValueError, match="omits required replay inputs.*input_income"): + compose_transport_graph(spec, composed.config) + + +def test_closed_export_contract_requires_ordinary_family_household_link(composed): + spec = _closed_export_spec(composed) + for roster in spec["resources"]["closed_export"]["entity_slices"].values(): + roster["family"].remove("family_household_id") + with pytest.raises(ValueError, match="required columns.*family_household_id"): + compose_transport_graph(spec, composed.config) + + +def test_closed_export_contract_applies_roster_to_automatic_structural_columns( + composed, +): + spec = _closed_export_spec(composed) + spec["resources"]["closed_export"]["forbidden"] = ["person_id"] + with pytest.raises(ValueError, match="outside its closed roster"): + compose_transport_graph(spec, composed.config) + + +def _on_declared_units(value): + if isinstance(value, dict): + rows = {key: _on_declared_units(item) for key, item in value.items()} + if rows.get("resource") == "benefit_unit_rule": + rows["resource"] = "unit_declarations" + return rows + if isinstance(value, list): + return [_on_declared_units(item) for item in value] + return value + + +def _closed_export_on_create2(fixture, units, *, keep_legacy_rule=False): + """Move the closed-export spec to ``transport.create@2`` over ``units``.""" + spec = _closed_export_spec(fixture) + resources = spec["resources"] + legacy = resources.pop("benefit_unit_rule") + for name in ("transport_graph", "entitlement_graph", "scenarios"): + if name in resources: + resources[name] = _on_declared_units(resources[name]) + resources["unit_declarations"] = units.to_dict() + create = next( + row + for row in resources["transport_graph"]["nodes"] + if row.get("structural") == "create" + ) + create["kernel"] = "transport.create@2" + resources["axiom_rules_bindings"]["entity_names"]["assessment"] = "Assessment" + if keep_legacy_rule: + resources["benefit_unit_rule"] = legacy + return spec + + +def test_closed_export_contract_on_one_declared_unit_needs_no_legacy_rule(composed): + units = MultiUnitRule.from_benefit_unit(UNIT_RULE) + spec = _closed_export_on_create2(composed, units) + assert "benefit_unit_rule" not in spec["resources"] + compile_graph(compose_transport_graph(spec, composed.config)) + + +@pytest.mark.parametrize("keep_legacy_rule", [False, True]) +def test_closed_export_contract_covers_every_declared_partition( + composed, keep_legacy_rule +): + units = MultiUnitRule( + units=( + UnitDeclaration(kind="benefit_unit", rule=UNIT_RULE), + UnitDeclaration( + kind="benefit_unit", rule=replace(UNIT_RULE, entity="assessment") + ), + ) + ) + silent = _closed_export_on_create2( + composed, units, keep_legacy_rule=keep_legacy_rule + ) + with pytest.raises(ValueError, match="outside its closed roster"): + compose_transport_graph(silent, composed.config) + allowed = copy.deepcopy(silent) + allowed["resources"]["closed_export"]["optional"] += [ + "person_assessment_id", + "assessment_id", + ] + compile_graph(compose_transport_graph(allowed, composed.config)) + forbids = copy.deepcopy(allowed) + forbids["resources"]["closed_export"]["forbidden"] = ["person_assessment_id"] + with pytest.raises(ValueError, match="outside its closed roster"): + compose_transport_graph(forbids, composed.config) + + +@pytest.mark.parametrize("kind", ["scratch_cents", "reporting", "formula"]) +def test_closed_export_contract_refuses_scratch_reporting_and_formula_outputs( + composed, kind +): + spec = _closed_export_spec(composed) + graph = compose_transport_graph(spec, composed.config) + column = { + "scratch_cents": "scratch_cents", + "reporting": "income_decile", + "formula": "toy_main_payment", + }[kind] + if kind != "formula": + kernel = ( + "money.minor_units@1" + if kind == "scratch_cents" + else "reporting.income_decile@1" + ) + graph = replace( + graph, + nodes=( + *graph.nodes, + Node( + id="extra_output", + kernel=kernel, + population="nz.terminal", + outputs=(Owned("person", column, "int64"),), + ), + ), + ) + contract = spec["resources"]["closed_export"] + contract["optional"].append(column) + for roster in contract["entity_slices"].values(): + roster["person"].append(column) + graph = replace( + graph, + nodes=tuple( + replace( + node, + inputs=tuple( + replace(item, columns=(*item.columns, column)) + if item.entity == "person" + else item + for item in node.inputs + ), + ) + if node.id in {"nz.gates.terminal", "nz.export.prepare"} + else node + for node in graph.nodes + ), + ) + if mutant_root := os.environ.get("NZ_TRANSPORT_MUTANT_ROOT"): + assert ( + Path(compose_module.__file__) + .resolve() + .is_relative_to(Path(mutant_root).resolve()) + ) + print(f"Mutation imports compose from {compose_module.__file__}") + with pytest.raises(ValueError, match="scratch, reporting or formula outputs"): + compose_module._check_export_contract(spec, graph, compile_graph(graph)) + + def test_composition_supplies_each_variant_its_own_effective_interval_companion(): spec, row = _interval_prepare_spec() incomes = [104_999, 107_000, 112_000, 114_000, 116_000] @@ -2446,7 +2753,9 @@ def test_cli_arguments(): _GAPS = ( "axiom_rules_bindings.engine.commit", "axiom_rules_bindings.engine.wheel_sha256", - "transport_graph.json", + "money column person.employment_income awaits quantile map", + "money column person.liquid_financial_assets awaits quantile map", + "money column household.rent awaits quantile map", ) @@ -2456,14 +2765,9 @@ def test_packaged_spec_refuses_with_every_activation_gap_named(): validate_transport_activation(spec) for gap in _GAPS: assert gap in str(error.value), gap - assert ( - len( - str(error.value) - .removeprefix("Transport spec is not activated: ") - .split("; ") - ) - == 3 - ) + assert len( + str(error.value).removeprefix("Transport spec is not activated: ").split("; ") + ) == len(_GAPS) for removed in ( "placeholder reference precal_references.", "placeholder reference target_references.", @@ -7410,3 +7714,33 @@ def test_composition_checks_a_normalized_companion_on_each_pass( assert compose_transport_graph(spec, config).node(writer.id).kernel == ( writer.kernel ) + + +def test_cold_build_executes_create_for_inventory_and_graph( + composed, tmp_path, monkeypatch +): + calls = [] + create = cli_module.TRANSPORT_CREATE.run + + def counted(context): + calls.append(context.node.id) + return create(context) + + monkeypatch.setattr(cli_module.TRANSPORT_CREATE, "run", counted) + prepared = prepare_transport_build( + composed.spec, + sources=composed.sources, + engines_by_binding=composed.engines_by_binding, + inventory_store=tmp_path / "inventory", + resume="forbid", + ) + assert calls == ["nz.create"] + execute_transport_graph( + prepared.graph, + prepared.registry, + prepared.sources, + out=tmp_path / "cold-run", + endpoints=prepared.endpoints, + resume="forbid", + ) + assert calls == ["nz.create", "nz.create"] diff --git a/packages/microcosm-build/tests/engine_free/shared/test_transport_weight_quality.py b/packages/microcosm-build/tests/engine_free/shared/test_transport_weight_quality.py index 9af18e8e91..afc76ddc57 100644 --- a/packages/microcosm-build/tests/engine_free/shared/test_transport_weight_quality.py +++ b/packages/microcosm-build/tests/engine_free/shared/test_transport_weight_quality.py @@ -496,7 +496,7 @@ def test_adopted_cell_targets_are_flagged_and_never_block(): outcome = report.outcomes[0] assert outcome.status is GateStatus.FAILED flags = outcome.result.details["meets_tracked_target"] - assert len(flags) == 43 * 9 + assert len(flags) == 43 * 10 assert not any(flags.values()) assert not report.blocking_outcomes(release_candidate=True) diff --git a/packages/microcosm-build/tests/golden/nz_country_spec.json b/packages/microcosm-build/tests/golden/nz_country_spec.json index 610e9b8ccb..8318fd8570 100644 --- a/packages/microcosm-build/tests/golden/nz_country_spec.json +++ b/packages/microcosm-build/tests/golden/nz_country_spec.json @@ -1,6 +1,6 @@ { "country": "nz", - "fingerprint": "1add016352d551575a3141ad78deac1aa525b587b68d93cdf29738ed7c04f1e3", + "fingerprint": "fc9e3f65841862016207a1baa368e8ecf0476d194675ad8ec771811a5ea54f4f", "gate_ids": [ "calibration_per_family_fit", "demography_per_family_fit", @@ -39,28 +39,36 @@ }, "resource_hashes": { "as_area_crosswalk.json": "56eeb638d77c73fd92ca541d9d2f249fd3062bece0503470e0e85dde70c4c05b", - "as_rate_bridge.json": "c6e21af7b090283431973a5610cc3adf5d783a4a01fb0051d5dc6c8347eeabb0", + "as_encoding.json": "91e0e9972abfaaa202a13ede6e2dbc815a4c6c9514726c970928a47adfef0e32", + "as_rate_bridge.json": "25fa43210fd91655988933fe23ac6411bc30ddeb73c480c24da19999ffa2da22", "atomic_geography_support.json": "6efd09d5cde2f16d4d01e522a721191a829a754d2ce019d75bb0407085ecb4b7", - "axiom_input_closure.json": "b1bfdbff21c80b4c9aaad8dfe03c7912a9cbfebe9f2415a741e2ffc85ec017d6", + "axiom_input_closure.json": "1c237a316eecffd8d8eb9258a451b992373b804d72b411895337647c272731aa", "axiom_rules_bindings.json": "fb163e4842c8a910d63bd0ecf0fc81e5a55a2dddaa9cde66a52d9f4ff2c791f3", - "benefit_gross_up.json": "9194f3cf46b1e361d744d47efe6e77af03a7459cb7af8f8587d5a3e799e2c147", + "benefit_gross_up.json": "bb0100927c3d666f497b24694109463de247d53d6e7ee0cfa092255e33c5514e", "benefit_unit_rule.json": "a9e8cbfd38a64d2f8db0002fe8c31bb5a18fb34dbe59fa943336487ce95e2ca8", "calibration_bindings.json": "abf5278b51a13530e2c589a932942a185f5dda095c1eb3e4bc703999c24852b3", "calibration_settings.json": "56e4d1da8468245da6bd41daf263425cc65e4e9c9f11ff45eee459d3aed1989e", "chronicle_feed.json": "60a80dd0042838b0412baf9dd0985c961b4253a6876d16bcdbb8a2c6c03de0c7", - "country_package.json": "28094ea675dafa42bb2a7b20c3dbc18733e8e9af36cd09b63303487a9113f715", + "concept_mapping.json": "25171d7599a9d565e158af9ca010477db87ff0876bd374374329c0c58bf9f8bf", + "country_package.json": "18e57f36d4d5f3d047e1a9c7b832371332205a25c78140d38bf5876dbd2e39bd", "currency_bridge.json": "a23fcf09d364d22f346d3faf2ed59ddb6d2b2da88c9757e46f1d624b175ad21b", - "export_contract.json": "38496d0ea00ddfd0f9609dd965fad666e84360e6c65647f6e03f44167aa29c32", + "entitlement_graph.json": "75be6d21bae116691711a4c2191b2120603a3e048758d37e21361166ab120b5a", + "export_contract.json": "9483b44ef0646aee4556ec2bce1e744bd102685ebf393d6a3eef5ee1b4b377b5", + "export_replay_bindings.json": "49f070588488eaf1250edef89104fe7713994b2ebf89c4b2075e2071732f1ab5", "family_reconciliation.json": "20e3f9f3ce6266d57828d721c99d15bd3642e6c6314a7076ec38972de02bc69e", - "gates.json": "628a2f96e00c2c221b0f2c614481f6879ca3db16f2addddf7940628486ed47f0", + "gap_annualisation.json": "54762c18c549d2f1f35a630358080e3d581abab901b52a62b4f279830f3f8536", + "gates.json": "a60f3c077d1a3b0bc22128447aab88a4cc0275e1fdec274cd56db2120d2bada3", + "geography_assignment.json": "e25c687e061dc0eac863570d233236329c62e253585bea194af2d7213b1ac088", "geography_spine.json": "5f2b1bdd9f8768249912ffd0fbcb2f7d4ed493b51c74306f793ec12441fd383f", - "holdout_references.json": "2b8ccb4a5bdc427ccf5247994dfbfe703877f5c05baa66dfeda6883f83677daf", + "holdout_comparator_bindings.json": "bee86794af30953c4f7f922edd07900dbcad38f17ecb398be10bdd8b2d43297c", + "holdout_references.json": "c779749905c8266020122734e8a468eebf27a222e919b03bce5472cb65076a32", "mass_references.json": "1c1e7e6e1af8917917fc84072ed39b4298ad0444f04906fa6a594ebc2e48a926", "money_normalization.json": "5e817f0b859eacc44a4f96a57923b8af8498b0bbe169565650312b9547c8157c", + "money_normalization_hold_fixed.json": "0c18df28a18a8cc80cf7249ddc4e094b9931cdcdeb52e964155f8d56ae1b718d", "msd_benefit_rates_20260401.json": "1d03bcbe2ff34a27e6efe42e69871a71271c4e16fe9e3327f79acb8dba7d6b26", "msd_pre_activation_reconciliation.json": "375f69ae216b4a8ea553ad85b7fabc97b6b96dc2d6ac064df2cde076b9451be4", "precal_references.json": "a66dac9acd9becd3cc901dbd2d386813923400d403bd32b72db240ff351b3e30", - "precalibration_stages.json": "f2a13c707a57626ef98f3f9218c1405012840ef484e92a2665763cf67da7a009", + "precalibration_stages.json": "f2136a69ebbfc0ee4d5e657034bc44ed4814a85122520f29bf0b568dc3bbc6a8", "receipt_contract.json": "a8a7f863e76ec97d3660d5aa1cdcc9e538f70ffb210409a847097db9dc27858b", "reference_aging.json": "e7619ec7a02ae5f460a46d160e89c9c9836c8b1d03140aed2348761e590504f0", "reference_intervals.json": "fcc88c0efd5f416aa15a7d5afbeee1d103dd78a136e13b1efc3973d203188412", @@ -68,8 +76,8 @@ "reference_profiles.json": "703f3eec0fe7071d601487c314e76e697dd242c1ce174a02b90fb2b56fcc6fec", "reference_selection.json": "687ab45531b5d45a07508b9ea035a70ae1ded6dd572c8ae6b031d950450714c5", "release_contract.json": "6cd5e3a4a2bf30e4025e04e964c393b24040937d13db7e6a07b3966a55f3b114", - "reporting_classifiers.json": "31e03f8be77e5056b8761daca7ee0ac308f0b0e67edb11cb86a7f1299012f9d6", - "scenarios.json": "e2f80a66f3974594248553f714cdd6bcdc0f55cba3e1465f80d9f952a6896b6d", + "reporting_classifiers.json": "5ce609b1da063add6f80ce8f226de05434bae4ded3fb14055432b844ae3e1fbc", + "scenarios.json": "b312f02b8555fcc083863456b38ba1c2faf07a71e841492acd5739fef77b60fe", "source_stages.json": "cc82c68878ac0fc07ecbd796c1a66de6f34786ef8785125046425c37f26aff31", "spec/bundle.yaml": "e9716ce827e9006d4efdc392e7aaf9cbc33c16112a8fbc423e8f3e74ec506d8e", "spec/catalogs.yaml": "3ab2025af39cba93ead707b9463e428430a45b30696a43d0906cbcd97ed36631", @@ -77,7 +85,10 @@ "spec/sources.yaml": "afdaa4bef98cf520a1c72b6013d1e453162c761cd4b3c1548620184f6ba41297", "spec/spine.yaml": "b3e6a2832ff7671777cae113b7fc45f5e3492bb519526f229118d0851083533e", "spec/vintages.yaml": "1ecc1a3f952bd25b834c394314e8c933ddb5b095fd64ba492dddb03e3cdd803e", - "target_references.json": "feb8630eac964e616dfb9a3de264a551a3834fb891e5b54417868965118ef5b3" + "target_references.json": "feb8630eac964e616dfb9a3de264a551a3834fb891e5b54417868965118ef5b3", + "transport_atomic_geography_support.json": "53465827f67c87aaf5a06c305c082cbf1e6cdf28f3843e853d1e012635517d10", + "transport_graph.json": "6f487b5d10bbee7f5062f84b5a81014cbd6cdfdafdd9d9133f71a4bb45c59e8f", + "transport_inputs.json": "16d3957214d6305e3d3f41fe6343143a411d6055c75c43d3f171db3ee659ec2d" }, "resources": [ "spec/bundle.yaml", @@ -118,7 +129,18 @@ "source_stages.json", "target_references.json", "benefit_gross_up.json", - "precalibration_stages.json" + "precalibration_stages.json", + "transport_inputs.json", + "transport_atomic_geography_support.json", + "concept_mapping.json", + "geography_assignment.json", + "money_normalization_hold_fixed.json", + "transport_graph.json", + "entitlement_graph.json", + "gap_annualisation.json", + "holdout_comparator_bindings.json", + "as_encoding.json", + "export_replay_bindings.json" ], "stage_names": [ "load_populace_us_support_pool" diff --git a/test_support/microcosm_build/nz_msd_gross_up.py b/test_support/microcosm_build/nz_msd_gross_up.py index 3108664e7e..6a9e118b86 100644 --- a/test_support/microcosm_build/nz_msd_gross_up.py +++ b/test_support/microcosm_build/nz_msd_gross_up.py @@ -115,7 +115,14 @@ def _node(row, spec, engine_ref): for item in row["outputs"] ), params={ - key: _param(spec, value, {"income_tax_schedule_1": engine_ref}) + key: _param( + spec, + value, + { + "income_tax_schedule_1": engine_ref, + "main_benefits_rates": engine_ref, + }, + ) for key, value in row["params"].items() }, ) diff --git a/test_support/microcosm_build/transport_nz_toy.py b/test_support/microcosm_build/transport_nz_toy.py new file mode 100644 index 0000000000..85bc3a11c5 --- /dev/null +++ b/test_support/microcosm_build/transport_nz_toy.py @@ -0,0 +1,1221 @@ +"""Synthetic end-to-end NZ-shaped graph; no output estimates New Zealand. + +The forty invented donor households, facts, tax, benefit amounts, exchange +rate, factors and AS rules serve software tests only. The graph exercises the +real transport kernels with pure Python toy engine adapters, never real data +or a country engine. Toy tax applies one flat invented rate and carries no +claim about NZ law, withholding or policy accuracy. +""" + +from __future__ import annotations + +import copy +import json +from dataclasses import replace +from fractions import Fraction +from hashlib import sha256 + +import pandas as pd + +from microcosm.build.ledger_artifact import ( + chronicle_feed_identity, + load_ledger_consumer_artifact, +) +from microcosm.build.reference_factors import resolve_reference_factor +from microcosm.build.transport.codecs import FACTS_SOURCE_CODEC +from microcosm.build.transport.compose import TransportGraphConfig +from microcosm.build.transport.registry import build_transport_registry +from microcosm.build.transport.takeup_kernels import reporting_cell_declarations +from microcosm.frame import Frame, VariableMetadata, WeightKind, Weights +from microcosm.frame.adapters.axiom import NZ_SCHEMA +from microcosm.frame.concepts import concept_for_column, split_for_transport +from microcosm.frame.transport import derive_transport_seed, read_populace_us_donor +from microcosm.frame.unit_construction import build_benefit_units +from microcosm.graph import Owned +from microcosm.graph.canonical import canonical_json +from microcosm.graph.population import dtype_for_token +from test_support.microcosm_build.chronicle_feed import write_pinned_artifact +from test_support.microcosm_build.money_normalization import ( + DIMENSION, + graph_declaration, + money_factor_declaration, + money_feed_facts, +) +from test_support.microcosm_build.transport_composed import ( + PERIOD, + ToyRulesEngine, + _calibration_totals, + _document, + _edge, + _fact, + _node, + _owned, + _references, + _select, + _slice, +) +from test_support.microcosm_build.transport_entitlement import ( + TOY_PROGRAMS, + EntitlementFixture, + EntitlementToyEngine, + _as_and_gap, + _boundary, + _bridge, + _seed, + make_entitlement_fixture, +) +from test_support.microcosm_build.transport_graph import reference_row, write_facts +from test_support.microcosm_build.transport_population import ( + UNIT_RULE as BASE_UNIT_RULE, +) +from test_support.microcosm_build.transport_population import ( + donor_pin, + write_population_sources, +) + +UNIT_RULE = replace( + BASE_UNIT_RULE, + dependent_child=replace( + BASE_UNIT_RULE.dependent_child, parent_independence_min_age=16 + ), + split_parents="first_parent_unit", +) + +SCENARIOS = ("S0", "S1", "V1", "V3", "VHF") +SHARED_BRIDGE = "nz.as.bridge" +FLAGS = ("receives_main", "receives_other", "receives_pension") +GROSS = ("toy_main_annual_gross", "toy_other_annual_gross") +DEMOGRAPHY = tuple( + (f"toy_demography_{region}_{band}", region, lower, upper) + for region in ("R1", "R2") + for band, lower, upper in (("younger", 0, 40), ("older", 40, 100)) +) + + +def synthetic_households(tables): + """Replace the donor tables with forty invented households and clone lineage.""" + template = tables["person"].iloc[:3].to_dict("records") + persons, households = [], [] + for h in range(40): + household = 1000 + h + source = 1000 if h == 1 else household + ages = (18 + h % 23, 40 + h % 25, 15 + h % 3) + if h >= 30: + ages = (65 + (h - 30), 70 + (h - 30), 16) + for member, raw in enumerate(template): + row = dict(raw) + identity = 10000 + h * 3 + member + row.update( + person_id=identity, + person_household_id=household, + source_household_id=source, + source_person_id=f"synthetic-{identity}", + person_source_id=f"synthetic-{identity}", + age=ages[member], + A_LINENO=member + 1, + A_SPOUSE=(2 if member == 0 else 1) if member < 2 else 0, + PEPAR1=1 if member == 2 else -1, + PEPAR2=2 if member == 2 else -1, + A_EXPRRP=1 if member == 0 else (4 if member == 1 else 5), + is_household_head=member == 0, + employment_income_before_lsr=float(10 + h * 3 + member), + taxable_interest_income=float(h + member + 1), + tax_exempt_interest_income=0.0, + rental_income=-120.5 if h == 0 and member == 0 else float(h), + farm_operations_income=float(member), + pre_subsidy_rent=float(100 + h) if member == 0 else 0.0, + bank_account_assets=float(h * 2 + member), + ) + persons.append(row) + households.append( + { + "household_id": household, + "household_weight": 0.5 if h < 2 else 1.0, + "household_support_channel": "asec", + } + ) + # Teen parents retain co-resident parent pointers; a parentless child and + # non-partnered coparents exercise distinct unit-construction inputs. + for h, age in ((2, 16), (3, 15)): + first, parent, child = persons[3 * h : 3 * h + 3] + first.update(A_SPOUSE=0) + parent.update(age=age, A_SPOUSE=0, PEPAR1=1, A_EXPRRP=5) + child.update(age=1, PEPAR1=2, PEPAR2=-1) + persons[12].update(A_SPOUSE=0) + persons[13].update(A_SPOUSE=0) + persons[14].update(PEPAR2=2) + persons[17].update(PEPAR1=-1, PEPAR2=-1) + tables["person"] = pd.DataFrame(persons) + tables["household"] = pd.DataFrame(households) + + +class NzToyRulesEngine(ToyRulesEngine): + """Invented tax and region-age program adapter, carrying no country estimate.""" + + def variables(self): + if self.program().get("kind") == "tax": + return ("taxable_income",) + return super().variables() + + def variable_metadata(self, name): + if self.program().get("kind") == "tax": + return VariableMetadata(name, "person", "float", "year") + return super().variable_metadata(name) + + def materialize(self, bundle, variables, period): + if self.program().get("kind") != "tax": + program = self.program() + simple = [ + name + for name in variables + if program["outputs"][name]["operation"] != "region_age" + ] + result = super().materialize(bundle, simple, period) + person = bundle.table("person") + for name in set(variables) - set(simple): + row = program["outputs"][name] + regions = person["person_household_id"].map( + bundle.table("household").set_index("household_id")["region"] + ) + age = person[row["input"]] + result[name] = ( + (regions == row["region"]) + & (age >= row["lower"]) + & (age < row["upper"]) + ).to_numpy(dtype="int64") + return result + self.calls.append((tuple(variables), period)) + tax = bundle.table("person")["taxable_income"].to_numpy() * 0.2 + return {name: tax for name in variables} + + +class NzEntitlementToyEngine(EntitlementToyEngine): + """Feed assigned member receipts into the synthetic AS input bridge.""" + + def cache_identity(self): + return {"formula": "synthetic-assigned-receipt-as-v2"} + + def materialize(self, bundle, variables, period): + result = super().materialize(bundle, variables, period) + if self.program()["kind"] == "as": + person = bundle.table("person") + units = bundle.table("family")["family_id"] + for name, columns in ( + ("seed_as_super", ["receives_pension"]), + ("seed_as_beneficiary", ["receives_main", "receives_other"]), + ): + if name in variables and set(columns) <= set(person): + flags = ( + person[columns] + .any(axis=1) + .groupby(person["person_family_id"]) + .any() + ) + result[name] = units.map(flags).fillna(False).to_numpy(dtype=float) + return result + + +def _reprepare(fixture, spec=None): + spec = fixture.spec if spec is None else spec + bindings = spec["resources"]["axiom_rules_bindings"] + tree = fixture.sources["rulespec_nz"] + engines = { + row["id"]: ( + NzEntitlementToyEngine if row["id"] in TOY_PROGRAMS else NzToyRulesEngine + )(tree, row) + for row in bindings["bindings"] + } + registry = build_transport_registry( + bindings, tree, unit_rule=UNIT_RULE, engines_by_binding=engines + ) + return replace( + fixture, + spec=spec, + registry=registry, + engines_by_binding=engines, + config=replace(fixture.config, engine_refs=registry.engine_refs, extensions=()), + ) + + +class NzToyFixture(EntitlementFixture): + def reprepare(self, spec=None): + return _reprepare(self, spec) + + +def _normalizer(population, prefix, *, scenario=False, hold_fixed=False): + declaration = "money_hold_fixed" if hold_fixed else "money_normalization" + columns = graph_declaration()["columns"] + return _node( + f"{prefix}.normalize", + "money.normalize@1", + population=population, + sources=["money_facts"], + inputs=[_slice(entity, names) for entity, names in columns.items()], + outputs=[ + output + for entity, names in columns.items() + for name in names + for output in ( + _owned(entity, name, "float64", rewrite=True), + _owned(entity, name + "_cents", "int64"), + ) + ], + params={ + "declaration": _select(declaration), + "declaration_sha256": _select(declaration, "sha256"), + "factor_context": _select("money_factors"), + "factor_context_sha256": _select("money_factors", "sha256"), + "profile_selection": {"scenario": "knobs", "encoding": "json"} + if scenario + else _select("central_knobs"), + "chronicle_feed_pin": _select("money_feed_pin"), + }, + ) + + +def _money_bridges(population, prefix): + nodes = [] + for short, source in (("main", "toy_main_payment"), ("other", "toy_other_payment")): + output = f"toy_{short}_annual_gross" + nodes.append( + _node( + f"{prefix}.gross_up.{short}", + "simulate.solve_zero@1", + population=population, + sources=["rulespec_nz"], + inputs=[_slice("person", [source])], + outputs=[_owned("person", output, "float64")], + params={ + "engine_ref": {"binding": "toy_tax", "field": "engine_ref"}, + "period": {"binding": "toy_tax", "field": "period"}, + "variables": ["toy_tax"], + "input_overrides": "[]", + "output_coefficients": canonical_json( + [ + { + "source_entity": "person", + "source_column": source, + "coefficient": 52, + "entity": "person", + "column": output, + }, + { + "variable": "toy_tax", + "coefficient": 1, + "entity": "person", + "column": output, + }, + { + "trial": True, + "coefficient": -1, + "entity": "person", + "column": output, + }, + ] + ).decode("utf-8"), + "solve_input": canonical_json( + {"entity": "person", "column": "taxable_income"} + ).decode("utf-8"), + "bracket": [0, 1000000], + "tolerance": 0.00000001, + "iterations": 48, + "quantum": "0.01", + "tie_rule": "half_even", + "quantized_residual_bound": "0.0050001", + "certificate_margin": "0.000001", + "extra_evaluation_budget": 9, + }, + ) + ) + minor = { + "entity": "person", + "columns": [ + { + "source_column": source, + "output_column": source + "_cents", + "quantum": "0.01", + "rounding": "exact", + } + for source in GROSS + ] + + [ + { + "source_column": "toy_pension_payment", + "output_column": "toy_pension_weekly_cents", + "quantum": "0.01", + "rounding": "half_even", + "source_tax_basis": "before_tax", + } + ], + } + nodes.append( + _node( + f"{prefix}.gross_up.cents", + "money.minor_units@1", + population=population, + inputs=[_slice("person", [*GROSS, "toy_pension_payment"])], + outputs=[ + _owned("person", row["output_column"], "int64") + for row in minor["columns"] + ], + params={ + "declaration": canonical_json(minor).decode("utf-8"), + }, + ) + ) + return nodes + + +def _annual_transfers(population, prefix): + transfers = [ + { + "flag_column": flag, + "source_column": source, + "source_basis": basis, + "output_column": f"toy_{short}_transfer_cents", + "source_tax_basis": "before_tax", + } + for short, flag, source, basis in ( + ("main", FLAGS[0], GROSS[0] + "_cents", "annual_gross_cents"), + ("other", FLAGS[1], GROSS[1] + "_cents", "annual_gross_cents"), + ( + "pension", + FLAGS[2], + "toy_pension_weekly_cents", + "weekly_before_tax_cents", + ), + ) + ] + declaration = { + "entity": "person", + "weeks_per_year": 52, + "exposure": {"central": 1, "convention": "full_year_stock_equivalent"}, + "transfers": transfers, + } + return _node( + f"{prefix}.annual_transfers", + "money.annual_transfers@1", + population=population, + inputs=[ + _slice("person", [*FLAGS, *(row["source_column"] for row in transfers)]) + ], + outputs=[_owned("person", row["output_column"], "int64") for row in transfers], + params={ + "declaration": canonical_json(declaration).decode("utf-8"), + }, + ) + + +def _classifiers(): + income = { + "entity": "family", + "person_entity": "person", + "unit_id_column": "family_id", + "membership_column": "person_family_id", + "weight_entity": "household", + "expected_weight_kind": "calibrated", + "tie_key": "family_id", + "boundary_scenario": "S0", + "n_bins": 10, + "rank_method": "weighted_midpoint", + "components": [ + { + "entity": "person", + "column": name, + "kind": "market", + "tax_basis": "before_tax", + "annualisation_factor": 1, + } + for name in ("employment_income", "interest_income", "rental_income") + ] + + [ + { + "entity": "person", + "column": "toy_pension_payment", + "kind": "benefit", + "tax_basis": "before_tax", + "annualisation_factor": 52, + "receipt_column": "receives_pension", + } + ], + "excluded_columns": [{"entity": "family", "column": "toy_as_weekly"}], + } + receipt = { + "entity": "family", + "person_entity": "person", + "unit_id_column": "family_id", + "membership_column": "person_family_id", + "predicates": { + "superannuitant": { + "entity": "person", + "columns": ["receives_pension"], + "reduction": "any", + }, + "beneficiary": { + "entity": "person", + "columns": ["receives_main", "receives_other"], + "reduction": "any", + }, + }, + "priority": ["superannuitant", "beneficiary"], + "default": "other", + } + income["components"] += [ + { + "entity": "person", + "column": column, + "kind": "benefit", + "tax_basis": "before_tax", + "annualisation_factor": 1, + "receipt_column": flag, + } + for column, flag in zip(GROSS, FLAGS[:2], strict=True) + ] + return {"income": income, "receipt": receipt} + + +def _reporting(population, prefix, scenario): + baseline = scenario == "S0" + income = _node( + f"{prefix}.reporting.income_decile", + "reporting.income_decile@1" if baseline else "reporting.carry_income_decile@1", + population=population, + inputs=[ + _slice( + "person", + [ + "employment_income", + "interest_income", + "rental_income", + "toy_pension_payment", + *GROSS, + *FLAGS, + ], + ), + _slice("household", ["source_household_id"]), + ], + outputs=[_owned("family", "income_decile", "int64")], + params={ + "classifier": _select("toy_reporting", "json", "income"), + "classifier_sha256": _select("toy_reporting", "sha256"), + "scenario": scenario, + "entities": ["person", "household", "family"], + }, + ) + if not baseline: + income["artifact_inputs"] = [ + _edge("baseline_cells", "nz.scn.S0.reporting.income_decile") + ] + receipt = _node( + f"{prefix}.reporting.receipt_group", + "reporting.receipt_group@1", + population=population, + inputs=[_slice("person", FLAGS)], + outputs=[_owned("family", "receipt_group", "string")], + params={ + "classifier": _select("toy_reporting", "json", "receipt"), + "classifier_sha256": _select("toy_reporting", "sha256"), + "scenario": scenario, + }, + ) + return [income, receipt] + + +def make_nz_toy_fixture(root): + """Prepare forty synthetic households and the complete transport declaration.""" + base = make_entitlement_fixture(root, variants=False) + spec = copy.deepcopy(base.spec) + r = spec["resources"] + population = write_population_sources( + root / "forty-households", + mass=120, + edit_tables=synthetic_households, + time_period=2024, + ) + frame = _synthetic_frame(population) + structural = { + "person": {"person_id", "person_household_id", "person_family_id"}, + "household": {"household_id"}, + "family": {"family_id"}, + } + create_outputs = tuple( + Owned(entity, column, str(frame.table(entity)[column].dtype)) + for entity in ("person", "household", "family") + for column in frame.table(entity) + if column not in structural[entity] + ) + r["benefit_unit_rule"] = UNIT_RULE.to_dict() + sources = dict(base.sources) + sources["donor_pool"] = population.donor + r["donor_pin"] = donor_pin(population.donor) + facts = [ + json.loads(row) + for row in sources["nz_calibration_facts"].read_text().splitlines() + ] + totals = {name: value for name, _, value in _calibration_totals(frame)} + for fact in facts: + name = fact["semantic_fact_key"].rsplit(":", 1)[-1] + if name in totals: + fact["value"] = totals[name] + write_facts(sources["nz_calibration_facts"], facts) + path, pin, context = _quarterly_money_feed(root / "money-feed") + sources["money_facts"] = path + r.update( + money_normalization=graph_declaration(), + money_feed_pin=pin, + money_factors=context, + central_knobs={DIMENSION: "central", "receipt_draw": "central"}, + toy_reporting=_classifiers(), + ) + r["money_hold_fixed"] = copy.deepcopy(r["money_normalization"]) + r["money_hold_fixed"]["index_family_factors"] = { + family: {"identity": True, "reason": "Synthetic hold-fixed sensitivity."} + for family in r["money_normalization"]["index_family_factors"] + } + # Extend the same content-pinned toy rule module, never a statutory module. + bindings = r["axiom_rules_bindings"]["bindings"] + for binding in bindings: + tree_path = sources["rulespec_nz"] / binding["rulespec_path"] + program = json.loads(tree_path.read_text()) + if binding["id"] == "main_benefit": + program["outputs"]["toy_main_payment"].update( + input="input_age", coefficient=0.04 + ) + program["outputs"]["toy_other_eligible"] = { + "input": "input_age", + "operation": "at_most", + "threshold": 64, + "dtype": "int64", + } + program["outputs"]["toy_other_adult"] = { + "input": "input_age", + "operation": "at_least", + "threshold": 18, + "dtype": "int64", + } + program["outputs"]["toy_other_payment"] = { + "input": "input_age", + "operation": "linear", + "coefficient": 0.02, + "offset": 3, + "dtype": "float64", + } + for name, region, lower, upper in DEMOGRAPHY: + program["outputs"][name] = { + "input": "input_age", + "operation": "region_age", + "region": region, + "lower": lower, + "upper": upper, + "dtype": "int64", + } + if binding["id"] == "pension": + program["outputs"]["toy_pension_eligible"]["threshold"] = 65 + payload = canonical_json(program) + tree_path.write_bytes(payload) + binding.update( + sha256=sha256(payload).hexdigest(), variables=list(program["outputs"]) + ) + r["target_references"] = _references( + [ + reference_row(name, entity="person", measure=name + "_indicator") + for name, _, _, _ in DEMOGRAPHY + ] + ) + for name, region, lower, upper in DEMOGRAPHY: + fact = _fact(name, 30) + fact["label"] = f"Synthetic {region} population ages {lower} to {upper - 1}" + fact["geography"].update(level="region", id=region, name=f"Synthetic {region}") + age_band = f"{lower}-{upper - 1}" + fact["dimensions"] = {"age_band": age_band} + fact["dimension_labels"] = {"age_band": "Synthetic age band"} + fact["dimension_value_labels"] = { + "age_band": {age_band: f"Synthetic ages {lower} to {upper - 1}"} + } + facts.append(fact) + tax = { + "entity": "person", + "kind": "tax", + "relations": [], + "outputs": {"toy_tax": {"dtype": "float64"}}, + } + tax_path = sources["rulespec_nz"] / "toy/tax.yaml" + tax_path.write_bytes(canonical_json(tax)) + bindings.append( + { + "id": "toy_tax", + "rulespec_path": "toy/tax.yaml", + "sha256": sha256(tax_path.read_bytes()).hexdigest(), + "entity": "person", + "engine_entity": "Person", + "period": PERIOD, + "variables": ["toy_tax"], + } + ) + skeleton = r["transport_graph"] + rows = skeleton["nodes"] + rows[:] = [row for row in rows if row["id"] != "nz.transport.currency"] + rows.insert( + next( + i for i, row in enumerate(rows) if row["id"].startswith("nz.transport.qmap") + ), + _boundary("nz.central", "nz.open"), + ) + central_members = { + "nz.encode.person", + "nz.rules.main_benefits", + "nz.rules.pension", + "nz.takeup.assign", + "nz.targets.compile", + "nz.targets.problem", + } + for row in rows: + if row["id"] in central_members or row["id"].startswith("nz.transport.qmap"): + row["population"] = "nz.central" + if row["id"] == "nz.calibrate": + row["base"] = "nz.central" + if row["id"] == "nz.rules.main_benefits": + row["inputs"].append(_slice("household", ["region"])) + row["outputs"] += [ + _owned("person", name, "int64") for name, _, _, _ in DEMOGRAPHY + ] + row["outputs"] += [ + _owned("person", name, dtype) + for name, dtype in ( + ("toy_other_eligible", "int64"), + ("toy_other_adult", "int64"), + ("toy_other_payment", "float64"), + ) + ] + index = next(i for i, row in enumerate(rows) if row["id"] == "nz.central") + 1 + rows.insert(index, _normalizer("nz.central", "nz.central")) + # The compiler orders these stages through their declared inputs. + rows.extend(_money_bridges("nz.central", "nz.central")) + rows.append(_annual_transfers("nz.central", "nz.central")) + _receipts(r, facts, rows) + sources["nz_calibration_facts"] = write_facts( + sources["nz_calibration_facts"], facts + ) + skeleton["sources"].append({"name": "money_facts", "codec": FACTS_SOURCE_CODEC}) + by_id = {row["id"]: row for row in rows} + by_id["nz.units.attributes"]["inputs"] = [ + _slice( + "person", + ["age", "partner_person_id", "parent_1_person_id", "parent_2_person_id"], + ), + _slice("household", ["reference_person_id"]), + _slice( + "family", + [ + "family_household_id", + "family_head_person_id", + "family_source_household_id", + ], + ), + ] + problem = by_id["nz.targets.problem"] + problem["inputs"].append(_slice("person", ["receives_other"])) + _prepare(r, rows, problem) + # A closed replay slice excludes every scratch cent, formula and reporting output. + export_inputs = [ + _slice( + "person", + [ + "age", + "employment_income", + "interest_income", + "rental_income", + "farm_self_employment_income", + "liquid_financial_assets", + *FLAGS, + "input_age", + "input_income", + "input_pension_age", + ], + ), + _slice("household", ["rent", "source_household_id", "ta", "region"]), + _slice("family", ["family_source_household_id", "family_household_id"]), + ] + by_id["nz.export.prepare"]["inputs"] = export_inputs + by_id["nz.gates.terminal"]["inputs"] = export_inputs + r["calibration"]["epochs"] = 4 + scenarios = [ + {"id": "S0", "tier": "entitlement", "knobs": r["central_knobs"]}, + { + "id": "S1", + "tier": "entitlement", + "knobs": { + "input_overrides": [ + {"entity": "family", "column": "as_assets", "value": 0} + ] + }, + }, + { + "id": "V1", + "tier": "calibration", + "knobs": {DIMENSION: "low", "receipt_draw": "central"}, + }, + { + "id": "V3", + "tier": "calibration", + "knobs": {DIMENSION: "central", "receipt_draw": "variant"}, + }, + { + "id": "VHF", + "tier": "calibration", + "knobs": { + DIMENSION: "central", + "receipt_draw": "central", + "hold_fixed": True, + }, + }, + ] + entitlement = r["entitlement_graph"] + entitlement["scenario_nodes"] = [] + # As in the package, the shared bridge runs on its own FILTER branch. + shared = [ + row for row in entitlement["nodes"] if row["id"].startswith(SHARED_BRIDGE + ".") + ] + for row in shared: + row["population"] = SHARED_BRIDGE + entitlement["nodes"].insert( + entitlement["nodes"].index(shared[0]), _boundary(SHARED_BRIDGE, "nz.as") + ) + for scenario in scenarios: + name = scenario["id"] + if name in ("S0", "S1"): + pop = f"nz.scn.{name}" + nodes = [_boundary(pop, SHARED_BRIDGE)] + if name == "S1": + nodes.append( + _seed(pop, f"{pop}.override", scenario=True, fields=("as_assets",)) + ) + nodes += _as_and_gap(pop, pop, name) + else: + nodes, pop = _variant(r, rows, name) + gap = next(row for row in nodes if row["kernel"] == "takeup.gap@1") + # Reporting edges govern the cell diagnostics' columns. + gap["inputs"].append(_slice("family", ["income_decile", "receipt_group"])) + nodes += _reporting( + pop, f"nz.scn.{name}" if name.startswith("S") else f"nz.v.{name}", name + ) + scenario["nodes"] = nodes + r["scenarios"] = {"scenarios": scenarios, "central_knobs": r["central_knobs"]} + # Seed bridge nodes explicitly read assigned receipt flags after calibration. + for row in [ + *entitlement["nodes"], + *(node for scenario in scenarios for node in scenario["nodes"]), + ]: + if any( + name in row.get("params", {}).get("variables", ()) + for name in ("seed_as_super", "seed_as_beneficiary") + ): + row["inputs"][0]["columns"] += list(FLAGS) + _cell_gates(r) + _exemptions(r) + for row in r["entitlement_gap"]["target_references"]: + r["entitlement_annualisation"][row["name"]] = ( + 52 if row["measure"] == "toy_as_weekly" else 1 + ) + fixture = NzToyFixture( + root, + spec, + TransportGraphConfig( + engine_refs=base.config.engine_refs, create_outputs=create_outputs + ), + base.registry, + sources, + base.engines_by_binding, + ) + return fixture.reprepare() + + +def _receipts(resources, facts, rows): + bindings = { + "schema_version": 1, + "required_inputs": {"person": ["age"]}, + "input_domains": {"person": {"age": {"kind": "nonnegative_integer"}}}, + "columns": [ + { + "entity": "person", + "name": name, + "predicates": [ + {"column": "age", "operator": "ge", "value": lower}, + {"column": "age", "operator": "lt", "value": upper}, + ], + } + for name, lower, upper in (("toy_young", 18, 30), ("toy_adult", 30, 65)) + ], + } + resources["calibration_bindings"] = bindings + programs = [] + for short, flag, judgments, payment in ( + ("main", FLAGS[0], ["toy_main_eligible"], "toy_main_payment"), + ( + "other", + FLAGS[1], + ["toy_other_eligible", "toy_other_adult"], + "toy_other_payment", + ), + ): + strata = [] + for filter_ in ("toy_young", "toy_adult"): + name = f"toy_receipt_{short}_{filter_}" + strata.append({"target": name, "filter": filter_}) + resources["precal_references"]["target_references"].append( + reference_row(name, entity="person", measure=flag, filter_=filter_) + ) + facts.append(_fact(name, 0.25 if short == "other" else 1.0)) + programs.append( + { + "program": f"toy.{short}", + "output": flag, + "judgment_columns": judgments, + "judgment_reduction": "all", + "payment_column": payment, + "strata": strata, + "outside_strata": "not_assigned", + } + ) + programs.append( + { + "program": "toy.pension", + "output": FLAGS[2], + "judgment_columns": ["toy_pension_eligible"], + "judgment_reduction": "all", + "payment_column": "toy_pension_payment", + "target": "toy_receipt_pension", + } + ) + resources["precal_references"]["target_references"].append( + reference_row("toy_receipt_pension", entity="person", measure=FLAGS[2]) + ) + facts.append(_fact("toy_receipt_pension", 10)) + resources["receipt_contract"] = { + "receipts": { + "contract_version": 2, + "seed_column": "take_up_seed", + "default_assignment_profile": "central", + "assignment_knob": "receipt_draw", + "assignment_profiles": { + "central": {"draw_key_suffix": ""}, + "variant": {"draw_key_suffix": "variant"}, + }, + "programs": programs, + "exclusion_groups": [[FLAGS[2], FLAGS[0], FLAGS[1]]], + } + } + receipt = next(row for row in rows if row["id"] == "nz.takeup.assign") + receipt["outputs"] = [_owned("person", flag, "bool") for flag in FLAGS] + receipt["inputs"] = [ + _slice( + "person", + [ + "age", + "take_up_seed", + "toy_main_eligible", + "toy_main_payment", + "toy_other_eligible", + "toy_other_adult", + "toy_other_payment", + "toy_pension_eligible", + "toy_pension_payment", + *(name for name, _, _, _ in DEMOGRAPHY), + ], + ) + ] + receipt["artifact_inputs"] = [_edge("surface", "nz.facts.precal")] + receipt["params"].update( + **_document("calibration_bindings", "calibration_bindings"), + profile_selection=_select("central_knobs"), + ) + + +def _prepare(resources, rows, problem): + bindings = resources["calibration_bindings"] + for name, _, _, _ in DEMOGRAPHY: + bindings["required_inputs"]["person"].append(name) + bindings["input_domains"]["person"][name] = {"kind": "nonnegative_integer"} + bindings["columns"].append( + { + "entity": "person", + "name": name + "_indicator", + "predicates": [{"column": name, "operator": "eq", "value": 1}], + } + ) + prepare = _node( + "nz.calibration.prepare", + "calibration.prepare@1", + population="nz.central", + inputs=[_slice("person", bindings["required_inputs"]["person"])], + outputs=[_owned("person", row["name"], "bool") for row in bindings["columns"]], + params={ + "bindings": _select("calibration_bindings"), + **_document("references", "target_references"), + }, + ) + rows.append(prepare) + problem["artifact_inputs"].append(_edge("preparation", prepare["id"])) + problem["inputs"].append( + _slice("person", [row["name"] for row in bindings["columns"]]) + ) + + +def _variant(resources, rows, name): + prefix = f"nz.v.{name}" + own = [_boundary(prefix, "nz.open")] + selected = [] + for row in rows: + if row.get("population") == "nz.central": + clone = copy.deepcopy(row) + clone["id"] = prefix + "." + row["id"].removeprefix("nz.") + clone["population"] = prefix + selected.append(clone) + names = { + old["id"]: new["id"] + for old, new in zip( + [row for row in rows if row.get("population") == "nz.central"], + selected, + strict=True, + ) + } + for row in selected: + if row["kernel"] == "money.normalize@1": + row["params"]["profile_selection"] = { + "scenario": "knobs", + "encoding": "json", + } + if name == "VHF": + row["params"]["declaration"] = _select("money_hold_fixed") + row["params"]["declaration_sha256"] = _select( + "money_hold_fixed", "sha256" + ) + if row["kernel"] == "takeup.assign@1": + row["params"]["profile_selection"] = { + "scenario": "knobs", + "encoding": "json", + } + for edge in row.get("artifact_inputs", []): + edge["producer"] = names.get(edge["producer"], edge["producer"]) + own += selected + calibration = copy.deepcopy( + next(row for row in rows if row["id"] == "nz.calibrate") + ) + calibration.update(id=f"{prefix}.calibrate", base=prefix) + calibration["artifact_inputs"][0]["producer"] = names["nz.targets.problem"] + population = prefix + ".housing" + group = copy.deepcopy(next(row for row in rows if row["id"] == "nz.as.inputs")) + group.update(id=prefix + ".inputs", population=population) + own += [ + calibration, + _boundary(population, calibration["id"]), + group, + _seed(population, prefix + ".seed"), + *_bridge(population, prefix), + *_as_and_gap(population, prefix, name), + ] + return own, population + + +def _cell_gates(resources): + grid = { + "entity": "family", + "measure": "toy_as_weekly", + "period": PERIOD, + "annualisation_factor": 52, + "tables": [ + { + "name": "toy_income", + "axes": [{"column": "income_decile", "values": list(range(1, 11))}], + }, + { + "name": "toy_receipt", + "axes": [ + { + "column": "receipt_group", + "values": ["beneficiary", "superannuitant", "other"], + } + ], + }, + ], + } + resources["scenarios"]["gap_conventions"] = {"reporting_cells": grid} + resources["gates"]["gates"] += [ + { + "id": "toy_weight_ess", + "gate": "weight_ess", + "phase": "terminal", + "criticality": "release_blocking", + "parameters": { + "minimum_ess_fraction": 0.1, + "aggregation_column": "source_household_id", + }, + }, + { + "id": "toy_cell_support", + "gate": "cell_support", + "phase": "terminal", + "criticality": "release_blocking", + "evidence_absent_blocks": True, + "parameters": { + "required_scenarios": list(SCENARIOS), + "required_cells": [ + row["name"] for row in reporting_cell_declarations(grid) + ], + "aggregation_column": "source_household_id", + "required_weight_entity": "household", + "required_weight_kind": "calibrated", + "minimum_cell_ess": 0.1, + "maximum_contribution_cv": 100, + "maximum_single_donor_dollar_share": 1, + "target_minimum_cell_ess": 0.1, + "target_maximum_single_donor_dollar_share": 1, + }, + }, + ] + + +def _exemptions(resources): + selections = {} + for resource, name, entity, measure in ( + ("target_references", "toy_parked_calibration", "person", "age"), + ("holdout_references", "toy_parked_tripwire", "person", "receives_main"), + ): + row = reference_row( + name, entity=entity, measure=measure, activation_status="pending" + ) + resources[resource]["target_references"].append(row) + selections[resource] = { + "exempt": [ + { + "name": name, + "activation_status": "pending", + "reason": "The synthetic negative fixture awaits its reviewed producer.", + } + ] + } + resources["reference_selection"] = {"schema_version": 1, "resources": selections} + + +def toy_donor_factor(profile): + """An independent exact oracle for the toy's four-quarter pay factor.""" + q = { + "low": Fraction(101, 100), + "central": Fraction(102, 100), + "high": Fraction(103, 100), + }[profile] + ratio = Fraction(110) * sum(q**i for i in range(4)) / 4 / 101 + return Fraction(round(ratio * 10**6), 10**6) + + +def _quarterly_money_feed(root): + facts = money_feed_facts() + quarters = [ + (f"2024-Q{i + 1}", f"2024-{3 * i + 1:02d}-01", end) + for i, end in enumerate( + ("2024-03-31", "2024-06-30", "2024-09-30", "2024-12-31") + ) + ] + target = [ + (f"2027-Q{i + 1}", f"2027-{3 * i + 1:02d}-01", end) + for i, end in enumerate( + ("2027-03-31", "2027-06-30", "2027-09-30", "2027-12-31") + ) + ] + source = [] + for i, (period, start, end) in enumerate(quarters): + fact = copy.deepcopy(facts[i // 2]) + fact.update( + aggregate_fact_key=f"source-{i}", + period={"type": "quarter", "value": period}, + period_coverage={"start_date": start, "end_date": end}, + ) + source.append(fact) + anchor = copy.deepcopy(facts[2]) + anchor.update( + period={"type": "quarter", "value": target[0][0]}, + period_coverage={"start_date": target[0][1], "end_date": target[0][2]}, + ) + growth = copy.deepcopy(facts[3]) + growth["value"] = 8.243216 + path, pin = write_pinned_artifact(root, [*source, anchor, growth]) + pin["source_commit"] = "c" * 40 + artifact = load_ledger_consumer_artifact(path, feed_pin=pin, lexical_floats=True) + identity = chronicle_feed_identity(pin) + entries = [] + for profile, delta in ( + ("low", "-4.182815"), + ("central", "0"), + ("high", "4.307665"), + ): + declaration = money_factor_declaration(profile, identity) + + def slots(template, schedule, *, projected): + result = [] + for i, (period, start, end) in enumerate(schedule): + row = copy.deepcopy(template) + row["selector"].update(period_type="quarter", period_value=period) + row["validation"]["period_coverage"] = { + "start_date": start, + "end_date": end, + } + row["sequence"] = i + if projected: + row["projection_offset"] = i + result.append(row) + return result + + declaration["source_schedule"] = slots( + declaration["source_schedule"][0], quarters, projected=False + ) + declaration["target_schedule"] = slots( + declaration["target_schedule"][0], target, projected=True + ) + declaration["subperiods_per_year"] = 4 + declaration["growth"]["scenario_delta"] = delta + declaration["expected_operational_factor"] = { + "numerator": int(toy_donor_factor(profile) * 10**6), + "denominator": 10**6, + } + factor, receipt = resolve_reference_factor( + declaration, artifact.facts, identity + ) + entries.append( + { + "declaration": declaration, + "operational_factor": factor, + "receipt": receipt, + } + ) + return ( + path, + pin, + {"schema_version": 1, "feed_identity": identity, "factors": entries}, + ) + + +def _synthetic_frame(sources): + donor = read_populace_us_donor(sources.donor, **donor_pin(sources.donor)) + tables, _ = split_for_transport(donor.tables) + for entity, table in tables.items(): + for name in table: + concept = concept_for_column(entity, name) + if concept is not None and concept.dtype == "str": + table[name] = pd.array(table[name], dtype=dtype_for_token("string")) + person, household = tables["person"], tables["household"] + family, membership = build_benefit_units(person, household, UNIT_RULE) + person[UNIT_RULE.membership_column] = membership + person["take_up_seed"] = derive_transport_seed( + donor.source_person_ids, "synthetic:composed:takeup" + ) + household["donor_support_stratum"] = pd.array( + donor.support_strata, dtype=dtype_for_token("string") + ) + tables["family"] = family + weights = pd.Series(donor.weights, index=household["household_id"]) + scale = 120 / person["person_household_id"].map(weights).sum() + return Frame( + tables, + NZ_SCHEMA, + {"household": Weights(donor.weights * scale, WeightKind.DESIGN)}, + ) diff --git a/tools/build_nz_benefit_gross_up.py b/tools/build_nz_benefit_gross_up.py index 765d3451b6..c4ac32c2f5 100644 --- a/tools/build_nz_benefit_gross_up.py +++ b/tools/build_nz_benefit_gross_up.py @@ -9,6 +9,7 @@ import argparse import json +from fractions import Fraction from pathlib import Path ROOT = Path(__file__).resolve().parents[1] @@ -22,6 +23,12 @@ "Annualised Schedule 1, before credits, 52-week benefit gross-up, " "each benefit inverted independently of other income." ) +NET_ROUNDING = ( + "MSD pays whole cents, so a money.minor_units@1 node rounds each weekly net " + "payment half-even to cents before its gross-up, and each solve reads those " + "cents with coefficient 0.52, which turns weekly cents into annual dollars " + "over 52 weeks." +) def _json(value): @@ -40,6 +47,10 @@ def _selector(field): return {"binding": "income_tax_schedule_1", "field": field} +def _rates_selector(field): + return {"binding": "main_benefits_rates", "field": field} + + def documents(nz=NZ): bindings_document = json.loads((nz / "axiom_rules_bindings.json").read_text()) bindings = {row["id"]: row for row in bindings_document["bindings"]} @@ -55,6 +66,7 @@ def documents(nz=NZ): weeks = scenarios["gap_conventions"]["annualisation"]["weeks_per_year"] tax = bindings["income_tax_schedule_1"] nets = [f"{programme}_net_weekly_payment" for programme in PROGRAMMES] + net_cents = [f"{column}_cents" for column in nets] gross = [f"{programme}_annual_gross" for programme in PROGRAMMES] cents = [f"{column}_cents" for column in gross] rate_inputs = [ @@ -66,7 +78,7 @@ def documents(nz=NZ): { "id": "nz.benefits.rates", "kernel": "simulate.rules_by_ref@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "rules_binding": "main_benefits_rates", "inputs": [_slice(rate_inputs)], @@ -74,12 +86,41 @@ def documents(nz=NZ): "params": {"variables": nets}, } ] - for programme, net, annual in zip(PROGRAMMES, nets, gross, strict=True): + nodes.append( + { + "id": "nz.benefits.net_cents", + "kernel": "money.minor_units@1", + "population": "nz.central", + "structural": "none", + "inputs": [_slice(nets)], + "outputs": [_owned(column, "int64") for column in net_cents], + "params": { + "engine_ref": _rates_selector("engine_ref"), + "period": _rates_selector("period"), + "declaration": _json( + { + "entity": "person", + "columns": [ + { + "source_column": net, + "output_column": cents, + "quantum": "0.01", + "rounding": "half_even", + } + for net, cents in zip(nets, net_cents, strict=True) + ], + } + ), + }, + } + ) + cents_coefficient = float(Fraction(weeks, 100)) + for programme, net, annual in zip(PROGRAMMES, net_cents, gross, strict=True): terms = [ { "source_entity": "person", "source_column": net, - "coefficient": weeks, + "coefficient": cents_coefficient, "entity": "person", "column": annual, }, @@ -95,7 +136,7 @@ def documents(nz=NZ): { "id": f"nz.gross_up.{programme}", "kernel": "simulate.solve_zero@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [_slice([net])], "outputs": [_owned(annual)], @@ -138,7 +179,7 @@ def documents(nz=NZ): { "id": "nz.gross_up.annual_cents", "kernel": "money.minor_units@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [_slice(gross)], "outputs": [_owned(column, "int64") for column in cents], @@ -151,7 +192,7 @@ def documents(nz=NZ): { "id": "nz.gross_up.super_cents", "kernel": "money.minor_units@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [_slice([nzs_source])], "outputs": [_owned(nzs_cents, "int64")], @@ -208,7 +249,7 @@ def documents(nz=NZ): { "id": "nz.benefits.annual_transfers", "kernel": "money.annual_transfers@1", - "population": "nz.open", + "population": "nz.central", "structural": "none", "inputs": [_slice([*flags, *cents, nzs_cents])], "outputs": [_owned(column, "int64") for column in transfer_columns], @@ -219,8 +260,9 @@ def documents(nz=NZ): "schema_version": 1, "country": "nz", "generator": "tools/build_nz_benefit_gross_up.py", - "status": "reusable graph declarations; packaged transport graph wiring remains pending", + "status": "The central branch and each calibration variant run these reusable declarations after their own money normalization.", "disclosure": DISCLOSURE, + "net_rounding": NET_ROUNDING, "monotonicity": "For the pinned Schedule 1, every marginal tax rate falls below one; 52*n + T(G) - G decreases or stays constant as each person's own G increases.", "authoritative_value": "money.minor_units@1 recovers annual integer cents exactly from certified float64 quantum multiples and preserves the bridge's float64 output contract.", "certificate_contract": "certificate_margin bounds the absolute difference between each computed residual and the exact residual of the declared terms at every evaluated point. Boundary residuals must exceed the margin in magnitude; ambiguous boundaries refuse, and the residual bound includes the margin. A zero margin asserts exact outputs and permits half-even ties.", @@ -248,10 +290,19 @@ def documents(nz=NZ): } for column in nets ], + "derived_outputs": [ + { + "entity": "person", + "column": column, + "purpose": "calibration_measure", + } + for column in net_cents + ], "citation": ( f"{rulespec_url}/{bindings['main_benefits_rates']['rulespec_path']} " f"(SHA-256 {bindings['main_benefits_rates']['sha256']}); " - f"{msd_url}. The rates stage supplies after-tax payments after abatement." + f"{msd_url}. The rates stage supplies after-tax payments after abatement, " + "and its cents node rounds them half-even to the whole cents MSD pays." ), }, { diff --git a/tools/build_nz_entitlement_graph.py b/tools/build_nz_entitlement_graph.py new file mode 100644 index 0000000000..e371567160 --- /dev/null +++ b/tools/build_nz_entitlement_graph.py @@ -0,0 +1,696 @@ +#!/usr/bin/env python3 +"""Generate NZ's post-calibration entitlement branch declarations. + +The Accommodation Supplement bridge follows ``as_rate_bridge.json``. On each +population that runs the AS engine, a ``calibration.prepare@1`` node writes +the family masks, a ``simulate.counterfactual@1`` node writes the reg 18(3)(b) +sole-parent gross rate and a ``simulate.solve_zero@1`` node writes the reg 18 +cutout. The shared ``nz.as.bridge`` population, a FILTER branch of ``nz.as``, +runs these once for every entitlement scenario, and each variant repeats them +on its own housing population. An extension node on ``nz.as`` itself would +re-key the skeleton's ``nz.terminal``, which composition refuses. Each +branch runs its own reg 17 base-rate counterfactual. Every coefficient, mask +and override comes from the resource; this generator adds no schedule. +""" + +from __future__ import annotations + +import argparse +import copy +import json +from fractions import Fraction +from pathlib import Path + +ROOT = Path(__file__).resolve().parents[1] +NZ = ROOT / "packages/microcosm-build/src/microcosm/build/nz" +AS_BINDING = "accommodation_supplement" +PAYMENT = "accommodation_supplement_rounded_weekly_payment" +POSITIVE = "accommodation_supplement_positive_payment_indicator" +ENTITLED = "accommodation_supplement_entitled_weekly_payment" +JUDGMENT = "accommodation_supplement_non_rate_entitlement_requirements" +#: The code the Axiom adapter's judgment decoder gives "holds" (-1 not holds, +#: 0 undetermined); only holds passes. +HOLDS = 1 +ENTITIES = ["person", "household", "family"] +#: The FILTER branch of nz.as on which the shared bridge nodes run. +SHARED_BRIDGE = "nz.as.bridge" + + +def read(nz, name): + return json.loads((nz / f"{name}.json").read_text()) + + +def select(resource, encoding="json", *path): + result = {"resource": resource, "encoding": encoding} + if path: + result["path"] = list(path) + return result + + +def slices(entity, columns): + from build_nz_transport_graph import slice_ + + return slice_(entity, sorted(set(columns))) + + +def owned(entity, column, dtype="float64", *, rewrite=False): + result = {"entity": entity, "column": column, "dtype": dtype} + if rewrite: + result["rewrite"] = True + return result + + +def node(id, kernel, population=None, **fields): + result = {"id": id, "kernel": kernel, "structural": "none"} + if population: + result["population"] = population + return {**result, **fields} + + +def boundary(id, base): + return node( + id, + "transport.boundary@1", + structural="filter", + base=base, + inputs=[slices("person", ["age"])], + params={}, + ) + + +def binding(name, field="engine_ref"): + return {"binding": name, "field": field} + + +def _unit(attribute): + entity, _, column = attribute.partition(".") + return entity, column + + +def _mask(row): + entity, column = _unit(row["unit_attribute"]) + return {"entity": entity, "column": column, "equals": row["equals"]} + + +def _overrides(rows, entity="person"): + """Translate the resource's override rows into kernel override records.""" + result = [] + for row in rows: + item = {"entity": entity, "column": row["variable"]} + if "unit_attribute" in row: + source_entity, column = _unit(row["unit_attribute"]) + item.update(source_entity=source_entity, source_column=column) + else: + item["value"] = row["value"] + if "mask" in row: + item["mask"] = _mask(row["mask"]) + result.append(item) + return result + + +def _coefficient(value): + return float(Fraction(value)) if isinstance(value, str) else value + + +def _term(row, target, primary, bindings): + """One output coefficient on the family target column.""" + if "source" in row: + entity, column = _unit(row["source"]) + return { + "source_entity": entity, + "source_column": column, + "coefficient": _coefficient(row["coefficient"]), + "entity": "family", + "column": target, + } + term = { + "variable": row["variable"], + "coefficient": _coefficient(row["coefficient"]), + "entity": "family", + "column": target, + } + if row["binding"] != primary: + term["engine_ref"] = binding(row["binding"]) + if bindings[row["binding"]]["entity"] == "person": + term["aggregation"] = row["aggregation"] + if "mask" in row: + term["mask"] = _mask(row["mask"]) + return term + + +def _bridge_inputs(nz, *extra, person=()): + bindings = {row["id"]: row for row in read(nz, "axiom_rules_bindings")["bindings"]} + closure = read(nz, "axiom_input_closure") + rate_path = bindings["main_benefits_rates"]["rulespec_path"] + rate_inputs = [ + entry["input"] + for entry in closure["entries"] + if entry["rulespec_path"] == rate_path and entry["entity"] == "Person" + ] + family = [ + "n_dependent_children", + "is_partnered", + "is_single", + "is_sole_parent", + "youngest_dependent_child_age", + *( + column["name"] + for column in read(nz, "as_rate_bridge")["mask_bindings"]["columns"] + ), + *extra, + ] + return [slices("person", [*rate_inputs, *person]), slices("family", family)] + + +def bridge_masks(nz, population, prefix): + """The family booleans the equality-only bridge masks compare.""" + bridge = read(nz, "as_rate_bridge") + return node( + f"{prefix}.bridge.masks", + "calibration.prepare@1", + population, + inputs=[ + slices(entity, columns) + for entity, columns in bridge["mask_bindings"]["required_inputs"].items() + ], + outputs=[ + owned(column["entity"], column["name"], "bool") + for column in bridge["mask_bindings"]["columns"] + ], + params={ + "bindings": select("as_rate_bridge", "json", "mask_bindings"), + "references": select("holdout_references"), + "references_sha256": select("holdout_references", "sha256"), + }, + ) + + +def _counterfactual_params(primary, overrides, terms, components=()): + params = { + "engine_ref": binding(primary), + "period": binding(primary, "period"), + "variables": list( + dict.fromkeys( + term["variable"] + for term in terms + if "variable" in term and "engine_ref" not in term + ) + ), + "input_overrides": overrides, + "output_coefficients": terms, + } + if components: + params["components"] = list(components) + params["resource_sha256"] = select("as_rate_bridge", "sha256") + return params + + +def cutout_nodes(nz, population, prefix): + """Reg 18: the sole-parent gross rate, then one zero-solve per population.""" + bridge = read(nz, "as_rate_bridge") + bindings = {row["id"]: row for row in read(nz, "axiom_rules_bindings")["bindings"]} + reg18 = bridge["outputs"][1] + gross = reg18["gross_rate"] + gross_term = { + "variable": gross["variable"], + "coefficient": gross["coefficient"], + "entity": "family", + "column": gross["column"], + "aggregation": gross["aggregation"], + "mask": _mask(gross["mask"]), + } + solve = reg18["solve"] + target = reg18["target_input"] + terms = [_term(row, target, solve["binding"], bindings) for row in solve["terms"]] + params = _counterfactual_params( + solve["binding"], _overrides(solve["input_overrides"]), terms + ) + resource = params.pop("resource_sha256") + params.update( + solve_input=solve["solve_input"], + bracket=solve["bracket"], + tolerance=solve["tolerance"], + iterations=solve["iterations"], + resource_sha256=resource, + ) + return [ + node( + f"{prefix}.bridge.{gross['id']}", + gross["kernel"], + population, + sources=["rulespec_nz"], + inputs=_bridge_inputs(nz), + outputs=[owned("family", gross["column"])], + params=_counterfactual_params( + gross["binding"], _overrides(gross["input_overrides"]), [gross_term] + ), + description="The engine evaluates the reg 18(3)(b) sole-parent Jobseeker Support rate for sole parents.", + ), + node( + f"{prefix}.bridge.cutout", + reg18["kernel"], + population, + sources=["rulespec_nz"], + inputs=_bridge_inputs(nz, gross["column"]), + outputs=[owned("family", target)], + params=params, + description="The engine's Jobseeker Support residual reaches zero at the reg 18 non-beneficiary income cutout.", + ), + ] + + +def base_rate_node(nz, population, prefix, *, s5=False): + """Reg 17: one counterfactual over the main-benefit and tax-credit modules. + + S5 replaces the Jobseeker amount for superannuitant units with the NZ + Superannuation amount before tax (``superannuitant_units.s5_base_rate``). + """ + bridge = read(nz, "as_rate_bridge") + bindings = {row["id"]: row for row in read(nz, "axiom_rules_bindings")["bindings"]} + reg17 = bridge["outputs"][0] + declaration = bridge["superannuitant_units"]["s5_base_rate"] if s5 else reg17 + primary = declaration["primary_binding"] + target = declaration["target_input"] + components = [] + for component in declaration["components"]: + name = component["binding"] + components.append( + { + "engine_ref": binding(name), + "period": binding(name, "period"), + "variables": list( + dict.fromkeys( + term["variable"] + for term in declaration["terms"] + if term["binding"] == name + ) + ), + "input_overrides": _overrides( + component["input_overrides"], bindings[name]["entity"] + ), + } + ) + terms = [_term(row, target, primary, bindings) for row in declaration["terms"]] + extra, person = (), () + if s5: + masks = bridge["superannuitant_units"]["s5_mask_bindings"]["columns"] + extra = tuple(column["name"] for column in masks) + closure = read(nz, "axiom_input_closure") + super_path = bindings["nz_super"]["rulespec_path"] + person = tuple( + entry["input"] + for entry in closure["entries"] + if entry["rulespec_path"] == super_path and entry["entity"] == "Person" + ) + return node( + f"{prefix}.bridge.base_rate", + declaration["kernel"], + population, + sources=["rulespec_nz"], + inputs=_bridge_inputs(nz, *extra, person=person), + outputs=[owned("family", target)], + params=_counterfactual_params( + primary, _overrides(reg17["input_overrides"]), terms, components + ), + description=( + "The engine evaluates the S5 reg 17 base rate, with NZ Superannuation before tax for superannuitant units." + if s5 + else "The engine evaluates the reg 17 base rate from zero-income Jobseeker Support and the eldest-child family tax credit." + ), + ) + + +def superannuitant_masks(nz, population, prefix): + """S5's single and partnered masks crossed with the superannuitant group.""" + masks = read(nz, "as_rate_bridge")["superannuitant_units"]["s5_mask_bindings"] + return node( + f"{prefix}.bridge.superannuitant_masks", + "calibration.prepare@1", + population, + inputs=[ + slices(entity, columns) + for entity, columns in masks["required_inputs"].items() + ], + outputs=[ + owned(column["entity"], column["name"], "bool") + for column in masks["columns"] + ], + params={ + "bindings": select( + "as_rate_bridge", "json", "superannuitant_units", "s5_mask_bindings" + ), + "references": select("holdout_references"), + "references_sha256": select("holdout_references", "sha256"), + }, + ) + + +def shared_bridge_nodes(nz, population, prefix): + """Masks, the sole-parent gross rate and the cutout, once per population.""" + return [bridge_masks(nz, population, prefix), *cutout_nodes(nz, population, prefix)] + + +def group_node(nz, population, prefix, *, rewrite=False, scenario=True): + skeleton = read(nz, "transport_graph") + baseline = next(row for row in skeleton["nodes"] if row["id"] == "nz.as.inputs") + result = copy.deepcopy(baseline) + result.update(id=f"{prefix}.inputs", population=population) + result["kernel"] = ( + "transport.scenario_override@1" if rewrite else "concepts.encode_groups@1" + ) + for output in result["outputs"]: + if rewrite: + output["rewrite"] = True + else: + output.pop("rewrite", None) + if scenario: + result["params"]["knobs"] = {"scenario": "encoding_knobs", "encoding": "json"} + result["params"]["scenario_sha256"] = { + "scenario": "encoding_knobs", + "encoding": "sha256", + } + return result + + +def reporting_nodes(nz, population, prefix, scenario, *, baseline=False): + classifiers = read(nz, "reporting_classifiers") + income = classifiers["income_decile"] + income_columns = { + component["column"] + for component in income["components"] + if component["entity"] == "person" + } + income_columns.update( + component["receipt_column"] + for component in income["components"] + if "receipt_column" in component + ) + result = [ + node( + f"{prefix}.income_decile", + "reporting.income_decile@1" + if baseline + else "reporting.carry_income_decile@1", + population, + inputs=[ + slices("person", ["age", *income_columns] if baseline else ["age"]), + slices("household", ["source_household_id"]), + slices("family", ["family_type"]), + ], + outputs=[owned("family", "income_decile", "int64")], + params={ + "classifier": select("reporting_classifiers", "json", "income_decile"), + "classifier_sha256": select("reporting_classifiers", "sha256"), + "scenario": scenario, + "entities": ENTITIES, + }, + ) + ] + if not baseline: + result[0]["artifact_inputs"] = [ + { + "name": "baseline_cells", + "producer": "nz.scn.S0.income_decile", + "artifact": "baseline_cells", + } + ] + flags = { + column + for predicate in classifiers["receipt_group"]["predicates"].values() + for column in predicate["columns"] + } + result.append( + node( + f"{prefix}.receipt_group", + "reporting.receipt_group@1", + population, + inputs=[slices("person", flags), slices("family", ["family_type"])], + outputs=[owned("family", "receipt_group", "string")], + params={ + "classifier": select("reporting_classifiers", "json", "receipt_group"), + "classifier_sha256": select("reporting_classifiers", "sha256"), + "scenario": scenario, + }, + ) + ) + return result + + +def as_nodes(nz, population, prefix, scenario, *, baseline=False): + s5 = scenario == "S5" + bindings = {row["id"]: row for row in read(nz, "axiom_rules_bindings")["bindings"]} + closure = read(nz, "axiom_input_closure") + as_inputs = [ + entry["input"] + for entry in closure["entries"] + if entry["rulespec_path"] == bindings[AS_BINDING]["rulespec_path"] + ] + variables = bindings[AS_BINDING]["variables"] + judgment = { + "accommodation_supplement_non_rate_entitlement_requirements", + "accommodation_supplement_cash_assets_within_limit", + "accommodation_supplement_social_housing_exclusion_not_applies", + "accommodation_supplement_other_funding_exclusion_not_applies", + } + entitled = { + "variable": PAYMENT, + "coefficient": 1, + "entity": "family", + "column": ENTITLED, + "mask": {"entity": "family", "column": POSITIVE, "equals": True}, + } + return [ + *([superannuitant_masks(nz, population, prefix)] if s5 else []), + base_rate_node(nz, population, prefix, s5=s5), + node( + f"{prefix}.as", + "simulate.rules_by_ref@1", + population, + sources=["rulespec_nz"], + inputs=[slices("person", ["age"]), slices("family", as_inputs)], + outputs=[ + owned( + "family", variable, "int64" if variable in judgment else "float64" + ) + for variable in variables + ], + rules_binding=AS_BINDING, + params={"variables": variables}, + ), + *reporting_nodes(nz, population, prefix, scenario, baseline=baseline), + node( + f"{prefix}.positive_payment", + "calibration.prepare@1", + population, + inputs=[ + slices( + "family", + [PAYMENT, JUDGMENT, *([] if s5 else ["receipt_group"])], + ) + ], + outputs=[owned("family", POSITIVE, "bool")], + params={ + "bindings": select( + "holdout_comparator_bindings", "json", "s5" if s5 else "central" + ), + "references": select("holdout_references"), + "references_sha256": select("holdout_references", "sha256"), + }, + ), + node( + f"{prefix}.as.entitled", + "simulate.counterfactual@1", + population, + sources=["rulespec_nz"], + inputs=[ + slices("person", ["age"]), + slices("family", [*as_inputs, POSITIVE]), + ], + outputs=[owned("family", ENTITLED)], + params={ + "engine_ref": binding(AS_BINDING), + "period": binding(AS_BINDING, "period"), + "variables": [PAYMENT], + "input_overrides": [], + "output_coefficients": [entitled], + }, + description="The rounded Accommodation Supplement payment where the positive-payment conjunction holds, zero elsewhere.", + ), + node( + f"{prefix}.gap", + "takeup.gap@1", + population, + sources=["nz_holdout_facts"], + inputs=[ + slices("person", ["age"]), + slices("household", ["source_household_id"]), + slices( + "family", + [ + ENTITLED, + POSITIVE, + "family_type", + "income_decile", + "receipt_group", + ], + ), + ], + params={ + "country": "nz", + "references": select("holdout_references"), + "references_sha256": select("holdout_references", "sha256"), + "entities": ENTITIES, + "weight_entity": "household", + "annualisation_factors": select("gap_annualisation"), + "annualisation_sha256": select("gap_annualisation", "sha256"), + "scenario": scenario, + }, + ), + ] + + +def comparator_bindings(nz, *, exclude_superannuitants): + """H25's positive-payment conjunction; MC11 adds the receipt-group clause.""" + groups = read(nz, "reporting_classifiers")["receipt_group"] + values = [*groups["priority"], groups["default"]] + required = [PAYMENT, JUDGMENT] + domains = { + PAYMENT: {"kind": "nonnegative_number"}, + JUDGMENT: {"values": [-1, 0, 1]}, + } + predicates = [ + {"column": PAYMENT, "operator": "gt", "value": 0}, + {"column": JUDGMENT, "operator": "eq", "value": HOLDS}, + ] + if exclude_superannuitants: + required.append("receipt_group") + domains["receipt_group"] = {"values": values} + predicates.append( + { + "column": "receipt_group", + "operator": "in", + "value": [value for value in values if value != "superannuitant"], + } + ) + return { + "schema_version": 1, + "required_inputs": {"family": required}, + "input_domains": {"family": domains}, + "columns": [{"entity": "family", "name": POSITIVE, "predicates": predicates}], + } + + +def documents(nz=NZ): + from build_nz_transport_graph import calibration_nodes + + scenarios = read(nz, "scenarios")["scenarios"] + # An extension node on nz.as would re-key the skeleton's nz.terminal + # FILTER, so the shared bridge runs on a FILTER branch of nz.as that every + # entitlement scenario descends from. + shared = [ + boundary(SHARED_BRIDGE, "nz.as"), + *shared_bridge_nodes(nz, SHARED_BRIDGE, "nz.as"), + ] + entitlement = [ + boundary("nz.scn.{scenario}", SHARED_BRIDGE), + *as_nodes(nz, "nz.scn.{scenario}", "nz.scn.{scenario}", "{scenario}"), + ] + for scenario in scenarios: + if scenario["tier"] == "entitlement": + prefix = f"nz.scn.{scenario['id']}" + rows = [boundary(prefix, SHARED_BRIDGE)] + if scenario["id"] in {"S1", "S2", "S3"}: + rows.append(group_node(nz, prefix, prefix, rewrite=True)) + rows.extend( + as_nodes( + nz, prefix, prefix, scenario["id"], baseline=scenario["id"] == "S0" + ) + ) + else: + prefix = f"nz.v.{scenario['id']}" + resource = ( + "money_normalization_hold_fixed" + if scenario["id"] == "VHF" + else "money_normalization" + ) + rows = [ + boundary(prefix, "nz.open"), + *calibration_nodes(prefix, prefix, money_resource=resource), + ] + for row in rows: + if row["kernel"] == "money.normalize@1": + row["params"]["profile_selection"] = { + "scenario": "knobs", + "encoding": "json", + } + calibrated = next( + row["id"] for row in rows if row["kernel"] == "calibrate.ordered_adam@1" + ) + population = prefix + ".housing" + rows.extend( + [ + boundary(population, calibrated), + group_node(nz, population, prefix), + *shared_bridge_nodes(nz, population, prefix), + *as_nodes(nz, population, prefix, scenario["id"]), + ] + ) + scenario["nodes"] = rows + scenarios_document = {**read(nz, "scenarios"), "scenarios": scenarios} + conventions = copy.deepcopy(scenarios_document["gap_conventions"]) + conventions["reporting_cells"]["measure"] = ENTITLED + scenarios_document["gap_conventions"] = conventions + return { + "entitlement_graph": { + "schema_version": 1, + "nodes": shared, + "scenario_nodes": entitlement, + "scenario_gap": "nz.scn.{scenario}.gap", + "variant_gap": "nz.v.{variant}.gap", + "bands": { + "id": "nz.as.bands", + "population": "nz.terminal", + "baseline_scenario": "S0", + }, + "package": {"id": "nz.package", "artifact_name": "bands"}, + "checkpoints": ["nz.as.bands"], + }, + "gap_annualisation": { + "msd_accommodation_supplement_recipients_national": 1, + "msd_annual_report_accommodation_assistance_expenditure": 52, + }, + "holdout_comparator_bindings": { + "schema_version": 1, + "central": comparator_bindings(nz, exclude_superannuitants=True), + "s5": comparator_bindings(nz, exclude_superannuitants=False), + }, + "scenarios": scenarios_document, + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--check", action="store_true") + args = parser.parse_args() + differs = [] + for name, document in documents().items(): + path = NZ / f"{name}.json" + text = json.dumps(document, indent=2) + "\n" + if args.check: + if not path.exists() or path.read_text() != text: + differs.append(str(path.relative_to(ROOT))) + else: + path.write_text(text) + if differs: + raise SystemExit( + "Generated NZ entitlement resources differ: " + ", ".join(differs) + ) + print( + "NZ entitlement resources match." + if args.check + else "Wrote NZ entitlement resources." + ) + + +if __name__ == "__main__": + main() diff --git a/tools/build_nz_transport_graph.py b/tools/build_nz_transport_graph.py new file mode 100644 index 0000000000..121e2dc1a6 --- /dev/null +++ b/tools/build_nz_transport_graph.py @@ -0,0 +1,913 @@ +#!/usr/bin/env python3 +"""Generate NZ transport declarations without reading donor records. + +The graph leaves the three money quantile producers unresolved and names +them as pending. It declares the executable wiring the shared kernels support. +""" + +from __future__ import annotations + +import argparse +import copy +import hashlib +import json +from functools import cache +from pathlib import Path + +from microcosm.build.transport.codecs import ( + DONOR_SOURCE_CODEC, + FACTS_SOURCE_CODEC, + RULESPEC_SOURCE_CODEC, +) +from microcosm.build.transport.terminal_kernels import EXPORT_SOURCE_CODEC +from microcosm.frame import EntitySchema +from microcosm.frame.concepts import ( + CONCEPT_FRAME_SCHEMA, + SOURCE_HOUSEHOLD_ID_COLUMN, + TransportRule, + concept, + concept_schema_sha256, +) +from microcosm.frame.unit_construction import BenefitUnitRule + +ROOT = Path(__file__).resolve().parents[1] +NZ = ROOT / "packages/microcosm-build/src/microcosm/build/nz" +ENTITIES = ("person", "household", "family") +ENTITLED_PAYMENT = "accommodation_supplement_entitled_weekly_payment" + + +def read(name): + return json.loads((NZ / f"{name}.json").read_text()) + + +def select(resource, encoding="json", *path): + return {"resource": resource, "path": list(path), "encoding": encoding} + + +def document(name, resource): + return { + name: select(resource), + f"{name}_sha256": select(resource, "sha256"), + } + + +@cache +def unit_schema(): + rule = BenefitUnitRule.from_spec(read("benefit_unit_rule")) + return rule, EntitySchema( + group_entities=(*CONCEPT_FRAME_SCHEMA.group_entities, rule.entity) + ) + + +@cache +def automatic_columns(): + """Read the same auto-carried identity fields as CLI preparation.""" + _, schema = unit_schema() + return { + schema.person_entity: { + schema.person_id_column, + *(schema.membership_column(group) for group in schema.group_entities), + }, + **{group: {schema.id_column(group)} for group in schema.group_entities}, + } + + +def slice_(entity, columns): + rule, schema = unit_schema() + names = list( + dict.fromkeys( + column for column in columns if column not in automatic_columns()[entity] + ) + ) + if not names: + if entity == schema.person_entity: + names = [concept("fact:person.age").name] + elif entity == rule.entity: + names = [rule.head_column] + else: + names = [SOURCE_HOUSEHOLD_ID_COLUMN] + return {"entity": entity, "columns": names} + + +def owned(entity, column, dtype=None, **kwargs): + return { + "entity": entity, + "column": column, + **({"dtype": dtype} if dtype else {}), + **kwargs, + } + + +def edge(name, producer, artifact=None): + return {"name": name, "producer": producer, "artifact": artifact or name} + + +def node(id, kernel, **kwargs): + return {"id": id, "kernel": kernel, **kwargs} + + +def mapping_document(): + return json.loads( + ( + ROOT + / "packages/microcosm-frame/src/microcosm/frame/adapters/axiom_concept_mappings/nz.json" + ).read_text() + ) + + +def raw_slices(): + """Read maintained concepts and the unit builder's structural roster.""" + columns = { + "person": [ + "person_id", + "person_household_id", + "person_family_id", + "age", + "sex", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + "take_up_seed", + ], + "household": [ + "household_id", + "reference_person_id", + "source_household_id", + "donor_support_stratum", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + ], + "family": [ + "family_id", + "family_household_id", + "family_head_person_id", + "family_source_household_id", + ], + } + paths = set(read("axiom_input_closure")["rulespec_paths"]) + for binding in mapping_document()["bindings"]: + if binding["module"] in paths: + for id in binding["concepts"]: + item = concept(id) + if item.transport is not TransportRule.DROP: + columns[item.entity].append(item.name) + return [slice_(entity, names) for entity, names in columns.items()] + + +def closure_inputs(binding, entity): + bindings = {row["id"]: row for row in read("axiom_rules_bindings")["bindings"]} + path = bindings[binding]["rulespec_path"] + return [ + entry["input"] + for entry in read("axiom_input_closure")["entries"] + if entry["rulespec_path"] == path and entry["entity"] == entity + ] + + +def closure_entry_dtype(entry, mapping): + """Derive the graph dtype from the encoder's declared operation. + + Defaults follow apply_defaults; mapping and state values follow _apply, + _group_values and _state_values in frame/concept_mapping.py. Refuse an + unreviewed transform rather than inventing a narrower output type. + """ + if entry["class"] == "defaulted": + dtype = {bool: "bool", int: "int64", float: "float64"}.get(type(entry["value"])) + if dtype is None: + raise ValueError(f"Unsupported default dtype for {entry['input']!r}.") + return dtype + if entry.get("encoded_by") == "state_binding": + dtype = "bool" + group_rule = entry["state_binding"]["group_rule"] + elif entry.get("encoded_by") == "concept_binding": + matches = [ + binding + for binding in mapping["bindings"] + if binding["module"] == entry["rulespec_path"] + and binding["engine_entity"] == entry["entity"] + and binding["engine_input"] == entry["input"] + ] + if len(matches) != 1: + raise ValueError(f"Input {entry['input']!r} needs one concept binding.") + binding = matches[0] + transform = binding["transform"]["kind"] + if transform == "identity": + dtype = { + "bool": "bool", + "int": "int64", + "float": "float64", + "str": "string", + }[concept(binding["concepts"][0]).dtype] + elif transform in { + "predicate", + "relationship_role", + "positive", + "take_up_threshold", + "unit_composition", + }: + dtype = "bool" + elif transform == "coresident_child_count": + dtype = "int64" + elif transform in { + "share", + "sum", + "scaled_sum", + "signed_part", + "product", + "allocate_to_reference_person", + "scale", + "fraction", + }: + dtype = "float64" + else: + raise ValueError( + f"Input {entry['input']!r} has unsupported transform {transform!r}." + ) + group_rule = binding.get("group_rule") + else: + raise ValueError(f"Input {entry['input']!r} has no encoder-owned dtype.") + if group_rule == "any_member": + return "bool" + if group_rule == "sum_over_members": + if dtype in {"bool", "int64"}: + return "int64" + if dtype != "float64": + raise ValueError(f"Input {entry['input']!r} cannot sum {dtype} values.") + elif group_rule == "allocate_to_reference_unit": + return "float64" + elif group_rule not in {None, "reference_member", "household_value"}: + raise ValueError( + f"Input {entry['input']!r} has unsupported group rule {group_rule!r}." + ) + return dtype + + +def encoder_outputs(paths, entity): + """Declare every closure-owned input with its exact portable output dtype.""" + mapping = mapping_document() + dtypes = {} + for entry in read("axiom_input_closure")["entries"]: + if ( + entry["rulespec_path"] in paths + and entry["entity"] == entity + and entry.get("encoded_by") != "graph_node" + ): + name = entry["input"] + dtype = closure_entry_dtype(entry, mapping) + if name in dtypes and dtypes[name] != dtype: + raise ValueError(f"Input {name!r} has conflicting encoder dtypes.") + dtypes[name] = dtype + frame_entity = {"Person": "person", "Family": "family"}[entity] + return [owned(frame_entity, name, dtype) for name, dtype in sorted(dtypes.items())] + + +def calibration_nodes( + population="nz.central", prefix="nz", money_resource="money_normalization" +): + """Build one complete money/engine/receipt/calibration branch.""" + resources = read("money_normalization") + normalized = resources["columns"] + central = read("scenarios")["central_knobs"] + bindings = {row["id"]: row for row in read("axiom_rules_bindings")["bindings"]} + paths = [ + bindings[name]["rulespec_path"] + for name in ("main_benefits_entitlement", "main_benefits_rates", "nz_super") + ] + rows = [ + node( + f"{prefix}.money.normalize", + "money.normalize@1", + population=population, + sources=["nz_chronicle_facts"], + inputs=[slice_(entity, names) for entity, names in normalized.items()], + outputs=[ + owned(entity, column, "float64", rewrite=True) + for entity, names in normalized.items() + for column in names + ] + + [ + owned(entity, f"{column}{resources['cents_suffix']}", "int64") + for entity, names in normalized.items() + for column in names + ], + params={ + **document("declaration", money_resource), + **document("factor_context", "reference_aging"), + "profile_selection": json.dumps( + central, sort_keys=True, separators=(",", ":") + ), + }, + ), + node( + f"{prefix}.encode.person", + "concepts.encode@1", + population=population, + inputs=raw_slices()[:2], + outputs=encoder_outputs(paths, "Person"), + params={ + **document("mapping", "concept_mapping"), + **document("closure", "axiom_input_closure"), + "rulespec_paths": paths, + }, + ), + ] + for short, binding in ( + ("entitlement", "main_benefits_entitlement"), + ("super", "nz_super"), + ): + variables = bindings[binding]["variables"] + rows.append( + node( + f"{prefix}.benefits.{short}", + "simulate.rules_by_ref@1", + population=population, + sources=["rulespec_nz"], + rules_binding=binding, + inputs=[slice_("person", closure_inputs(binding, "Person"))], + outputs=[ + owned( + "person", + column, + "int64" if column.startswith("entitled_") else "float64", + ) + for column in variables + ], + params={"variables": variables}, + ) + ) + gross = copy.deepcopy(read("benefit_gross_up")["nodes"]) + for row in gross: + row["id"] = row["id"].replace("nz.", f"{prefix}.", 1) + row["population"] = population + rows.extend(gross[:-1]) + receipt = read("receipt_contract")["receipts"] + receipt_inputs = [receipt["seed_column"], "age"] + for program in receipt["programs"]: + receipt_inputs.extend(program["judgment_columns"]) + receipt_inputs.append(program["payment_column"]) + rows.append( + node( + f"{prefix}.takeup.assign", + "takeup.assign@1", + population=population, + inputs=[ + slice_( + entity, [*names, *(receipt_inputs if entity == "person" else [])] + ) + for entity, names in read("calibration_bindings")[ + "required_inputs" + ].items() + ], + outputs=[ + owned("person", program["output"], "bool") + for program in receipt["programs"] + ], + params={ + "receipt_contract": select("receipt_contract", "json", "receipts"), + "receipt_contract_sha256": select("receipt_contract", "sha256"), + }, + artifact_inputs=[edge("surface", "nz.facts.precal")], + ) + ) + rows.append(gross[-1]) + prep = read("calibration_bindings") + required = { + entity: list(names) for entity, names in prep["required_inputs"].items() + } + for program in receipt["programs"]: + required["person"].append(program["output"]) + outputs = [ + owned( + entry["entity"], + entry["name"], + "int64" + if "constant" in entry or entry in prep.get("roster_counts", ()) + else "bool", + ) + for entry in [*prep["columns"], *prep.get("roster_counts", ())] + ] + rows.append( + node( + f"{prefix}.targets.prepare", + "calibration.prepare@1", + population=population, + inputs=[slice_(entity, names) for entity, names in required.items()], + outputs=outputs, + params={ + "bindings": select("calibration_bindings"), + **document("references", "target_references"), + }, + ) + ) + rows.append( + node( + f"{prefix}.targets.compile", + "targets.compile@1", + population=population, + sources=["nz_chronicle_facts"], + params={"country": "nz", **document("references", "target_references")}, + ) + ) + problem_inputs = {entity: [] for entity in ENTITIES} + for output in outputs: + problem_inputs[output["entity"]].append(output["column"]) + problem_inputs["person"].extend( + program["output"] for program in receipt["programs"] + ) + rows.append( + node( + f"{prefix}.targets.problem", + "targets.problem@1", + population=population, + inputs=[slice_(entity, names) for entity, names in problem_inputs.items()], + params={"entities": list(ENTITIES), "weight_entity": "household"}, + artifact_inputs=[ + edge("surface", f"{prefix}.targets.compile"), + edge("preparation", f"{prefix}.targets.prepare"), + ], + ) + ) + rows.append( + node( + f"{prefix}.calibrate", + "calibrate.ordered_adam@1", + structural="reweight", + base=population, + mass="free", + inputs=[slice_("household", ["household_id"])], + weights={"entity": "household", "to_kind": "calibrated", "mass": "free"}, + params={ + name: select("calibration_settings", "value", name) + for name in ( + "epochs", + "learning_rate", + "mass", + "max_weight_ratio", + "weight_anchor", + ) + }, + artifact_inputs=[edge("problem", f"{prefix}.targets.problem")], + ) + ) + return rows + + +def as_encoder(population="nz.as", prefix="nz.as"): + bindings = {row["id"]: row for row in read("axiom_rules_bindings")["bindings"]} + path = bindings["accommodation_supplement"]["rulespec_path"] + outputs = encoder_outputs([path], "Family") + inputs = raw_slices() + inputs[0]["columns"].extend( + program["output"] + for program in read("receipt_contract")["receipts"]["programs"] + ) + inputs[1]["columns"].extend(["as_area", "as_area_alt"]) + return node( + f"{prefix}.inputs", + "concepts.encode_groups@1", + population=population, + inputs=inputs, + outputs=outputs, + params={ + **document("mapping", "concept_mapping"), + **document("closure", "axiom_input_closure"), + **document("unit_rule", "benefit_unit_rule"), + "engine_entity": "Family", + "rulespec_paths": [path], + "knobs": select("as_encoding"), + "scenario_sha256": select("as_encoding", "sha256"), + }, + ) + + +def documents(): + mapping = mapping_document() + normal = read("money_normalization") + hold = copy.deepcopy(normal) + hold["description"] = ( + "The hold-fixed sensitivity converts the same donor columns to NZD and holds all four index families fixed at factor one. It uses the central reference-aging profile." + ) + hold["status"] = ( + "The VHF scenario selects this sibling declaration in its own normalization node." + ) + hold["index_family_factors"] = { + name: { + "identity": True, + "reason": "The declared hold-fixed sensitivity holds this donor index family at factor one.", + } + for name in normal["index_family_factors"] + } + support_definition = copy.deepcopy(read("atomic_geography_support")) + modal = { + row["ta_code"]: str(row["modal_area"]) + for row in read("as_area_crosswalk")["rows"] + } + support_definition["columns"]["as_area_alt"] = { + "kind": "code", + "source": "as_area_crosswalk.json modal_area", + "vintage": "ta_2025", + "relation": "best_fit", + } + for row in support_definition["rows"]: + row["codes"]["as_area_alt"] = modal[row["codes"]["ta_code"]] + assignment = { + "version": 1, + "identity": ["household_id"], + "stream": ["sha256-u53-v1", "nz-joint-geography", 0, 21], + "outputs": { + "area": "nz_atomic_area", + "system": "nz_area_system", + "basis": "nz_area_basis", + }, + "systems": [ + { + "id": "nz-joint", + "level": "ta_region_as_area", + "code_system": "stats_nz_joint_ta_regc_as", + "vintage": "ta2026_regc2025_au2017", + "source": "nz_chronicle_facts", + "selector": {}, + "constraints": [], + "observed_area": None, + "stages": [{"level": "area", "weight": "population"}], + "layers": [ + { + "input": input_, + "output": output, + "vintage": "ta2026_regc2025_au2017", + "relation": "exact", + "source": "atomic_geography_support.json", + } + for input_, output in ( + ("ta_code", "ta_code"), + ("region_code", "household_region_code"), + ("as_area", "as_area"), + ("as_area_alt", "as_area_alt"), + ) + ], + } + ], + } + rule = document("unit_rule", "benefit_unit_rule") + rows = [ + node( + "nz.create", + "transport.create@1", + structural="create", + sources=["populace_us_donor", "nz_chronicle_facts"], + params={ + "donor_source": "populace_us_donor", + "facts_source": "nz_chronicle_facts", + "donor_sha256": select("transport_inputs", "value", "donor", "sha256"), + "donor_size": select( + "transport_inputs", "value", "donor", "size_bytes" + ), + "donor_pin_sha256": select("source_stages", "sha256"), + **rule, + **document("mass_reference", "mass_references"), + "country": "nz", + "concept_schema_sha256": concept_schema_sha256(), + "seed_stream": "nz:takeup:v0", + }, + ), + node( + "nz.open", + "transport.boundary@1", + structural="filter", + base="nz.create", + inputs=[slice_("person", ["age"])], + ), + node( + "nz.facts.precal", + "targets.compile@1", + population="nz.open", + sources=["nz_chronicle_facts"], + params={"country": "nz", **document("references", "precal_references")}, + ), + node( + "nz.geo.support", + "geography.support_from_facts@1", + population="nz.open", + params={ + "definition": select("transport_atomic_geography_support"), + "definition_sha256": select( + "transport_atomic_geography_support", "sha256" + ), + "system": "nz-joint", + }, + artifact_inputs=[edge("surface", "nz.facts.precal")], + ), + ] + geo_params = { + "definition": select("geography_assignment"), + "stream": select("geography_assignment", "value", "stream"), + } + support = [edge("nz-joint", "nz.geo.support", "support")] + assigned = list(assignment["outputs"].values()) + derived = [layer["output"] for layer in assignment["systems"][0]["layers"]] + rows.extend( + [ + node( + "nz.geo.assign", + "geography.assign_atomic@1", + population="nz.open", + inputs=[slice_("household", ["household_id"])], + outputs=[owned("household", column, "string") for column in assigned], + params=geo_params, + artifact_inputs=support, + ), + node( + "nz.geo.derive", + "geography.derive@1", + population="nz.open", + inputs=[slice_("household", assigned)], + outputs=[owned("household", column, "string") for column in derived], + params=geo_params, + artifact_inputs=support, + ), + node( + "nz.geo.person", + "geography.person_location@1", + population="nz.open", + inputs=[ + slice_("household", ["household_region_code"]), + slice_("person", ["person_id", "person_household_id"]), + ], + outputs=[owned("person", "region_code", "string")], + params={ + "columns": json.dumps( + {"household_region_code": "region_code"}, + sort_keys=True, + separators=(",", ":"), + ) + }, + ), + node( + "nz.geo.gate", + "geography.gate@1", + population="nz.open", + inputs=[slice_("household", [*assigned, *derived])], + params=geo_params, + artifact_inputs=support, + ), + node( + "nz.units.attributes", + "transport.unit_attributes@1", + population="nz.open", + inputs=[ + slice_( + "person", + [ + "person_id", + "person_household_id", + "person_family_id", + "age", + "partner_person_id", + "parent_1_person_id", + "parent_2_person_id", + "usual_weekly_hours", + ], + ), + slice_("household", ["household_id", "reference_person_id"]), + slice_( + "family", + ["family_id", "family_household_id", "family_head_person_id"], + ), + ], + outputs=[ + owned("family", "family_type", "string"), + owned("family", "n_dependent_children", "int64"), + owned("family", "is_sole_parent", "bool"), + owned("family", "is_partnered", "bool"), + owned("family", "is_single", "bool"), + owned("family", "n_adults", "int64"), + owned("family", "youngest_dependent_child_age", "Int64"), + owned("household", "n_family_units", "int64"), + ], + params=rule, + ), + node( + "nz.central", + "transport.boundary@1", + structural="filter", + base="nz.open", + inputs=[slice_("person", ["age"])], + ), + ] + ) + rows.extend(calibration_nodes()) + rows.extend( + [ + node( + "nz.as", + "transport.boundary@1", + structural="filter", + base="nz.calibrate", + inputs=[slice_("person", ["age"])], + ), + as_encoder(), + node( + "nz.terminal", + "transport.boundary@1", + structural="filter", + base="nz.as", + inputs=[slice_("person", ["age"])], + ), + ] + ) + export = read("export_contract") + roster = {entity: [] for entity in ENTITIES} + for entity, names in export["_schema"]["structural_columns"].items(): + roster[entity].extend(names) + roster["person"].extend(["age", "sex"]) + roster["household"].extend( + [ + "source_household_id", + "donor_support_stratum", + "household_region_code", + "tenure", + "rent", + "mortgage_interest", + "mortgage_principal", + "property_tax", + ] + ) + roster["family"].append("family_source_household_id") + for row in rows: + if row["kernel"] in { + "money.normalize@1", + "concepts.encode@1", + "concepts.encode_groups@1", + "takeup.assign@1", + }: + for output in row.get("outputs", ()): + if row["kernel"] != "money.normalize@1" or output.get("rewrite"): + roster[output["entity"]].append(output["column"]) + roster = { + entity: sorted(set(names) - automatic_columns()[entity]) + for entity, names in roster.items() + } + export["optional"] = sorted( + set(export["optional"]) + | {name for names in roster.values() for name in names} + - set(export["required"]) + ) + # The entitlement graph's gated payment is a formula output like the + # engine's own; the closed export never carries it. + export["formula_owned_excluded"] = sorted( + set(export["formula_owned_excluded"]) | {ENTITLED_PAYMENT} + ) + export["entity_slices"] = {"export": roster, "gates": roster} + export["_description"] = ( + "The graph enforces this closed entity-qualified roster at composition. The export and terminal gate slices retain replay inputs and assigned receipt flags and exclude formula outputs, scratch cents and reporting state. Frame projection supplies structural identifiers and memberships automatically." + ) + export["_slice_requirement"] = ( + "The graph selects export_contract for opt-in composition validation and declares its exact export and terminal gate slices." + ) + population = [slice_(entity, names) for entity, names in roster.items()] + rows.extend( + [ + node( + "nz.calibration.diagnostics", + "diagnostics.calibration@1", + population="nz.terminal", + inputs=[slice_("household", ["household_id"])], + params={"weight_entity": "household"}, + artifact_inputs=[ + edge("problem", "nz.targets.problem"), + edge("solution", "nz.calibrate"), + edge("result", "nz.calibrate"), + edge("surface", "nz.targets.compile"), + ], + ), + node( + "nz.gates.terminal", + "gates.battery@1", + population="nz.terminal", + inputs=population, + params={ + "country": "nz", + **document("gates", "gates"), + "phase": "terminal", + "release_candidate": False, + "entities": list(ENTITIES), + "weight_entity": "household", + }, + artifact_inputs=[ + edge("problem", "nz.targets.problem"), + edge("solution", "nz.calibrate"), + edge("diagnostics", "nz.calibration.diagnostics"), + edge("surface", "nz.targets.compile"), + ], + ), + node( + "nz.export.prepare", + "export.prepare@1", + population="nz.terminal", + inputs=population, + params={ + "entities": list(ENTITIES), + "weight_entity": "household", + "time_period": select( + "export_contract", "value", "_period", "dataset_time_period" + ), + "bindings": select("export_replay_bindings"), + }, + artifact_inputs=[edge("gate_report", "nz.gates.terminal")], + ), + node( + "nz.export.readback", + "export.readback@1", + population="nz.terminal", + sources=["nz_exported_dataset"], + artifact_inputs=[edge("export_descriptor", "nz.export.prepare")], + ), + node( + "nz.package", + "transport.package@1", + population="nz.terminal", + params={"bindings": {"prepared": "engine_refs"}}, + artifact_inputs=[ + edge("export_readback", "nz.export.readback"), + edge("gate_report", "nz.gates.terminal"), + edge("diagnostics", "nz.calibration.diagnostics"), + edge("surface", "nz.targets.compile"), + ], + ), + ] + ) + graph = { + "schema_version": 1, + "country": "nz", + "description": "The NZ transport declaration retains named pending money producers. The graph makes no estimate or publication claim.", + "export_contract": "export_contract", + "sources": [ + {"name": name, "codec": codec} + for name, codec in ( + ("populace_us_donor", DONOR_SOURCE_CODEC), + ("nz_chronicle_facts", FACTS_SOURCE_CODEC), + ("nz_holdout_facts", FACTS_SOURCE_CODEC), + ("rulespec_nz", RULESPEC_SOURCE_CODEC), + ("nz_exported_dataset", EXPORT_SOURCE_CODEC), + ) + ], + "nodes": rows, + "endpoints": { + "geography": "nz.geo.gate", + "calibration": "nz.calibrate", + "terminal": ["nz.export.prepare", "nz.package"], + }, + "pending_outputs": [ + "w4 support, release-input coverage and weight audit evidence", + "r2c income stand-in and reconciliation", + "P1 earnings, Census rent and liquid-assets quantile producers", + ], + } + return { + "export_replay_bindings.json": { + "export_contract_sha256": hashlib.sha256( + (json.dumps(export, indent=2, ensure_ascii=False) + "\n").encode() + ).hexdigest(), + "axiom_input_closure_sha256": hashlib.sha256( + (NZ / "axiom_input_closure.json").read_bytes() + ).hexdigest(), + }, + "as_encoding.json": { + "rent_allocation": "reference_unit", + "asset_test": True, + "area_column": "as_area", + "rent_factor": 1, + }, + "transport_inputs.json": { + "donor": read("source_stages")["stages"][0]["artifacts"][0] + }, + "transport_atomic_geography_support.json": support_definition, + "concept_mapping.json": mapping, + "geography_assignment.json": assignment, + "money_normalization_hold_fixed.json": hold, + "export_contract.json": export, + "transport_graph.json": graph, + } + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--check", action="store_true") + args = parser.parse_args() + for name, value in documents().items(): + target = NZ / name + rendered = json.dumps(value, indent=2, ensure_ascii=False) + "\n" + if args.check: + if not target.exists() or target.read_text() != rendered: + raise SystemExit(f"Generated resource is stale: {target}") + else: + target.write_text(rendered) + print("NZ transport graph resources match the generator.") + + +if __name__ == "__main__": + main() diff --git a/tools/generate_nz_target_references.py b/tools/generate_nz_target_references.py index 6b8eba7cf5..a9b434b707 100644 --- a/tools/generate_nz_target_references.py +++ b/tools/generate_nz_target_references.py @@ -882,14 +882,14 @@ def _holdout_references(inventory): ), "measure": "accommodation_supplement_positive_payment_indicator", "period": "2026-06", - "notes": "H1 compares the June 2026 national recipient stock with family units whose accommodation_supplement_rounded_weekly_payment exceeds zero. The declared positive-payment indicator counts each unit once, with factor 1; it never sums dollars. The national fact avoids a Work and Income region to Stats NZ region bridge. MC5 holds this comparison outside calibration.", + "notes": "H1 compares the June 2026 national recipient stock with family units whose accommodation_supplement_entitled_weekly_payment exceeds zero: the rounded payment where the engine judges the non-rate entitlement requirements to hold and, outside S5, the unit is not superannuitant. The declared positive-payment indicator counts each unit once, with factor 1; it never sums dollars. The national fact avoids a Work and Income region to Stats NZ region bridge. MC5 holds this comparison outside calibration.", } ) recipients["metadata"].update( { "activation_status": "active", "annualisation_factor": "1", - "indicator_input_column": "accommodation_supplement_rounded_weekly_payment", + "indicator_input_column": "accommodation_supplement_entitled_weekly_payment", "indicator_operator": "positive", "indicator_threshold": "0", "measurement_basis": "National positive-payment recipient count; June 2026 snapshot stock, not annual recipients or dollars.", @@ -912,8 +912,8 @@ def _holdout_references(inventory): }, ) ), - "measure": "accommodation_supplement_rounded_weekly_payment", - "notes": "H2 annualises accommodation_supplement_rounded_weekly_payment by 52 and compares model dollars with the historical fiscal-year 2024/25 Accommodation Assistance line in MSD Annual Report 2025. The published appropriation may cover more than Accommodation Supplement; this comparator makes no AS-only scope claim and never uprates the historical observation. The selector pins msd.benefit_expenses.fy2024 because the feed repeats this amount in another record set.", + "measure": "accommodation_supplement_entitled_weekly_payment", + "notes": "H2 annualises accommodation_supplement_entitled_weekly_payment by 52 and compares model dollars with the historical fiscal-year 2024/25 Accommodation Assistance line in MSD Annual Report 2025. The published appropriation may cover more than Accommodation Supplement; this comparator makes no AS-only scope claim and never uprates the historical observation. The selector pins msd.benefit_expenses.fy2024 because the feed repeats this amount in another record set.", } ) expenditure["metadata"].update(