diff --git a/changelog.d/sale-expense-share-split.fixed.md b/changelog.d/sale-expense-share-split.fixed.md new file mode 100644 index 0000000000..b1b35caba9 --- /dev/null +++ b/changelog.d/sale-expense-share-split.fixed.md @@ -0,0 +1 @@ +Value share-like capital by asset type in every means test. Directly held shares, and any `corporate_wealth` a dataset does not itemise, take the 10% sale-expense deduction. Unit trusts count at full value (ADM H1673-H1674), as does the survey's combined unit and investment trust bucket, an approximation for its investment trusts. Stocks and shares ISAs count at their full withdrawal value, a reading that rests on ADM H1656 saying nothing about costs of sale. diff --git a/changelog.d/uc-capital-sale-expenses.fixed.md b/changelog.d/uc-capital-sale-expenses.fixed.md index 02d0588143..102b57f784 100644 --- a/changelog.d/uc-capital-sale-expenses.fixed.md +++ b/changelog.d/uc-capital-sale-expenses.fixed.md @@ -1 +1 @@ -Value Universal Credit, Housing Benefit, Income Support, income-based JSA, income-related ESA and Pension Credit capital at market value less 10% where a sale would incur expenses and less any debt secured on the asset, as UC Regs 2013 reg. 49(1) and its legacy equivalents require. The 10% applies to land, property and share-like capital (share_like_capital), not to cash savings; share-like capital also holds unit trusts, which have no costs of sale, and in datasets built before the private pension split it holds pension wealth, so the deduction reaches those too until the data separate them. Adds secured-debt inputs for other residential property, non-residential property and land, and the council tax reduction formula deducts the debt secured on land from the land on its own household route. Each programme rounds a fraction of a penny in its capital calculations as its regulations require: to the nearest penny for Universal Credit (UC Regs 2013 reg. 6(1)) and Housing Benefit, and down for the legacy benefits and Pension Credit. The model works out a Lifetime ISA's surrender value from its balance and rounds it under the same rule, and keeps explicit Lifetime ISA capital inputs and reformed valuation formulas. +Value Universal Credit, Housing Benefit, Income Support, income-based JSA, income-related ESA and Pension Credit capital at market value less 10% where a sale would incur expenses and less any debt secured on the asset, as UC Regs 2013 reg. 49(1) and its legacy equivalents require. The 10% applies to land, property, directly held shares and all of a `corporate_wealth` that the dataset does not itemise, not to cash savings. Unitemised `corporate_wealth` can still fold in unit trusts, ISAs and, on datasets built before private pension wealth was split out, non-defined-benefit pension wealth. Adds secured-debt inputs for other residential property, non-residential property and land, and the council tax reduction formula deducts the debt secured on land from the land on its own household route. Each programme rounds a fraction of a penny in its capital calculations as its regulations require: to the nearest penny for Universal Credit (UC Regs 2013 reg. 6(1)) and Housing Benefit, and down for the legacy benefits and Pension Credit. The model works out a Lifetime ISA's surrender value from its balance and rounds it under the same rule, and keeps explicit Lifetime ISA capital inputs and reformed valuation formulas. diff --git a/docs/book/assumptions/isa-inputs-and-capital-flows.md b/docs/book/assumptions/isa-inputs-and-capital-flows.md index c6e0836479..c926b8cba1 100644 --- a/docs/book/assumptions/isa-inputs-and-capital-flows.md +++ b/docs/book/assumptions/isa-inputs-and-capital-flows.md @@ -114,21 +114,22 @@ shares ISA balances in their own benefit unit, through `cash_isa_countable_capital` and `stocks_and_shares_isa_countable_capital` in its `person_sources`, and excludes a dependant's balance, a child's junior ISA among them. The formulas subtract a household's counted balances from `cash_isa` -and `share_like_capital` before they allocate the remainder between benefit -units. Where the balances sum to less than the total the model holds for the -year, the remainder stays in the pool. Where their stored sum exceeds the total, -the model scales them to sum to the total exactly: it rounds each proportional -share down to a whole step of the total's float32 spacing and gives the steps -left over, one each, to the members whose shares lost most in rounding. The pool -then keeps nothing of that total; for totals under £268 million, each holding -passes a capital limit only where its proportional share does; and a sole holder -whose balance reaches the total counts exactly the total. For stocks and shares -ISAs the model takes the smaller of `stocks_and_shares_isa` and -`share_like_capital` as the total. Data that store only household totals hold no -balances, so the pool keeps the whole total. The formulas count a balance only -while the programme's `sources` lists the household source that includes it, so -a reform that drops `cash_isa` or `share_like_capital` from `sources` drops the -balances with it. For a Universal Credit unit that reports its capital +and `share_like_capital_without_sale_expenses` before they allocate the +remainder between benefit units. Where the balances sum to less than the total +the model holds for the year, the remainder stays in the pool. Where their +stored sum exceeds the total, the model scales them to sum to the total exactly: +it rounds each proportional share down to a whole step of the total's float32 +spacing and gives the steps left over, one each, to the members whose shares +lost most in rounding. The pool then keeps nothing of that total; for totals +under £268 million, each holding passes a capital limit only where its +proportional share does; and a sole holder whose balance reaches the total +counts exactly the total. For stocks and shares ISAs the model takes the smaller +of `stocks_and_shares_isa` and `share_like_capital` as the total. Data that +store only household totals hold no balances, so the pool keeps the whole total. +The formulas count a balance only while the programme's `sources` lists the +household source that includes it, so a reform that drops `cash_isa` or +`share_like_capital_without_sale_expenses` from `sources` drops the balances +with it. For a Universal Credit unit that reports its capital (`benunit_reported_capital` or `uc_reported_capital`, zero or more), the formula leaves the unit's claimant's and partner's ISAs in the pool and subtracts the report, as it does for their company holdings. A nonnegative @@ -146,10 +147,11 @@ replaces covered components rather than adding them again. For example, £5,000 savings and a £3,000 ordinary cash ISA give £8,000 UC capital. [UC regulation 72](https://www.legislation.gov.uk/uksi/2013/376/regulation/72) then gives eight £4.35 monthly tariff units, or £34.80 a month. Stocks-and-shares -ISA holdings remain within `share_like_capital`. The separate existing -`lifetime_isa_countable_capital` valuation is unchanged. It does not gain -transaction-level first-home or terminal-illness valuation from the new flow -inputs. +ISA holdings remain within `share_like_capital`, in its part without sale +expenses, which every means test counts at withdrawal value. The separate +existing `lifetime_isa_countable_capital` valuation is unchanged. It does not +gain transaction-level first-home or terminal-illness valuation from the new +flow inputs. Population estimates depend on the input balances, reported-capital overrides, benefit take-up and calibrated weights as well as the capital diff --git a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/person_sources.yaml b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/person_sources.yaml index b3c563348f..ba64a22c41 100644 --- a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/person_sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/person_sources.yaml @@ -14,7 +14,8 @@ description: > investments, and the named child owns a junior ISA's investments (Individual Savings Account Regulations 1998 reg. 4(6)(a) and reg. 2B(c)). The formulas subtract each bounded ISA balance from its household source (`cash_isa`, - `share_like_capital`) and count it in the holder's unit. When a household's + `share_like_capital_without_sale_expenses`) and count it in the holder's + unit. When a household's balances exceed its total, the model scales them to sum to the total exactly, rounding each share down or up to a whole float32 step of the total. When a reform removes a household source from `sources`, the formulas diff --git a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sale_expenses/sources.yaml index 1f973f433f..1ef23e854e 100644 --- a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sale_expenses/sources.yaml @@ -6,15 +6,17 @@ description: > `other_residential_property_value` and `non_residential_property_value` are listed. `savings` is not listed: a bank or building society account is valued at its balance, and the costs of withdrawing money are not costs of - sale (DMG 52620-52623 and 52685). `share_like_capital` (`corporate_wealth`, - or its itemised components where they exceed it) is listed because shares - are valued less 10% for the costs of selling them (DMG 52671). It is a mixed - variable, though: it also holds unit trusts, which have no costs of sale - (DMG 52681), stocks and shares ISAs and employee share options, and datasets - built before private pension wealth was split out also fold - non-defined-benefit pension wealth into it, which is not capital at all. The - deduction reaches all of these until the data separate them. Sources not - counted as income-related ESA capital are ignored. + sale (DMG 52620-52623 and 52685). `share_like_capital_with_sale_expenses` is + listed: the part of share-like capital whose sale incurs expenses, namely + directly held shares, valued less 10% for selling costs (DMG 52671), and all + of `corporate_wealth` on datasets that do not itemise it (which then still + folds in unit trusts, ISAs and, on datasets built before private pension + wealth was split out, non-defined-benefit pension wealth). Unit and + investment trusts and stocks and shares ISAs are valued without the + deduction; `gov.dwp.share_like_capital.without_sale_expenses` lists them, + with the guidance and the approximation for investment trusts, which the + survey cannot separate from unit trusts. Sources not counted as + income-related ESA capital are ignored. metadata: label: Income-related ESA capital sources with sale expenses period: year @@ -28,13 +30,15 @@ metadata: href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=115 - title: Decision Makers' Guide chapter 52, para. 52623 href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=116 + - title: Decision Makers' Guide chapter 52, paras. 52662-52664 + href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=124 - title: Decision Makers' Guide chapter 52, para. 52671 href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=126 - - title: Decision Makers' Guide chapter 52, paras. 52681 and 52685 - href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=128 + - title: Decision Makers' Guide chapter 52, paras. 52680-52681 and 52685 + href: https://assets.publishing.service.gov.uk/media/69d8f30ad3e08b8871b665ac/dmg-Ch-52.pdf#page=127 values: 2008-10-27: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sources.yaml index 8665590684..9d29f74739 100644 --- a/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/ESA/income/capital/sources.yaml @@ -3,7 +3,8 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. Model variables currently mapped to countable income-related Employment and Support Allowance capital. The Employment and Support Allowance Regulations @@ -12,7 +13,9 @@ description: > held directly, the share-like sources, `other_residential_property_value` for residential property other than the home, and `non_residential_property_value` for other land and premises. - `share_like_capital` is `corporate_wealth` as supplied, or the sum of its + `share_like_capital_with_sale_expenses` and + `share_like_capital_without_sale_expenses` split `share_like_capital`, which + is `corporate_wealth` as supplied, or the sum of its itemised components (`directly_held_shares`, `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it beyond float32 rounding (see `share_like_capital`), so a household given only the components has them @@ -45,6 +48,7 @@ values: - savings - cash_isa - owned_land - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses - other_residential_property_value - non_residential_property_value diff --git a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/person_sources.yaml b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/person_sources.yaml index fdbd6f8d02..254d365c13 100644 --- a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/person_sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/person_sources.yaml @@ -15,7 +15,8 @@ description: > child owns a junior ISA's investments (Individual Savings Account Regulations 1998 reg. 4(6)(a) and reg. 2B(c)). The formulas subtract each bounded ISA balance from its household source (`cash_isa`, - `share_like_capital`) and count it in the holder's unit. When a household's + `share_like_capital_without_sale_expenses`) and count it in the holder's + unit. When a household's balances exceed its total, the model scales them to sum to the total exactly, rounding each share down or up to a whole float32 step of the total. When a reform removes a household source from `sources`, the formulas diff --git a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sale_expenses/sources.yaml index f193f938cf..7db3f2fd1b 100644 --- a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sale_expenses/sources.yaml @@ -6,15 +6,17 @@ description: > `other_residential_property_value` and `non_residential_property_value` are listed. `savings` is not listed: a bank or building society account is valued at its balance, and the costs of withdrawing money are not costs of - sale (DMG 29620-29623 and 29685). `share_like_capital` (`corporate_wealth`, - or its itemised components where they exceed it) is listed because shares - are valued less 10% for the costs of selling them (DMG 29671). It is a mixed - variable, though: it also holds unit trusts, which have no costs of sale - (DMG 29681), stocks and shares ISAs and employee share options, and datasets - built before private pension wealth was split out also fold non- - defined-benefit pension wealth into it, which is not capital at all. The - deduction reaches all of these until the data separate them. Sources not - counted as income-based JSA capital are ignored. + sale (DMG 29620-29623 and 29685). `share_like_capital_with_sale_expenses` is + listed: the part of share-like capital whose sale incurs expenses, namely + directly held shares, valued less 10% for selling costs (DMG 29671), and all + of `corporate_wealth` on datasets that do not itemise it (which then still + folds in unit trusts, ISAs and, on datasets built before private pension + wealth was split out, non-defined-benefit pension wealth). Unit and + investment trusts and stocks and shares ISAs are valued without the + deduction; `gov.dwp.share_like_capital.without_sale_expenses` lists them, + with the guidance and the approximation for investment trusts, which the + survey cannot separate from unit trusts. Sources not counted as income-based + JSA capital are ignored. metadata: label: Income-based JSA capital sources with sale expenses period: year @@ -26,13 +28,15 @@ metadata: href: https://www.legislation.gov.uk/nisr/2007/396/regulation/7 - title: Decision Makers' Guide chapter 29, paras. 29620-29623 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=124 + - title: Decision Makers' Guide chapter 29, paras. 29662-29664 + href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=135 - title: Decision Makers' Guide chapter 29, para. 29671 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=137 - - title: Decision Makers' Guide chapter 29, paras. 29681 and 29685 + - title: Decision Makers' Guide chapter 29, paras. 29680-29681 and 29685 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=139 values: 1996-10-07: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sources.yaml index d30ee0a503..28f7d3ee60 100644 --- a/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/JSA/income/capital/sources.yaml @@ -3,7 +3,8 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. Model variables currently mapped to countable income-based Jobseeker's Allowance capital. The Jobseeker's Allowance Regulations 1996 treat capital @@ -12,7 +13,9 @@ description: > directly, the share-like sources, `other_residential_property_value` for residential property other than the home, and `non_residential_property_value` for other land and premises. - `share_like_capital` is `corporate_wealth` as supplied, or the sum of its + `share_like_capital_with_sale_expenses` and + `share_like_capital_without_sale_expenses` split `share_like_capital`, which + is `corporate_wealth` as supplied, or the sum of its itemised components (`directly_held_shares`, `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it beyond float32 rounding (see `share_like_capital`), so a household given only the components has them @@ -45,6 +48,7 @@ values: - savings - cash_isa - owned_land - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses - other_residential_property_value - non_residential_property_value diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/person_sources.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/person_sources.yaml index 9a019c1541..557055ba2c 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/person_sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/person_sources.yaml @@ -17,7 +17,8 @@ description: > child owns a junior ISA's investments (Individual Savings Account Regulations 1998 reg. 4(6)(a) and reg. 2B(c)). In the ordinary calculation, the formula subtracts each bounded ISA balance from its household source - (`cash_isa`, `share_like_capital`) and counts it in the holder's unit. For a + (`cash_isa`, `share_like_capital_without_sale_expenses`) and counts it in the holder's + unit. For a family on a passporting benefit, or at pension age on a guarantee credit, the formula returns zero capital, and for a savings-credit-only award it uses the Pension Credit capital assessment. When a household's balances diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sale_expenses/sources.yaml index 2211212721..b55b9f2552 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sale_expenses/sources.yaml @@ -7,15 +7,18 @@ description: > `other_residential_property_value` and `non_residential_property_value` are listed. `savings` is not listed: a bank or building society account is valued at its balance, and the costs of withdrawing money are not costs of - sale (HBGM BW1 Annex F and BP1 F2.03). `share_like_capital` - (`corporate_wealth`, or its itemised components where they exceed it) is - listed because shares are valued less 10% for the costs of selling them - (HBGM W1.513). It is a mixed variable, though: it also holds unit trusts, - which have no costs of sale (HBGM W1.530-W1.531), stocks and shares ISAs and - employee share options, and datasets built before private pension wealth was - split out also fold non-defined-benefit pension wealth into it, which is not - capital at all. The deduction reaches all of these until the data separate - them. Sources not counted as Housing Benefit capital are ignored. + sale (HBGM BW1 Annex F and BP1 F2.03). + `share_like_capital_with_sale_expenses` is listed: the part of share-like + capital whose sale incurs expenses, namely directly held shares, valued less + 10% for selling costs (HBGM W1.513 and P1.513), and all of + `corporate_wealth` on datasets that do not itemise it (which then still + folds in unit trusts, ISAs and, on datasets built before private pension + wealth was split out, non-defined-benefit pension wealth). Unit and + investment trusts and stocks and shares ISAs are valued without the + deduction; `gov.dwp.share_like_capital.without_sale_expenses` lists them, + with the guidance and the approximation for investment trusts, which the + survey cannot separate from unit trusts. Sources not counted as Housing + Benefit capital are ignored. metadata: label: Housing Benefit capital sources with sale expenses period: year @@ -41,6 +44,8 @@ metadata: href: https://assets.publishing.service.gov.uk/media/5a749328ed915d0e8e3994c0/hbgm-bw1-assessment-of-capital.pdf#page=43 - title: Housing Benefit Guidance Manual BP1, paras. P1.513 and P1.530-P1.531 href: https://assets.publishing.service.gov.uk/media/5a7ec5d840f0b6230268b71f/hbgm-bp1-assessment-of-capital.pdf#page=38 + - title: Decision Makers' Guide chapter 29, paras. 29662-29664 (ISAs, parallel IS and JSA guidance) + href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=135 - title: Housing Benefit Guidance Manual BW1, Annex F href: https://assets.publishing.service.gov.uk/media/5a749328ed915d0e8e3994c0/hbgm-bw1-assessment-of-capital.pdf#page=93 - title: Housing Benefit Guidance Manual BP1, paras. F2.00-F2.03 @@ -50,4 +55,4 @@ values: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sources.yaml index bd01c601ac..beaa8e9e17 100644 --- a/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/housing_benefit/means_test/capital/sources.yaml @@ -3,7 +3,8 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. Model variables currently mapped to countable Housing Benefit capital. The Housing Benefit Regulations 2006 treat the whole of a claimant's capital as @@ -11,7 +12,9 @@ description: > are `savings` for liquid capital, `owned_land` for land held directly, the share-like sources, `other_residential_property_value` for residential property other than the home, and `non_residential_property_value` for other - land and premises. `share_like_capital` is `corporate_wealth` as supplied, + land and premises. `share_like_capital_with_sale_expenses` and + `share_like_capital_without_sale_expenses` split `share_like_capital`, which + is `corporate_wealth` as supplied, or the sum of its itemised components (`directly_held_shares`, `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it beyond float32 rounding (see `share_like_capital`), so a household given @@ -53,6 +56,7 @@ values: - savings - cash_isa - owned_land - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses - other_residential_property_value - non_residential_property_value diff --git a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/person_sources.yaml b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/person_sources.yaml index 2fad42f98d..f3310ceef8 100644 --- a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/person_sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/person_sources.yaml @@ -15,7 +15,8 @@ description: > investments, and the named child owns a junior ISA's investments (Individual Savings Account Regulations 1998 reg. 4(6)(a) and reg. 2B(c)). The formulas subtract each bounded ISA balance from its household source (`cash_isa`, - `share_like_capital`) and count it in the holder's unit. When a household's + `share_like_capital_without_sale_expenses`) and count it in the holder's + unit. When a household's balances exceed its total, the model scales them to sum to the total exactly, rounding each share down or up to a whole float32 step of the total. When a reform removes a household source from `sources`, the formulas diff --git a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sale_expenses/sources.yaml index 182aa6ad60..fb14e6420c 100644 --- a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sale_expenses/sources.yaml @@ -6,15 +6,17 @@ description: > `other_residential_property_value` and `non_residential_property_value` are listed. `savings` is not listed: a bank or building society account is valued at its balance, and the costs of withdrawing money are not costs of - sale (DMG 29620-29623 and 29685). `share_like_capital` (`corporate_wealth`, - or its itemised components where they exceed it) is listed because shares - are valued less 10% for the costs of selling them (DMG 29671). It is a mixed - variable, though: it also holds unit trusts, which have no costs of sale - (DMG 29681), stocks and shares ISAs and employee share options, and datasets - built before private pension wealth was split out also fold non- - defined-benefit pension wealth into it, which is not capital at all. The - deduction reaches all of these until the data separate them. Sources not - counted as Income Support capital are ignored. + sale (DMG 29620-29623 and 29685). `share_like_capital_with_sale_expenses` is + listed: the part of share-like capital whose sale incurs expenses, namely + directly held shares, valued less 10% for selling costs (DMG 29671), and all + of `corporate_wealth` on datasets that do not itemise it (which then still + folds in unit trusts, ISAs and, on datasets built before private pension + wealth was split out, non-defined-benefit pension wealth). Unit and + investment trusts and stocks and shares ISAs are valued without the + deduction; `gov.dwp.share_like_capital.without_sale_expenses` lists them, + with the guidance and the approximation for investment trusts, which the + survey cannot separate from unit trusts. Sources not counted as Income + Support capital are ignored. metadata: label: Income Support capital sources with sale expenses period: year @@ -26,13 +28,15 @@ metadata: href: https://www.legislation.gov.uk/nisr/2007/396/regulation/4 - title: Decision Makers' Guide chapter 29, paras. 29620-29623 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=124 + - title: Decision Makers' Guide chapter 29, paras. 29662-29664 + href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=135 - title: Decision Makers' Guide chapter 29, para. 29671 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=137 - - title: Decision Makers' Guide chapter 29, paras. 29681 and 29685 + - title: Decision Makers' Guide chapter 29, paras. 29680-29681 and 29685 href: https://assets.publishing.service.gov.uk/media/69d8f3a496c86b751317022c/dmg-Ch-29.pdf#page=139 values: 2010-01-01: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sources.yaml index e4ea10e98b..4e8f8766f1 100644 --- a/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/income_support/means_test/capital/sources.yaml @@ -3,13 +3,16 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. Capital sources included in the Income Support capital test. `private_pension_wealth` is excluded because Schedule 10 paragraphs 23 and 23A disregard the value of the right to receive an occupational or personal pension and the value of funds held under a personal pension scheme. - `share_like_capital` is `corporate_wealth` as supplied, or the sum of its + `share_like_capital_with_sale_expenses` and + `share_like_capital_without_sale_expenses` split `share_like_capital`, which + is `corporate_wealth` as supplied, or the sum of its itemised components (`directly_held_shares`, `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it beyond float32 rounding (see `share_like_capital`), so a household given only the components has them @@ -34,6 +37,7 @@ values: - savings - cash_isa - owned_land - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses - other_residential_property_value - non_residential_property_value diff --git a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/person_sources.yaml b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/person_sources.yaml index 194718020a..e62e156da8 100644 --- a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/person_sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/person_sources.yaml @@ -16,7 +16,8 @@ description: > child owns a junior ISA's investments (Individual Savings Account Regulations 1998 reg. 4(6)(a) and reg. 2B(c)). The formula subtracts each bounded ISA balance from its household source (`cash_isa`, - `share_like_capital`) and counts it in the holder's unit. A nonnegative + `share_like_capital_without_sale_expenses`) and counts it in the holder's + unit. A nonnegative `pension_credit_reported_capital` replaces that unit's calculated capital. When a household's balances exceed its total, the model scales them to sum to the total exactly, rounding each share down or up to a whole float32 step diff --git a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sale_expenses/sources.yaml index 58ffe0c298..ade6847f6e 100644 --- a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sale_expenses/sources.yaml @@ -6,15 +6,17 @@ description: > `other_residential_property_value` and `non_residential_property_value` are listed. `savings` is not listed: a bank or building society account is valued at its balance, and the costs of withdrawing money are not costs of - sale (DMG 84712-84715 and 84731). `share_like_capital` (`corporate_wealth`, - or its itemised components where they exceed it) is listed because shares - are valued less 10% for the costs of selling them (DMG 84763). It is a mixed - variable, though: it also holds unit trusts, which have no costs of sale - (DMG 84772), stocks and shares ISAs and employee share options, and datasets - built before private pension wealth was split out also fold non- - defined-benefit pension wealth into it, which is not capital at all. The - deduction reaches all of these until the data separate them. Sources not - counted as Pension Credit capital are ignored. + sale (DMG 84712-84715 and 84731). `share_like_capital_with_sale_expenses` is + listed: the part of share-like capital whose sale incurs expenses, namely + directly held shares, valued less 10% for selling costs (DMG 84763), and all + of `corporate_wealth` on datasets that do not itemise it (which then still + folds in unit trusts, ISAs and, on datasets built before private pension + wealth was split out, non-defined-benefit pension wealth). Unit and + investment trusts and stocks and shares ISAs are valued without the + deduction; `gov.dwp.share_like_capital.without_sale_expenses` lists them, + with the guidance and the approximation for investment trusts, which the + survey cannot separate from unit trusts. Sources not counted as Pension + Credit capital are ignored. metadata: label: Pension Credit capital sources with sale expenses period: year @@ -28,13 +30,15 @@ metadata: href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=99 - title: Decision Makers' Guide chapter 84, para. 84731 href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=102 + - title: Decision Makers' Guide chapter 84, paras. 84748-84750 + href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=105 - title: Decision Makers' Guide chapter 84, para. 84763 href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=107 - - title: Decision Makers' Guide chapter 84, para. 84772 - href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=109 + - title: Decision Makers' Guide chapter 84, paras. 84771-84772 + href: https://assets.publishing.service.gov.uk/media/6a5e38bb8b7e4fa537e693d5/dmg-ch84.pdf#page=108 values: 2003-10-06: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sources.yaml index 6c5a9bd5ca..931d710012 100644 --- a/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/pension_credit/income/capital/sources.yaml @@ -3,7 +3,8 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. PolicyEngine approximation of Pension Credit capital sources that count toward deemed income from capital, excluding the claimant's main home. @@ -11,8 +12,11 @@ description: > (Part I) disregard the value of the right to receive income from an occupational or personal pension scheme or under a retirement annuity contract; the notional income rule for undrawn money purchase pots - (regulation 18) is not modelled. `share_like_capital` is `corporate_wealth` - as supplied, or the sum of its itemised components (`directly_held_shares`, + (regulation 18) is not modelled. + `share_like_capital_with_sale_expenses` and + `share_like_capital_without_sale_expenses` split `share_like_capital`, which + is `corporate_wealth` as supplied, or the sum of its itemised components + (`directly_held_shares`, `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it beyond float32 rounding (see `share_like_capital`), so a household given only the components has them counted and no holding counts twice. @@ -36,4 +40,5 @@ values: - owned_land - other_residential_property_value - non_residential_property_value - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/share_like_capital/without_sale_expenses.yaml b/policyengine_uk/parameters/gov/dwp/share_like_capital/without_sale_expenses.yaml new file mode 100644 index 0000000000..c124928df2 --- /dev/null +++ b/policyengine_uk/parameters/gov/dwp/share_like_capital/without_sale_expenses.yaml @@ -0,0 +1,33 @@ +description: > + Itemised share-like holdings valued for every means test without the + deduction for expenses of sale. Unit trusts are valued at the bid price, + which the manager pays on withdrawal, with no costs of sale even when sold + through a broker (ADM H1673-H1674; DMG 29680-29681, 52680-52681, + 84771-84772; HBGM W1.530-W1.531). The Wealth and Assets Survey asks about + unit and investment trusts in one question, so the whole bucket is listed; + investment trusts are quoted shares, which take the deduction (ADM H1665), + and were 8.2% of the pooled funds held in stocks and shares ISAs at 5 April + 2022 and 6.9% at 5 April 2025 (HMRC ISA Table 9.6). An ISA is valued at + what the holder would get by withdrawing it (ADM H1656-H1658; DMG + 29662-29664, 52662, 84748-84750). The model counts that value in full, a + reading that rests on ADM H1656 saying nothing about costs of sale. + Everything else in share_like_capital takes the deduction: directly held + shares, and on datasets that do not itemise it, all of corporate_wealth. + Directly held shares include employee shares and share options, which the + Wealth and Assets Survey records as one total, so share options also take + the deduction, an approximation. +metadata: + label: Share-like holdings without expenses of sale + period: year + unit: list + reference: + - title: Advice for Decision Making chapter H1, paras. H1656-H1658 + href: https://assets.publishing.service.gov.uk/media/6a5e0ac7a2662d4563fe39e0/adm-ch-h1.pdf#page=55 + - title: Advice for Decision Making chapter H1, paras. H1673-H1674 + href: https://assets.publishing.service.gov.uk/media/6a5e0ac7a2662d4563fe39e0/adm-ch-h1.pdf#page=59 + - title: HMRC Annual savings statistics 2026, ISA Table 9.6 + href: https://www.gov.uk/government/statistics/annual-savings-statistics-2026 +values: + 1996-10-07: + - unit_and_investment_trusts + - stocks_and_shares_isa diff --git a/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sale_expenses/sources.yaml b/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sale_expenses/sources.yaml index 644d64294b..5797b232a5 100644 --- a/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sale_expenses/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sale_expenses/sources.yaml @@ -1,19 +1,21 @@ description: > Universal Credit financial capital sources (capital.sources) whose sale would incur expenses, so that they are valued at 90% of market value. - `share_like_capital` (`corporate_wealth`, or its itemised components where - they exceed it) is listed because shares are valued less 10% for the costs - of selling them (ADM H1665). It is a mixed variable, though: it also holds - unit trusts, which have no costs of sale (H1674), stocks and shares ISAs, - valued at their withdrawal value (H1656), and employee share options, and - datasets built before private pension wealth was split out also fold - non-defined-benefit pension wealth into it, which is not capital at all. The - deduction reaches all of these until the data separate them. `savings` is - not listed: the 10% applies where selling normally needs an agent, broker, - solicitor or accountant (H1604-H1605), the costs of withdrawing money are - not costs of sale (H1607), and an account is valued at its balance (H1675). - Countable property is valued through property_sources with the same rate, - and real property always has costs of sale (H1606). + `share_like_capital_with_sale_expenses` is listed: the part of share-like + capital whose sale incurs expenses, namely directly held shares, valued less + 10% for the costs of selling them (ADM H1665), and all of `corporate_wealth` + on datasets that do not itemise it (which then still folds in unit trusts, + ISAs and, on datasets built before private pension wealth was split out, + non-defined-benefit pension wealth). Unit and investment trusts and stocks + and shares ISAs are valued without the deduction; + `gov.dwp.share_like_capital.without_sale_expenses` lists them, with the + guidance and the approximation for investment trusts, which the survey + cannot separate from unit trusts. `savings` is not listed: the 10% applies + where selling normally needs an agent, broker, solicitor or accountant + (H1604-H1605), the costs of withdrawing money are not costs of sale (H1607), + and an account is valued at its balance (H1675). Countable property is + valued through property_sources with the same rate, and real property always + has costs of sale (H1606). metadata: label: Universal Credit capital sources with sale expenses period: year @@ -33,4 +35,4 @@ metadata: href: https://assets.publishing.service.gov.uk/media/6a5e0ac7a2662d4563fe39e0/adm-ch-h1.pdf#page=59 values: 2013-04-29: - - share_like_capital + - share_like_capital_with_sale_expenses diff --git a/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sources.yaml b/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sources.yaml index a7a116c5f3..0b0484033c 100644 --- a/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sources.yaml +++ b/policyengine_uk/parameters/gov/dwp/universal_credit/means_test/capital/sources.yaml @@ -3,37 +3,40 @@ description: > at their cash value, without a generic cash sale-cost deduction. Where the data tie a cash ISA or stocks and shares ISA balance to a member, the formulas count it through `person_sources` in the holder's own benefit - unit and subtract it from `cash_isa` or `share_like_capital` before they + unit and subtract it from `cash_isa` or + `share_like_capital_without_sale_expenses` before they allocate the rest. Household financial proxies for Universal Credit: savings and share-like - financial wealth. `share_like_capital` is `corporate_wealth` as supplied, or - the sum of its itemised components (`directly_held_shares`, - `unit_and_investment_trusts`, `stocks_and_shares_isa`) where they exceed it - beyond float32 rounding, so a household given only the components has them - counted and no holding counts twice. A nonnegative benunit_reported_capital - replaces these financial proxies and covered person-level sources, including - a Lifetime ISA. Each benefit unit's complete uc_reported_capital override, - otherwise its observed financial total, reduces this financial pool. - Subtracting complete overrides retains the inherited allocation convention. - An override precedes regulation 77 company substitution and includes its - claimant's and partner's holdings: consume at least their disregarded - holdings after applying one household share_like_capital budget without - removing them again from the pool. First clip each person's holding to [0, - max(0, share_like_capital)], with positive infinity mapped to the upper - bound and negative infinity to zero. If total bounded holdings exceed - nonnegative share_like_capital, scale each person's bounded holding - proportionally before override floors and separate pool deductions. This is - a defensive rule for inconsistent inputs, not a statutory determination; - regulation 77 substitution in the owner's own assessment is unchanged. The - residual is allocated by claimant/partner counts to benefit units with - neither a financial observation nor a complete override, including units - that do not receive UC. This allocation is an assumption about unobserved - ownership, not a statutory rule. Countable property is valued and shared - independently through property_sources across ALL claimant/partner adults, - with complete-override units consuming their shares. Main-home property and - the named private_pension_wealth input are excluded under Schedule 10 - paragraphs 1 and 10. For missing-report households, the legacy - corporate_wealth proxy, and so share_like_capital, can still contain non-DB + financial wealth, in two parts: `share_like_capital_with_sale_expenses` + (directly held shares, and all of an unitemised `corporate_wealth`) and + `share_like_capital_without_sale_expenses` (unit and investment trusts and + stocks and shares ISAs). Together they are `share_like_capital`: + `corporate_wealth` as supplied, or the sum of its itemised components + (`directly_held_shares`, `unit_and_investment_trusts`, + `stocks_and_shares_isa`) where they exceed it beyond float32 rounding. A + nonnegative benunit_reported_capital replaces these financial proxies and + covered person-level sources, including a Lifetime ISA. Each benefit unit's + complete uc_reported_capital override, otherwise its observed financial + total, reduces this financial pool. Subtracting complete overrides retains + the inherited allocation convention. An override precedes regulation 77 + company substitution and includes its claimant's and partner's holdings: + consume at least their disregarded holdings after applying one household + share-like capital budget without removing them again from the pool. First + clip each person's holding to [0, max(0, the part with sale expenses)], with + positive infinity mapped to the upper bound and negative infinity to zero. + If total bounded holdings exceed that nonnegative budget, scale each + person's bounded holding proportionally before override floors and separate + pool deductions. This is a defensive rule for inconsistent inputs, not a + statutory determination; regulation 77 substitution in the owner's own + assessment is unchanged. The residual is allocated by claimant/partner + counts to benefit units with neither a financial observation nor a complete + override, including units that do not receive UC. This allocation is an + assumption about unobserved ownership, not a statutory rule. Countable + property is valued and shared independently through property_sources across + ALL claimant/partner adults, with complete-override units consuming their + shares. Main-home property and the named private_pension_wealth input are + excluded under Schedule 10 paragraphs 1 and 10. For missing-report + households, the legacy corporate_wealth proxy can still contain non-DB pension wealth that is not separately identified and removed. Asset-specific Schedule 10 disregards within these broad financial classes are not separately observed. @@ -52,4 +55,5 @@ values: 2013-04-29: - savings - cash_isa - - share_like_capital + - share_like_capital_with_sale_expenses + - share_like_capital_without_sale_expenses diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/capital_valuation_share_split.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/capital_valuation_share_split.yaml new file mode 100644 index 0000000000..d99438122f --- /dev/null +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/capital_valuation_share_split.yaml @@ -0,0 +1,262 @@ +# corporate_wealth itemised into directly_held_shares, unit_and_investment_trusts +# and stocks_and_shares_isa. share_like_capital_with_sale_expenses is the part +# valued less 10%: directly held shares plus anything not itemised (all of +# corporate_wealth when nothing is itemised). +# Capital is valued at market value less 10% where a sale would incur expenses +# (UC Regs 2013 reg. 49(1); HB Regs 2006 reg. 47; IS Regs 1987 reg. 49; JSA +# Regs 1996 reg. 111; ESA Regs 2008 reg. 113; SPC Regs 2002 reg. 19). Shares +# take the 10% (ADM H1665; DMG 29671, 52671, 84763; HBGM W1.513). Unit trusts +# have no costs of sale (ADM H1673-H1674; DMG 29680-29681, 52680-52681, +# 84771-84772; HBGM W1.530-W1.531), and the survey bucket of unit and +# investment trusts is treated the same. An ISA is valued at what the person +# would get by withdrawing it (ADM H1656; DMG 29662, 52662, 84748), and the +# model takes no 10% from it because H1656 says nothing about costs of sale. +# Expected values are worked by hand from those rules. + +- name: UC unsplit corporate_wealth keeps the flat 10% treatment + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # No components, so the residual is all 12,000 of corporate_wealth: + # 5,000 + 90% of 12,000 = 15,800, the same as before the split. + savings: 5_000 + corporate_wealth: 12_000 + output: + share_like_capital_with_sale_expenses: 12_000 + uc_assessable_capital: 15_800 + is_uc_eligible: true + # 9,800 above 6,000 is 40 steps of 250 (rounded up): 40 * 4.35 * 12. + uc_tariff_income: 2_088 + +- name: UC split of the same total exempts trusts and ISAs and crosses the limit + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual max(0, 12,000 - (4,000 + 3,000 + 5,000)) = 0. Capital is + # 5,000 + 90% of 4,000 + 3,000 + 5,000 = 16,600, above the 16,000 + # limit; unsplit, the same household held 15,800 and qualified. + savings: 5_000 + corporate_wealth: 12_000 + directly_held_shares: 4_000 + unit_and_investment_trusts: 3_000 + stocks_and_shares_isa: 5_000 + output: + share_like_capital_with_sale_expenses: 4_000 + uc_assessable_capital: 16_600 + is_uc_eligible: false + +- name: UC counts the components when corporate_wealth is not given + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual max(0, 0 - 15,600) = 0. Capital is + # 1,000 + 90% of 10,000 + 2,600 + 3,000 = 15,600. + savings: 1_000 + directly_held_shares: 10_000 + unit_and_investment_trusts: 2_600 + stocks_and_shares_isa: 3_000 + output: + share_like_capital_with_sale_expenses: 10_000 + uc_assessable_capital: 15_600 + is_uc_eligible: true + # 9,600 above 6,000 is 39 steps of 250 (38.4 rounded up): 39 * 4.35 * 12. + uc_tariff_income: 2_035.8 + +- name: UC partial split values the part not itemised less 10% + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # Only the ISA is itemised: residual 12,000 - 5,000 = 7,000. Share-like + # capital is 90% of 7,000 + 5,000 = 11,300; with savings 15,300 + # (unsplit it would be 4,000 + 10,800 = 14,800). + savings: 4_000 + corporate_wealth: 12_000 + stocks_and_shares_isa: 5_000 + output: + share_like_capital_with_sale_expenses: 7_000 + uc_assessable_capital: 15_300 + # 9,300 above 6,000 is 38 steps of 250 (37.2 rounded up): 38 * 4.35 * 12. + uc_tariff_income: 1_983.6 + +- name: UC components exceeding corporate_wealth leave a nil residual + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # The components (7,000) exceed corporate_wealth (5,000), so the + # residual is max(0, -2,000) = 0, not a negative offset. Capital is + # 1,000 + 90% of 4,000 + 3,000 = 7,600. + savings: 1_000 + corporate_wealth: 5_000 + directly_held_shares: 4_000 + unit_and_investment_trusts: 3_000 + output: + share_like_capital_with_sale_expenses: 4_000 + uc_assessable_capital: 7_600 + # 1,600 above 6,000 is 7 steps of 250 (6.4 rounded up): 7 * 4.35 * 12. + uc_tariff_income: 365.4 + +- name: Housing Benefit split exempts trusts and ISAs + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + in_social_housing: true + housing_benefit_reported: 1 + benunits: + benunit: + members: person + would_claim_uc: false + households: + household: + members: person + # Residual 0. 1,100 + 90% of 5,000 + 4,000 + 6,000 = 15,600 (HBGM + # W1.513, W1.530); unsplit it would be 1,100 + 13,500 = 14,600. + savings: 1_100 + corporate_wealth: 15_000 + directly_held_shares: 5_000 + unit_and_investment_trusts: 4_000 + stocks_and_shares_isa: 6_000 + output: + share_like_capital_with_sale_expenses: 5_000 + housing_benefit_assessable_capital: 15_600 + # 9,600 above 6,000 is 39 steps of 250 (38.4 rounded up) at 1 a week. + housing_benefit_tariff_income: 2_028 + housing_benefit_eligible: true + +- name: Income Support split exempts unit trusts + period: 2021 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual 0. 90% of 6,000 + 4,000 = 9,400 (DMG 29671, 29681); + # unsplit it would be 9,000. + corporate_wealth: 10_000 + directly_held_shares: 6_000 + unit_and_investment_trusts: 4_000 + output: + income_support_assessable_capital: 9_400 + +- name: Income-based JSA split exempts stocks and shares ISAs + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 30 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual 0. 2,000 + 90% of 3,000 + 6,000 = 10,700 (DMG 29662, + # 29671); unsplit it would be 2,000 + 8,100 = 10,100. + savings: 2_000 + corporate_wealth: 9_000 + directly_held_shares: 3_000 + stocks_and_shares_isa: 6_000 + output: + jsa_income_assessable_capital: 10_700 + +- name: Income-related ESA split exempts trusts and ISAs + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 40 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual 0. 3,000 + 90% of 2,000 + 3,000 + 5,000 = 12,800 (DMG + # 52662, 52671, 52681); unsplit it would be 3,000 + 9,000 = 12,000. + savings: 3_000 + corporate_wealth: 10_000 + directly_held_shares: 2_000 + unit_and_investment_trusts: 3_000 + stocks_and_shares_isa: 5_000 + output: + esa_income_assessable_capital: 12_800 + +- name: Pension Credit split exempts trusts and ISAs + period: 2026 + absolute_error_margin: 0.01 + input: + people: + person: + age: 70 + benunits: + benunit: + members: person + households: + household: + members: person + # Residual 0. 2,100 + 90% of 10,000 + 8,000 + 12,000 = 31,100 (DMG + # 84748, 84763, 84772); unsplit it would be 2,100 + 27,000 = 29,100. + savings: 2_100 + corporate_wealth: 30_000 + directly_held_shares: 10_000 + unit_and_investment_trusts: 8_000 + stocks_and_shares_isa: 12_000 + output: + pension_credit_assessable_capital: 31_100 + # 21,100 above 10,000 is 43 steps of 500 (42.2 rounded up) at 1 a week. + pension_credit_deemed_income: 2_236 diff --git a/policyengine_uk/tests/policy/baseline/gov/dwp/person_isa_capital.yaml b/policyengine_uk/tests/policy/baseline/gov/dwp/person_isa_capital.yaml index a282d3c84d..cf77891e80 100644 --- a/policyengine_uk/tests/policy/baseline/gov/dwp/person_isa_capital.yaml +++ b/policyengine_uk/tests/policy/baseline/gov/dwp/person_isa_capital.yaml @@ -9,11 +9,15 @@ # from the household's capital, then allocates the remainder by claimant and # partner counts, between pension-age adults for Pension Credit, or wholly to # a unit on the IS, JSA or ESA claim path. Each programme values the pool's -# share_like_capital, and each stocks and shares ISA balance the formula moves -# out of it, at market value less 10% for the expenses of sale (UC Regs 2013 -# reg 49(1)(a); HB Regs 2006 reg 47; IS Regs 1987 reg 49; JSA Regs 1996 reg -# 111; ESA Regs 2008 reg 113; SPC Regs 2002 reg 19), and counts savings and -# cash ISAs at face value. +# share-like holdings with expenses of sale (directly held shares, and all of +# an unitemised corporate_wealth) at market value less 10% (UC Regs 2013 reg +# 49(1)(a); HB Regs 2006 reg 47; IS Regs 1987 reg 49; JSA Regs 1996 reg 111; +# ESA Regs 2008 reg 113; SPC Regs 2002 reg 19). It counts savings, cash ISAs +# and each stocks and shares ISA balance the formula moves out of +# share_like_capital at face value: an ISA is valued at what the holder would +# get by withdrawing it (ADM H1656-H1658; DMG 29662-29664, 52662, +# 84748-84750), and the model reads H1656's silence on costs of sale as no +# deduction. - name: Case 1, a lodger's cash ISA stays out of the main benefit unit's capital. period: 2025 @@ -75,9 +79,9 @@ # The formula subtracts the child's 6,000 from savings 9,000 plus # share_like_capital 6,000 and allocates the remaining 9,000 by claimant # counts: 6,000 to the parents and 3,000 to the child's unit, which adds - # the 6,000 ISA less 10%, 5,400. - uc_assessable_capital: [6_000, 8_400] - housing_benefit_assessable_capital: [6_000, 8_400] + # the 6,000 ISA at face value. + uc_assessable_capital: [6_000, 9_000] + housing_benefit_assessable_capital: [6_000, 9_000] - name: Case 3, an adult child's ISA inside corporate wealth stays out of the parents' capital. period: 2025 @@ -107,10 +111,10 @@ share_like_capital: 9_000 # The formula subtracts the child's 6,000 ISA from corporate wealth # 9,000, values the remaining 3,000 less 10% at 2,700 and allocates it: - # 1,800 to the parents and 900 to the child's unit, which adds the ISA - # less 10%, 5,400. - uc_assessable_capital: [1_800, 6_300] - housing_benefit_assessable_capital: [1_800, 6_300] + # 1,800 to the parents and 900 to the child's unit, which adds the 6,000 + # ISA at face value. + uc_assessable_capital: [1_800, 6_900] + housing_benefit_assessable_capital: [1_800, 6_900] - name: Case 4, a parent's Income Support claim does not count an adult child's cash ISA. period: 2025 @@ -187,8 +191,8 @@ savings: 2_000 output: # The parent's claiming unit takes the 2,000 of savings; the child's unit - # counts the ISA less 10%, 4,500. - esa_income_assessable_capital: [2_000, 4_500] + # counts the 5,000 ISA at face value. + esa_income_assessable_capital: [2_000, 5_000] - name: Case 7, a pensioner couple's Pension Credit counts their own ISAs and not a lodger's. period: 2025 @@ -217,8 +221,8 @@ # The formula subtracts all three balances from savings 4,000, cash_isa # 9,000 and share_like_capital 2,000, and allocates the remaining 4,000 # between the two pension-age adults. The couple's unit adds their own - # 3,000 cash ISA and the 2,000 stocks and shares ISA less 10%, 1,800. - pension_credit_assessable_capital: [8_800, 0] + # 3,000 cash ISA and 2,000 stocks and shares ISA at face value. + pension_credit_assessable_capital: [9_000, 0] - name: Case 8, a dependent child's junior ISA counts in no benefit unit. period: 2025 @@ -277,9 +281,9 @@ # Joint claimants' combined capital (WRA 2012 s 5(2)(a)): the formula # allocates savings of 6,000 by claimant counts, 4,000 to the couple and # 2,000 to the lodger, and the couple's unit adds their 4,000 cash ISA - # and the 3,000 stocks and shares ISA less 10%, 2,700. - uc_assessable_capital: [10_700, 2_000] - housing_benefit_assessable_capital: [10_700, 2_000] + # and the 3,000 stocks and shares ISA at face value. + uc_assessable_capital: [11_000, 2_000] + housing_benefit_assessable_capital: [11_000, 2_000] - name: Case 10, a household total above the balances keeps the rest in the pool. period: 2025 @@ -377,7 +381,7 @@ age: 30 lodger: age: 30 - stocks_and_shares_isa_balance: 34_000 + stocks_and_shares_isa_balance: 30_600 benunits: tenant_unit: members: tenant @@ -387,16 +391,15 @@ household: members: [tenant, lodger] output: - # The ISA less 10%, 30,600, exceeds reg 18's 16,000 limit. Pooling it - # would give each claimant 15,300, within the limit. The formula - # attributes it to its holder. + # The ISA of 30,600 exceeds reg 18's 16,000 limit. Pooling it would give + # each claimant 15,300, within the limit. The formula attributes it to + # its holder. uc_assessable_capital: [0, 30_600] # Cases 14 to 17: where balances exceed a household total, the model counts # exactly the total, so a holder at a capital limit or a tariff threshold -# stays on its boundary. In Cases 14 and 15 the stocks and shares total, less -# 10% and rounded to the nearest penny (UC Regs 2013 reg 6(1)), comes to the -# boundary: 90% of 17,777.78 is 16,000.002 and 90% of 6,666.67 is 6,000.003. +# stays on its boundary. In Cases 14 and 15 the stocks and shares total is the +# boundary itself, since a stocks and shares ISA counts at face value. # The model stores amounts in float32 (spacing 0.0009765625 at 16,000), and # absolute_error_margin 0 fails on one unit in the last place. @@ -426,10 +429,10 @@ cash_isa: 16_000 stocks_home: members: stocks_holder - stocks_and_shares_isa: 17_777.78 + stocks_and_shares_isa: 16_000 output: cash_isa_countable_capital: [16_000, 0] - stocks_and_shares_isa_countable_capital: [0, 17_777.78] + stocks_and_shares_isa_countable_capital: [0, 16_000] # WRA 2012 s 5(1)(a) requires capital not greater than the amount reg # 18(1)(a) prescribes, 16,000, so capital of exactly 16,000 keeps # entitlement. Reg 72(1) deems 4.35 a month for each 250 above 6,000: @@ -464,10 +467,10 @@ cash_isa: 6_000 stocks_home: members: stocks_holder - stocks_and_shares_isa: 6_666.67 + stocks_and_shares_isa: 6_000 output: cash_isa_countable_capital: [6_000, 0] - stocks_and_shares_isa_countable_capital: [0, 6_666.67] + stocks_and_shares_isa_countable_capital: [0, 6_000] # Reg 72(1) deems no income from capital of 6,000 or less. uc_assessable_capital: [6_000, 6_000] uc_tariff_income: [0, 0] @@ -578,8 +581,8 @@ share_like_capital: 100 output: stocks_and_shares_isa_countable_capital: 100 - # UC counts the 100 less 10%. - uc_assessable_capital: 90 + # UC counts the 100 at face value. + uc_assessable_capital: 100 - name: Case 19, a child's ISA counts in no unit when the parent reports the family's capital. period: 2025 diff --git a/policyengine_uk/tests/shard_durations.toml b/policyengine_uk/tests/shard_durations.toml index a3849e47dc..09c8dd3996 100644 --- a/policyengine_uk/tests/shard_durations.toml +++ b/policyengine_uk/tests/shard_durations.toml @@ -14,7 +14,7 @@ # the others. The last shard runs the tests that need the dataset, so this # table leaves them out: regenerate it from the other shards' logs. [seconds] -"policyengine_uk/tests/test_capital_share_components.py::test_capital_matches_the_original_lists" = 1951 +"policyengine_uk/tests/test_capital_share_components.py::test_unitemised_inputs_match_the_lists_before_itemising" = 1951 "policyengine_uk/tests/test_mixed_age_couple_properties.py::test_mixed_age_couple_invariants" = 1044 "policyengine_uk/tests/test_dated_reform_routes.py::test_routes_agree_on_start_stop_keys" = 668 "policyengine_uk/tests/test_pension_tax_allowance_properties.py::test_the_full_new_state_pension_pays_no_income_tax_at_any_rate" = 549 @@ -154,7 +154,7 @@ "policyengine_uk/tests/test_dfe_childcare_student_support_properties.py::test_tax_free_childcare_work_condition_matches_reg_13" = 151 "policyengine_uk/tests/test_salary_sacrifice_ni_measure_properties.py::test_measures_equal_the_difference_of_complete_liabilities[full-year Category A directors]" = 151 "policyengine_uk/tests/test_uc_claimant_income_properties.py::test_member_order_does_not_matter" = 151 -"policyengine_uk/tests/test_capital_share_components.py::test_share_like_capital_keeps_the_supplied_aggregate" = 150 +"policyengine_uk/tests/test_capital_share_components.py::test_share_like_capital_and_its_parts" = 150 "policyengine_uk/tests/test_housing_benefit_specified_accommodation_disregard_properties.py::test_no_para_18_amount_without_the_input" = 150 "policyengine_uk/tests/test_income_support_eligibility_properties.py::test_excluded_member_never_changes_is_eligibility" = 150 "policyengine_uk/tests/test_income_support_eligibility_properties.py::test_is_eligibility_matches_a_family_by_family_reading" = 150 @@ -399,7 +399,7 @@ "policyengine_uk/tests/test_pension_annual_allowance_properties.py::test_unused_allowance_reduces_chargeable_amount_one_for_one" = 84 "policyengine_uk/tests/test_property_transaction_tax_purchase_properties.py::test_additional_purchase_is_charged_on_its_own_price" = 84 "policyengine_uk/tests/test_trading_loss_properties.py::test_zero_profit_trade_loss_cannot_raise_tax_or_reduce_programme_award[housing_benefit-2024]" = 84 -"policyengine_uk/tests/test_capital_share_components.py::test_float32_rounding_at_the_limit_keeps_eligibility" = 83 +"policyengine_uk/tests/test_capital_share_components.py::test_float32_rounding_at_the_limit_keeps_the_aggregate" = 83 "policyengine_uk/tests/test_energy_bills_rebate_council_tax_reduction_properties.py::test_a_larger_reduction_never_lowers_the_payment" = 83 "policyengine_uk/tests/test_housing_benefit_savings_credit_only_properties.py::test_net_income_does_not_fall_where_savings_credit_ends" = 83 "policyengine_uk/tests/test_cares_for_severely_disabled_person_properties.py::test_input_false_without_a_reported_award_pays_no_carer_benefit" = 82 diff --git a/policyengine_uk/tests/test_capital_share_components.py b/policyengine_uk/tests/test_capital_share_components.py index 04407d88e2..00cab177dc 100644 --- a/policyengine_uk/tests/test_capital_share_components.py +++ b/policyengine_uk/tests/test_capital_share_components.py @@ -1,22 +1,38 @@ -"""share_like_capital replaces corporate_wealth in the means-test capital lists. +"""Share-like capital in the means tests, itemised and valued by asset type. + +The capital lists name share_like_capital's two parts: +share_like_capital_with_sale_expenses (directly held shares, and all of an +unitemised corporate_wealth), which the sale-expense lists value less 10%, and +share_like_capital_without_sale_expenses (unit and investment trusts, stocks +and shares ISAs), valued in full. Invariants: 1. share_like_capital is corporate_wealth as supplied (any sign, any fraction) - unless the itemised components are positive and exceed it by more than the - float32 rounding tolerance, in which case it is exactly their sum. -2. Differential: for identical inputs that carry no components, or components - consistent with corporate_wealth, every programme's assessable capital, and - UC eligibility, equal those under the original lists (corporate_wealth), - exactly, annually and monthly. -3. A household given only the components has them counted, down to a penny. -4. A disregarded company holding (UC reg 77(2)) is budgeted against, and - leaves the UC financial pool from, share_like_capital, whether it was - entered within corporate_wealth or as an itemised component. + unless the itemised components exceed it beyond the rounding tolerance, in + which case it is their sum. +2. With no itemised holdings, the part with sale expenses is all of + share_like_capital and the other part is exactly nil; otherwise the part + with sale expenses is share_like_capital less trusts and ISAs, floored at + nil, and the two parts add up to share_like_capital. +3. Differential: for identical unitemised inputs, every programme's assessable + capital and UC eligibility equal those under the lists before itemising + (corporate_wealth valued less 10%), exactly, annually and monthly. +4. Split effect: a consistent split raises a working-age single adult's UC + capital by 10% of trusts plus ISAs, against the unitemised lists. +5. A disregarded company holding (UC reg 77(2)) leaves the UC capital pool + from the part with sale expenses, whether it was entered within + corporate_wealth or as directly held shares. +6. The exempt list exists from the first date any capital list does. +7. Valuation by type: given only itemised holdings, with the ISAs held as the + person's own balances, all six means tests count savings, cash ISAs, unit + trusts and stocks and shares ISAs in full and directly held shares less + 10%, rounded by each programme's rule, to within a penny plus float32's + step at that size. """ import numpy as np import pytest -from hypothesis import HealthCheck, given, settings +from hypothesis import HealthCheck, example, given, settings from hypothesis import strategies as st from policyengine_uk import CountryTaxBenefitSystem, Simulation @@ -29,13 +45,18 @@ "unit_and_investment_trusts", "stocks_and_shares_isa", ) -SOURCE_LISTS = { - "uc_assessable_capital": "gov.dwp.universal_credit.means_test.capital.sources", - "housing_benefit_assessable_capital": "gov.dwp.housing_benefit.means_test.capital.sources", - "income_support_assessable_capital": "gov.dwp.income_support.means_test.capital.sources", - "jsa_income_assessable_capital": "gov.dwp.JSA.income.capital.sources", - "esa_income_assessable_capital": "gov.dwp.ESA.income.capital.sources", - "pension_credit_assessable_capital": "gov.dwp.pension_credit.income.capital.sources", +WITH, WITHOUT = ( + "share_like_capital_with_sale_expenses", + "share_like_capital_without_sale_expenses", +) +LEGAL_RATE = 0.1 +NODES = { + "uc_assessable_capital": "gov.dwp.universal_credit.means_test.capital", + "housing_benefit_assessable_capital": "gov.dwp.housing_benefit.means_test.capital", + "income_support_assessable_capital": "gov.dwp.income_support.means_test.capital", + "jsa_income_assessable_capital": "gov.dwp.JSA.income.capital", + "esa_income_assessable_capital": "gov.dwp.ESA.income.capital", + "pension_credit_assessable_capital": "gov.dwp.pension_credit.income.capital", } YEAR = 2026 SETTINGS = settings( @@ -58,19 +79,20 @@ def _parameter(path): return _node(path)(f"{YEAR}-01-01") -SALE_LISTS = [ - path.rsplit(".", 1)[0] + ".sale_expenses.sources" for path in SOURCE_LISTS.values() -] -ORIGINAL_LISTS = { - path: [ - "corporate_wealth" if source == "share_like_capital" else source - for source in _parameter(path) - ] - for path in [*SOURCE_LISTS.values(), *SALE_LISTS] -} -ORIGINAL_REFORM = { - path: {f"{YEAR}-01-01.{YEAR + 4}-12-31": sources} - for path, sources in ORIGINAL_LISTS.items() +def _unitemised(sources): + """The list before itemising: corporate_wealth where the share parts are.""" + out = [] + for source in sources: + if source == WITHOUT: + continue + out.append("corporate_wealth" if source == WITH else source) + return out + + +UNITEMISED_REFORM = { + f"{node}.{name}": {str(YEAR): _unitemised(_parameter(f"{node}.{name}"))} + for node in NODES.values() + for name in ("sources", "sale_expenses.sources") } # Pounds and pence, as a dataset stores them in float64; the engine rounds @@ -81,11 +103,10 @@ def _parameter(path): ) -def _situation(households): - """One single-adult household per entry; ages alternate 30 and 70.""" +def _situation(households, age=None): people, benunits, hhs = {}, {}, {} for i, assets in enumerate(households): - people[f"p{i}"] = {"age": {YEAR: 70 if i % 2 else 30}} + people[f"p{i}"] = {"age": {YEAR: age or (70 if i % 2 else 30)}} benunits[f"b{i}"] = {"members": [f"p{i}"], "would_claim_uc": {YEAR: True}} hhs[f"h{i}"] = { "members": [f"p{i}"], @@ -94,37 +115,27 @@ def _situation(households): return {"people": people, "benunits": benunits, "households": hhs} -def _results(households, reform=None, period=YEAR): - sim = Simulation(situation=_situation(households), reform=reform) - out = {v: sim.calculate(v, period) for v in SOURCE_LISTS} +def _results(households, reform=None, period=YEAR, age=None): + sim = Simulation(situation=_situation(households, age), reform=reform) + out = {v: sim.calculate(v, period) for v in NODES} out["is_uc_eligible"] = sim.calculate("is_uc_eligible", period) - out["share_like_capital"] = sim.calculate("share_like_capital", YEAR) + for v in ("share_like_capital", WITH, WITHOUT): + out[v] = sim.calculate(v, YEAR) return out -def _assert_same_as_original(households): - # A projected year as well, where the inputs are uprated. - for period in (YEAR, f"{YEAR}-01", YEAR + 1, f"{YEAR + 1}-01"): - new = _results(households, period=period) - old = _results(households, reform=ORIGINAL_REFORM, period=period) - for variable in (*SOURCE_LISTS, "is_uc_eligible"): - assert np.array_equal(new[variable], old[variable]), (variable, period) - - -@pytest.mark.parametrize("variable", SOURCE_LISTS) -def test_lists_name_share_like_capital_only(variable): - sources = list(_parameter(SOURCE_LISTS[variable])) - assert "share_like_capital" in sources - assert "corporate_wealth" not in sources - assert not set(COMPONENTS) & set(sources) - # Every programme values shares less 10% for the expenses of sale (UC - # Regs 2013 reg. 49(1)(a) and the legacy equivalents), so its list of - # those sources names the same share-like variable, or shares would - # silently lose the deduction. - node = _node(SOURCE_LISTS[variable].rsplit(".", 1)[0]) - sale = list(node.sale_expenses.sources(f"{YEAR}-01-01")) - assert "share_like_capital" in sale +@pytest.mark.parametrize("variable", NODES) +def test_lists_name_the_two_parts(variable): + sources = list(_parameter(f"{NODES[variable]}.sources")) + sale = list(_parameter(f"{NODES[variable]}.sale_expenses.sources")) + assert WITH in sources and WITHOUT in sources + assert not {"corporate_wealth", "share_like_capital", *COMPONENTS} & set(sources) + assert WITH in sale and WITHOUT not in sale assert not {"corporate_wealth", *COMPONENTS} & set(sale) + # Deposit balances have no costs of sale (ADM H1607, H1675). + assert "cash_isa" in sources and not {"savings", "cash_isa"} & set(sale) + without = set(_parameter("gov.dwp.share_like_capital.without_sale_expenses")) + assert without == {"unit_and_investment_trusts", "stocks_and_shares_isa"} @SETTINGS @@ -135,81 +146,178 @@ def test_lists_name_share_like_capital_only(variable): max_size=40, ) ) -def test_share_like_capital_keeps_the_supplied_aggregate(rows): +# Subtracting trusts and ISA one at a time leaves £0.015625 here; grouped, nil. +@example([(399_999.984375, (0.0, 200_000.0, 199_999.984375), True)]) +# Trusts and ISA exceed corporate_wealth by float32 rounding: floored at nil. +@example([(16_000.0, (0.0, 8_000.01, 8_000.0), True)]) +def test_share_like_capital_and_its_parts(rows): households = [] for corporate_wealth, components, itemise in rows: assets = {"corporate_wealth": corporate_wealth} if itemise: assets |= dict(zip(COMPONENTS, components)) households.append(assets) - got = _results(households)["share_like_capital"] - for value, assets in zip(got, households): + got = _results(households) + for i, assets in enumerate(households): cw = np.float32(assets["corporate_wealth"]) - itemised = np.float32(0) - for component in COMPONENTS: - itemised = np.float32(itemised + np.float32(assets.get(component, 0))) + values = [np.float32(assets.get(c, 0)) for c in COMPONENTS] + # The engine's float32 grouping: components added left to right, the + # exempt holdings summed before they are subtracted. + itemised = np.float32(np.float32(values[0] + values[1]) + values[2]) + exempt = np.float32(values[1] + values[2]) tolerance = RELATIVE_TOLERANCE * max(abs(cw), itemised) + share_like = got["share_like_capital"][i] if itemised > 0 and itemised - cw > tolerance: - assert value == itemised # exactly the components' sum + assert share_like == itemised else: - assert value == cw # exactly the supplied aggregate + assert share_like == cw + if itemised == 0: + assert got[WITH][i] == share_like and got[WITHOUT][i] == 0 + else: + assert got[WITH][i] == max(np.float32(0), np.float32(share_like - exempt)) + assert got[WITHOUT][i] == np.float32(share_like - got[WITH][i]) -@SETTINGS -@given( - st.lists( - st.tuples(money, signed_money, st.tuples(money, money, money), st.booleans()), - min_size=1, - max_size=30, - ) -) -def test_capital_matches_the_original_lists(rows): - """Unsplit, or split consistently: identical to listing corporate_wealth.""" - households = [] - for savings, corporate_wealth, components, split in rows: - assets = {"savings": savings, "corporate_wealth": corporate_wealth} - if split: - assets |= dict(zip(COMPONENTS, components)) - assets["corporate_wealth"] = float(sum(components)) - households.append(assets) - _assert_same_as_original(households) +def test_float32_grouping_of_the_exempt_holdings(): + """Trusts and ISA summed first: corporate_wealth of £399,999.984375 and + £200,000 + £199,999.984375 of exempt holdings both round to £400,000 in + float32, so the part with sale expenses is nil; subtracting the two one at + a time would leave £0.015625.""" + households = [ + { + "corporate_wealth": 399_999.984375, + "unit_and_investment_trusts": 200_000, + "stocks_and_shares_isa": 199_999.984375, + } + ] + got = _results(households) + assert got[WITH][0] == 0 -def test_float32_rounding_at_the_limit_keeps_eligibility(): - """Components whose float32 sum overshoots £16,000 by a fraction of a penny.""" +def test_exempt_holdings_above_the_aggregate_by_rounding_leave_nil_with_expenses(): + """£8,000.01 of trusts and an £8,000 ISA add up in float32 to + £16,000.009765625, above £16,000 of corporate_wealth by less than a + millionth, so share_like_capital keeps the £16,000. Subtracting the exempt + holdings would leave -£0.009765625; the part with sale expenses stops at + nil, and the part without holds all £16,000.""" households = [ { - "savings": 0, "corporate_wealth": 16_000, - "directly_held_shares": 6_744.81, - "unit_and_investment_trusts": 6_581.24, - "stocks_and_shares_isa": 2_673.95, + "unit_and_investment_trusts": 8_000.01, + "stocks_and_shares_isa": 8_000, + } + ] + got = _results(households) + assert got["share_like_capital"][0] == 16_000 + assert got[WITH][0] == 0 and got[WITHOUT][0] == 16_000 + + +def test_an_empty_exempt_list_values_everything_less_10_percent(): + """A ruling that every share-like holding takes the 10% is a parameter edit.""" + reform = {"gov.dwp.share_like_capital.without_sale_expenses": {str(YEAR): []}} + households = [ + {"savings": 1_000, "corporate_wealth": 12_000}, + { + "savings": 1_000, + "directly_held_shares": 4_000, + "unit_and_investment_trusts": 3_000, + "stocks_and_shares_isa": 5_000, }, + ] + got = _results(households, reform=reform, age=30) + assert list(got[WITH]) == [12_000, 12_000] + assert list(got[WITHOUT]) == [0, 0] + # £1,000 + 90% of £12,000 either way. + assert got["uc_assessable_capital"] == pytest.approx([11_800, 11_800]) + + +def test_the_exempt_list_starts_with_the_first_capital_list(): + exempt = system.parameters.gov.dwp.share_like_capital.without_sale_expenses + first = min( + min(entry.instant_str for entry in _node(f"{node}.sources").values_list) + for node in NODES.values() + ) + assert first == "1996-10-07" + assert min(entry.instant_str for entry in exempt.values_list) == first + + +@pytest.mark.parametrize( + "variable", ["income_support_assessable_capital", "jsa_income_assessable_capital"] +) +def test_legacy_capital_before_universal_credit(variable): + """2012: the legacy lists apply, and so does the exempt list (from 1996).""" + situation = _situation([{"savings": 1_000, "corporate_wealth": 12_000}], age=30) + for entity in situation.values(): + for name, values in entity.items(): + for key, by_year in list(values.items()): + if isinstance(by_year, dict) and YEAR in by_year: + values[key] = {2012: by_year[YEAR]} + capital = Simulation(situation=situation).calculate(variable, 2012)[0] + assert capital == pytest.approx(11_800) + + +@SETTINGS +@given( + st.lists(st.tuples(money, signed_money), min_size=1, max_size=30), +) +def test_unitemised_inputs_match_the_lists_before_itemising(rows): + households = [{"savings": s, "corporate_wealth": cw} for s, cw in rows] + households += [ {"savings": 6_001, "corporate_wealth": -2}, - {"savings": 15_999.99, "corporate_wealth": 0.01}, + {"savings": 0, "corporate_wealth": 17_777.78}, # 90% is £16,000.002 ] - _assert_same_as_original(households) - assert _results(households)["share_like_capital"][0] == 16_000 + # A projected year as well, where the inputs are uprated. + for period in (YEAR, f"{YEAR}-01", YEAR + 1, f"{YEAR + 1}-01"): + new = _results(households, period=period) + old = _results(households, reform=UNITEMISED_REFORM, period=period) + for variable in (*NODES, "is_uc_eligible"): + assert np.array_equal(new[variable], old[variable]), (variable, period) -def test_one_unit_of_float32_rounding_above_a_power_of_two_keeps_the_aggregate(): - """Pence-valued components whose float32 sum lands one unit in the last place - (£0.00195) above £16,384.01: more than 1e-7 of the value, less than 1e-6.""" +@SETTINGS +@given( + st.lists(st.tuples(money, st.tuples(money, money, money)), min_size=1, max_size=30) +) +def test_a_consistent_split_exempts_trusts_and_isas(rows): households = [ { - "savings": 0, - "corporate_wealth": 16_384.01, - "directly_held_shares": 16_015.98, - "unit_and_investment_trusts": 286.98, - "stocks_and_shares_isa": 81.05, + "savings": savings, + "corporate_wealth": float(sum(components)), + **dict(zip(COMPONENTS, components)), } + for savings, components in rows ] - itemised = np.float32( - np.float32(np.float32(16_015.98) + np.float32(286.98)) + np.float32(81.05) - ) - assert itemised - np.float32(16_384.01) == np.float32(0.001953125) - assert _results(households)["share_like_capital"][0] == np.float32(16_384.01) - _assert_same_as_original(households) + new = _results(households, age=30) + old = _results(households, reform=UNITEMISED_REFORM, age=30) + for i, (_, (_, trusts, isa)) in enumerate(rows): + exempt = np.float32(trusts) + np.float32(isa) + assert new["uc_assessable_capital"][i] - old["uc_assessable_capital"][ + i + ] == pytest.approx(LEGAL_RATE * exempt, rel=1e-5, abs=0.05) + # Uprated separately in float32, the components still round to their + # aggregate in a projected year, so share-like capital is the aggregate. + sim = Simulation(situation=_situation(households, age=30)) + for year in (YEAR, YEAR + 1): + assert np.array_equal( + sim.calculate("share_like_capital", year), + sim.calculate("corporate_wealth", year), + ), year + + +def test_components_alone_are_valued_by_type(): + households = [ + { + "savings": 1_000, + "directly_held_shares": 4_000, + "unit_and_investment_trusts": 3_000, + "stocks_and_shares_isa": 5_000, + } + ] + got = _results(households, age=30) + assert got["share_like_capital"][0] == 12_000 + assert got[WITH][0] == 4_000 and got[WITHOUT][0] == 8_000 + # £1,000 + 90% of £4,000 + £3,000 + £5,000. + assert got["uc_assessable_capital"][0] == pytest.approx(12_600) def test_a_component_penny_at_the_limit_counts(): @@ -217,10 +325,10 @@ def test_a_component_penny_at_the_limit_counts(): as_component = [{"savings": 16_000, "directly_held_shares": 0.01}] as_aggregate = [{"savings": 16_000, "corporate_wealth": 0.01}] for period in (YEAR, f"{YEAR}-01"): - component = _results(as_component, period=period) - aggregate = _results(as_aggregate, period=period) + component = _results(as_component, period=period, age=30) + aggregate = _results(as_aggregate, period=period, age=30) assert component["share_like_capital"][0] == np.float32(0.01) - for variable in (*SOURCE_LISTS, "is_uc_eligible"): + for variable in (*NODES, "is_uc_eligible"): assert np.array_equal(component[variable], aggregate[variable]), variable assert not component["is_uc_eligible"][0] @@ -237,31 +345,63 @@ def test_a_genuine_excess_over_the_aggregate_counts(): assert _results(households)["share_like_capital"][0] == np.float32(16_000.10) -def test_components_alone_are_counted(): +def test_float32_rounding_at_the_limit_keeps_the_aggregate(): + """Components whose float32 sum overshoots £16,000 by a fraction of a + penny keep the aggregate; an unitemised penny at the limit counts as + before itemising.""" + split = [ + { + "corporate_wealth": 16_000, + "directly_held_shares": 6_744.81, + "unit_and_investment_trusts": 6_581.24, + "stocks_and_shares_isa": 2_673.95, + } + ] + itemised = np.float32( + np.float32(np.float32(6_744.81) + np.float32(6_581.24)) + np.float32(2_673.95) + ) + assert itemised > np.float32(16_000) + assert _results(split)["share_like_capital"][0] == 16_000 + unitemised = [ + {"savings": 15_999.99, "corporate_wealth": 0.01}, + {"savings": 6_001, "corporate_wealth": -2}, + ] + for period in (YEAR, f"{YEAR}-01"): + new = _results(unitemised, period=period) + old = _results(unitemised, reform=UNITEMISED_REFORM, period=period) + for variable in (*NODES, "is_uc_eligible"): + assert np.array_equal(new[variable], old[variable]), (variable, period) + + +def test_one_unit_of_float32_rounding_above_a_power_of_two_keeps_the_aggregate(): + """Pence-valued components whose float32 sum lands one unit in the last place + (£0.00195) above £16,384.01: more than 1e-7 of the value, less than 1e-6.""" households = [ { - "savings": 1_000, - "directly_held_shares": 4_000, - "unit_and_investment_trusts": 3_000, - "stocks_and_shares_isa": 5_000, + "corporate_wealth": 16_384.01, + "directly_held_shares": 16_015.98, + "unit_and_investment_trusts": 286.98, + "stocks_and_shares_isa": 81.05, } ] - got = _results(households) - assert got["share_like_capital"][0] == 12_000 - # Savings in full and shares less 10% for the expenses of sale (UC Regs - # 2013 reg. 49(1)(a)): 1,000 + 90% of 12,000. - assert got["uc_assessable_capital"][0] == 11_800 + itemised = np.float32( + np.float32(np.float32(16_015.98) + np.float32(286.98)) + np.float32(81.05) + ) + assert itemised - np.float32(16_384.01) == np.float32(0.001953125) + assert _results(households)["share_like_capital"][0] == np.float32(16_384.01) -def test_a_disregarded_company_holding_leaves_the_capital_that_counts_it(): - """UC reg 77(2): a holding entered as an itemised component leaves the - pool as one entered within corporate_wealth does. Two unreported adults - share £10,000 of savings once the owner's £30,000 holding is disregarded.""" +def test_a_disregarded_company_holding_leaves_the_part_with_sale_expenses(): + """UC reg 77(2): the owner's £30,000 holding leaves the pool at the 90% its + shares are counted at, whether it was entered within corporate_wealth or + as directly held shares. Two unreported adults share £10,000 of savings.""" from policyengine_uk.variables.gov.dwp.universal_credit.household_uc_company_holding_pool_scale import ( HOLDINGS_SOURCE, ) - assert HOLDINGS_SOURCE in _parameter(SOURCE_LISTS["uc_assessable_capital"]) + node = NODES["uc_assessable_capital"] + assert HOLDINGS_SOURCE in _parameter(f"{node}.sources") + assert HOLDINGS_SOURCE in _parameter(f"{node}.sale_expenses.sources") for shares in ({"corporate_wealth": 30_000}, {"directly_held_shares": 30_000}): situation = { "people": { @@ -287,7 +427,98 @@ def test_a_disregarded_company_holding_leaves_the_capital_that_counts_it(): } sim = Simulation(situation=situation) assert sim.calculate("household_uc_company_holding_pool_scale", YEAR)[0] == 1 - # The pool counts the shares at 90% (reg. 49(1)(a)), so the holding - # leaves it at that value. + # The pool counts the shares at 90%, and the holding leaves it at that. assert sim.calculate("household_uc_pool_company_holdings", YEAR)[0] == 27_000 assert list(sim.calculate("uc_assessable_capital", YEAR)) == [5_000, 5_000] + + +ROUNDS_DOWN = { + "uc_assessable_capital": False, + "housing_benefit_assessable_capital": False, + "income_support_assessable_capital": True, + "jsa_income_assessable_capital": True, + "esa_income_assessable_capital": True, + "pension_credit_assessable_capital": True, +} +pennies = st.integers(min_value=0, max_value=2_000_000) + + +@settings( + max_examples=10, + deadline=None, + derandomize=True, + suppress_health_check=[HealthCheck.too_slow, HealthCheck.data_too_large], +) +@given( + st.lists( + st.tuples( + pennies, + pennies, + pennies, + pennies, + pennies, + st.sampled_from([30, 70]), + st.booleans(), + ), + min_size=1, + max_size=20, + ) +) +# £1,000 of savings, £3,000 in a cash ISA, £3,000 of unit trusts and a £5,000 +# stocks-and-shares ISA in full, and 90% of £4,000 of shares: £15,600. +@example([(100_000, 300_000, 400_000, 300_000, 500_000, 30, False)]) +# Income Support counts £16,834.13 here. The engine gives £16,834.12, held +# in float32 as 16,834.119: £0.0109 under, or £0.0117 when the comparison +# itself runs in float32. +@example([(510_510, 1_046_019, 2_051, 437, 124_602, 30, True)]) +# Income Support counts £37,747.34 here, and the engine holds £37,747.33 as +# 37,747.328: £0.0119 under, a penny plus half of float32's step at that +# size (£0.0039). +@example([(1_813_184, 40_164, 988_571, 7_260, 1_024_413, 30, False)]) +def test_itemised_holdings_are_valued_by_type_in_every_means_test(rows): + """Given only itemised holdings, with the ISAs held as the person's own + balances, every means test counts savings, a cash ISA, unit trusts and a + stocks-and-shares ISA in full and directly held shares less 10%, rounded + by the programme's rule. The engine adds the holdings in float32, which + can move the shares' value by a fraction of a penny before valuation, so + each total is checked to within a penny plus float32's step at that + size.""" + people, benunits, homes = {}, {}, {} + for i, (savings, cash_isa, shares, trusts, isa, age, claims_uc) in enumerate(rows): + people[f"p{i}"] = { + "age": {YEAR: age}, + "cash_isa_balance": {YEAR: cash_isa / 100}, + "stocks_and_shares_isa_balance": {YEAR: isa / 100}, + } + benunits[f"b{i}"] = { + "members": [f"p{i}"], + "would_claim_uc": {YEAR: claims_uc}, + } + homes[f"h{i}"] = { + "members": [f"p{i}"], + "savings": {YEAR: savings / 100}, + "directly_held_shares": {YEAR: shares / 100}, + "unit_and_investment_trusts": {YEAR: trusts / 100}, + } + sim = Simulation( + situation={"people": people, "benunits": benunits, "households": homes} + ) + passported = sim.calculate("housing_benefit_on_passporting_benefit", YEAR) + for variable, round_down in ROUNDS_DOWN.items(): + values = sim.calculate(variable, YEAR) + for i, (savings, cash_isa, shares, trusts, isa, age, _) in enumerate(rows): + if variable == "pension_credit_assessable_capital": + if age < 67: + continue + elif age >= 67 or ( + variable == "housing_benefit_assessable_capital" and passported[i] + ): + continue + share_pence = (9 * shares + (0 if round_down else 5)) // 10 + expected = (savings + cash_isa + trusts + isa + share_pence) / 100 + tolerance = 0.01 + float(np.spacing(np.float32(expected))) + assert abs(float(values[i]) - expected) <= tolerance, ( + variable, + rows[i], + values[i], + ) diff --git a/policyengine_uk/tests/test_capital_valuation_properties.py b/policyengine_uk/tests/test_capital_valuation_properties.py index ed2dfec1c7..6ea388515d 100644 --- a/policyengine_uk/tests/test_capital_valuation_properties.py +++ b/policyengine_uk/tests/test_capital_valuation_properties.py @@ -7,7 +7,9 @@ Regs 1987 reg. 49; JSA Regs 1996 reg. 111; ESA Regs 2008 reg. 113; SPC Regs 2002 reg. 19). A bank or building society account is valued at its balance (ADM H1675); land and property always have costs of sale (H1606) and shares -are valued less 10% (H1665). +are valued less 10% (H1665). The households here hold share-like wealth only +as unitemised corporate_wealth, which all takes the 10%; itemised holdings +(unit trusts and ISAs without it) are tested in test_capital_share_components. Invariants, for any generated population of single-adult households: @@ -78,13 +80,14 @@ } PENSION_AGE_ONLY = {"pension_credit_assessable_capital"} # The assets whose sale incurs expenses, fixed here from the law rather than -# read from the parameters: real property always (ADM H1606), shares (H1665); -# never a bank or building society balance (H1675). +# read from the parameters: real property always (ADM H1606), shares (H1665), +# and unitemised corporate wealth with them; never a bank or building society +# balance (H1675). SALE_EXPENSE_ASSETS = { "owned_land", "other_residential_property_value", "non_residential_property_value", - "share_like_capital", + "share_like_capital_with_sale_expenses", } LEGAL_RATE = 0.1 ASSETS = [ @@ -97,12 +100,16 @@ ] # Ordinary savings and a cash ISA are both deposit balances, counted in full. CASH_ASSETS = ("savings", "cash_isa") -# The capital sources count shares as share_like_capital, which is the -# corporate_wealth these households are given. -INPUT_OF = {"share_like_capital": "corporate_wealth"} +# The capital sources count shares in share_like_capital's two parts. These +# households hold share-like wealth only as unitemised corporate_wealth, so +# all of it is in the part with expenses of sale and none is without. +INPUT_OF = {"share_like_capital_with_sale_expenses": "corporate_wealth"} +NIL_SOURCES = {"share_like_capital_without_sale_expenses"} def asset(unit, source): + if source in NIL_SOURCES: + return 0.0 return unit["assets"][INPUT_OF.get(source, source)] @@ -221,6 +228,14 @@ def check_valuation(units): assert node.sale_expenses.rate == LEGAL_RATE assert "savings" in node.sources counted = set(node.sources) + # Every name on the sale-expense list must be a counted source: + # valued_capital values only the names in node.sources, so it never + # values a listed name outside them, and the intersection check below + # can't see one. + assert set(node.sale_expenses.sources) <= counted, ( + variable, + sorted(set(node.sale_expenses.sources) - counted), + ) assert set(node.sale_expenses.sources) & counted == ( SALE_EXPENSE_ASSETS & counted ), variable diff --git a/policyengine_uk/tests/test_isa_balances.py b/policyengine_uk/tests/test_isa_balances.py index e5a28362aa..9e98ba3004 100644 --- a/policyengine_uk/tests/test_isa_balances.py +++ b/policyengine_uk/tests/test_isa_balances.py @@ -3,12 +3,14 @@ Datasets built before the per-person balances existed store only the household totals. Those totals must keep their stored values, projected with savings, rather than fall to the sum of balances the dataset does not have. +Every means test counts both kinds of ISA at their withdrawal value, without +the 10% for expenses of sale. """ import pandas as pd import pytest -from policyengine_uk import Microsimulation +from policyengine_uk import Microsimulation, Simulation from policyengine_uk.data.dataset_schema import UKSingleYearDataset @@ -59,15 +61,17 @@ def test_stored_household_totals_without_person_balances_project_with_savings(): shares = simulation.calculate("stocks_and_shares_isa", 2027).values[0] assert cash == pytest.approx(3_000.0 * growth) assert shares == pytest.approx(2_000.0 * growth) - # Savings and the cash ISA reach the capital pool at their value. The - # stocks-and-shares ISA reaches it through share_like_capital, which - # Universal Credit values less its sale-expense rate until the data - # separate ISAs from shares. - rate = simulation.tax_benefit_system.parameters( - "2027-04-06" - ).gov.dwp.universal_credit.means_test.capital.sale_expenses.rate + # Savings, the cash ISA and the stocks-and-shares ISA all reach the + # capital pool at their value: an ISA is valued at what its holder would + # get by withdrawing it (ADM H1656), which says nothing about costs of + # sale, so the itemised ISA sits in the part of share_like_capital + # without them. + without = simulation.calculate("share_like_capital_without_sale_expenses", 2027) + with_expenses = simulation.calculate("share_like_capital_with_sale_expenses", 2027) + assert without.values[0] == pytest.approx(2_000.0 * growth) + assert with_expenses.values[0] == 0 capital = simulation.calculate("uc_assessable_capital", 2027).values[0] - expected = (1_000.0 + 3_000.0 + 2_000.0 * (1 - rate)) * growth + expected = (1_000.0 + 3_000.0 + 2_000.0) * growth assert capital == pytest.approx(expected, rel=1e-5) @@ -91,3 +95,59 @@ def test_household_totals_sum_the_person_balances_in_every_year(): household_shares = simulation.calculate("stocks_and_shares_isa", year) assert household_cash == pytest.approx(cash.sum()) assert household_shares.values[0] == pytest.approx(shares.sum()) + + +def _isa_situation(age, period, **person): + """One adult with £1,000 of savings and the given person-level balances.""" + return { + "people": { + "person": { + "age": {period: age}, + **{name: {period: value} for name, value in person.items()}, + } + }, + "benunits": { + "benunit": {"members": ["person"], "would_claim_uc": {period: False}} + }, + "households": { + "household": {"members": ["person"], "savings": {period: 1_000.0}} + }, + } + + +@pytest.mark.parametrize( + "variable, age, period", + [ + ("uc_assessable_capital", 30, 2026), + ("housing_benefit_assessable_capital", 30, 2026), + # Income Support's capital list applies to a working-age claimant + # before Universal Credit replaced it. + ("income_support_assessable_capital", 30, 2021), + ("jsa_income_assessable_capital", 30, 2026), + ("esa_income_assessable_capital", 40, 2026), + ("pension_credit_assessable_capital", 70, 2026), + ], +) +def test_person_isa_balances_count_in_full_in_every_means_test(variable, age, period): + """Neither a cash ISA nor a stocks-and-shares ISA takes the 10% for + expenses of sale: each is valued at its withdrawal value (ADM H1656; DMG + 29662, 52662, 84748). £1,000 + £3,000 + £2,000 = £6,000, where the 10% + on the stocks-and-shares ISA would give £5,800.""" + simulation = Simulation( + situation=_isa_situation( + age, + period, + cash_isa_balance=3_000.0, + stocks_and_shares_isa_balance=2_000.0, + ) + ) + assert simulation.calculate("stocks_and_shares_isa", period)[0] == 2_000 + assert simulation.calculate("share_like_capital_without_sale_expenses", period)[ + 0 + ] == pytest.approx(2_000) + assert simulation.calculate("share_like_capital_with_sale_expenses", period)[0] == 0 + if variable == "housing_benefit_assessable_capital": + assert not simulation.calculate( + "housing_benefit_on_passporting_benefit", period + )[0] + assert simulation.calculate(variable, period)[0] == pytest.approx(6_000, abs=0.01) diff --git a/policyengine_uk/tests/test_person_isa_capital.py b/policyengine_uk/tests/test_person_isa_capital.py index 5ab33ba7e3..669c441b9a 100644 --- a/policyengine_uk/tests/test_person_isa_capital.py +++ b/policyengine_uk/tests/test_person_isa_capital.py @@ -18,10 +18,14 @@ Credit holders outside a pension-age unit), equals savings, cash_isa and share_like_capital together, up to float32 rounding of the remainder's shares and each programme's penny rounding. Each programme values - share_like_capital, and each stocks and shares ISA it moves out of it, at - its sale-expense share (90%), and savings and cash ISAs at face value. Where balances exceed a total, the holdings sum to it exactly, so - that source leaves nothing in the remainder: an adult with no ISA counts - exactly the capital they count without the other members' ISAs. + share_like_capital_with_sale_expenses (directly held shares, and all of + an unitemised corporate_wealth) at its sale-expense share (90%), and + share_like_capital_without_sale_expenses (unit and investment trusts and + stocks and shares ISAs), each stocks and shares ISA it moves out of that + part, savings and cash ISAs at face value. Where balances exceed a total, + the holdings sum to it exactly, so that source leaves nothing in the + remainder: an adult with no ISA counts exactly the capital they count + without the other members' ISAs. 2. Where the balances' stored sum exceeds the total, the holdings sum to the total exactly, each in proportion to its balance within the step invariant 7 gives; otherwise each member counts their balance exactly. @@ -83,6 +87,10 @@ } MEANS_TEST_CAPITAL = (*CAPITAL, "council_tax_reduction_assessable_capital") ISA_SOURCES = tuple(HOUSEHOLD_SOURCE_OF) +SHARE_LIKE_PARTS = ( + "share_like_capital_with_sale_expenses", + "share_like_capital_without_sale_expenses", +) BALANCE = { "cash_isa_countable_capital": "cash_isa_balance", "stocks_and_shares_isa_countable_capital": "stocks_and_shares_isa_balance", @@ -394,12 +402,12 @@ def test_household_only_data_keep_todays_capital(): assert np.array_equal( simulation.calculate(name, year), before.calculate(name, year) ), (name, year) - # The first household's pool: savings 3,000, cash_isa 4,000 and - # corporate_wealth 5,000 (which holds the 2,000 ISA) less 10%, 4,500, - # shared by three claimants, two of them the couple. UC rounds each to - # the nearest penny. + # The first household's pool: savings 3,000, cash_isa 4,000, and + # corporate_wealth 5,000, which holds the 2,000 ISA at face value and + # 3,000 of other shares less 10%, 2,700: 11,700 shared by three + # claimants, two of them the couple. uc = simulation.calculate("uc_assessable_capital", YEAR) - assert list(uc[:2]) == pytest.approx([7_666.67, 3_833.33], abs=0.001) + assert list(uc[:2]) == pytest.approx([7_800, 3_900], abs=0.001) def test_both_forms_in_one_dataset_add_up_to_the_stored_total(): @@ -492,11 +500,20 @@ def test_both_forms_in_one_dataset_add_up_to_the_stored_total(): ] -def _household_capital(simulation, year, share=1): +def _household_capital(simulation, year, variable=None): + """Savings, cash ISAs and share-like capital, as ``variable`` values them. + + With no ``variable``, at market value. + """ + share_like = sum( + (_share_counted(variable, part) if variable else 1) + * simulation.calculate(part, year) + for part in SHARE_LIKE_PARTS + ) return ( simulation.calculate("savings", year) + simulation.calculate("cash_isa", year) - + share * simulation.calculate("share_like_capital", year) + + share_like ) @@ -522,23 +539,20 @@ def test_person_balances_without_household_totals_count_with_their_holders(): simulation.calculate("share_like_capital", year), simulation.calculate("corporate_wealth", year), ) - holdings = _household_capital( - simulation, year, _share_counted("uc_assessable_capital") - ) + holdings = _household_capital(simulation, year, "uc_assessable_capital") uc = simulation.calculate("uc_assessable_capital", year) assert np.bincount(benunit_household, weights=uc) == pytest.approx( holdings, rel=1e-6 ) - # Savings 7,000 and 2,000 of non-ISA shares less 10%, 1,800, make the - # first pool, 2,933.33 for each claimant. The couple adds a 3,000 cash ISA - # and a 2,000 stocks and shares ISA less 10% (1,800), and the other unit a - # 5,000 cash ISA and a 1,000 one less 10% (900). The second pool, savings - # 12,000 and 3,000 of trusts less 10% (2,700), gives the parents 9,800 - # and their son 4,900 in UC, to which they add 4,000 and 5,400 of ISAs; - # the pension-age parents count all 14,700 and their 4,000 in Pension - # Credit. UC rounds to the nearest penny, and the legacy programmes - # round down. - expected_uc = [10_666.67, 8_833.33, 13_800, 10_300] + # Savings 7,000, 1,500 of directly held shares less 10%, 1,350, and 500 + # of trusts at face value make the first pool, 2,950 for each claimant. + # The couple adds a 3,000 cash ISA and a 2,000 stocks and shares ISA, and + # the other unit a 5,000 cash ISA and a 1,000 stocks and shares ISA, all + # at face value. The second pool, savings 12,000 and 3,000 of trusts, + # gives the parents 10,000 and their son 5,000 in UC, to which they add + # 4,000 and 6,000 of ISAs; the pension-age parents count all 15,000 and + # their 4,000 in Pension Credit. + expected_uc = [10_900, 8_950, 14_000, 11_000] assert list(simulation.calculate("uc_assessable_capital", YEAR)) == pytest.approx( expected_uc, abs=0.001 ) @@ -548,7 +562,7 @@ def test_person_balances_without_household_totals_count_with_their_holders(): assert list(capital[:2]) == pytest.approx(expected_uc[:2], abs=0.011), name assert list( simulation.calculate("pension_credit_assessable_capital", YEAR) - ) == pytest.approx([0, 0, 18_700, 0], abs=0.001) + ) == pytest.approx([0, 0, 19_000, 0], abs=0.001) # One benefit unit each, with a child: the adults' cash and stocks and shares @@ -726,35 +740,31 @@ def _check_counted_isas(simulation): return counted -def _share_counted(variable): - """The share of share_like_capital's market value ``variable`` counts. +def _share_counted(variable, source): + """The share of household ``source``'s market value ``variable`` counts. - The programme counts share_like_capital, and each stocks and shares ISA - balance it moves out of it, less its sale-expense rate where its - ``sale_expenses.sources`` lists share_like_capital. + The programme counts ``source``, and each person ISA it moves out of it, + less its sale-expense rate where its ``sale_expenses.sources`` lists + ``source``. """ capital = _node(CAPITAL[variable]) date = f"{YEAR}-01-01" - if "share_like_capital" in capital.sale_expenses.sources(date): + if source in capital.sale_expenses.sources(date): return 1 - capital.sale_expenses.rate(date) return 1 -# The share of each ISA person source's value a programme counts, given the -# share it counts of share_like_capital. -def _isa_shares(share): +# The share of each ISA person source's value a programme counts: the share +# it counts of the household source that holds it. +def _isa_shares(variable): return { - "cash_isa_countable_capital": 1, - "stocks_and_shares_isa_countable_capital": share, + source: _share_counted(variable, HOUSEHOLD_SOURCE_OF[source]) + for source in ISA_SOURCES } -def _holdings(simulation, share=1): - return ( - simulation.calculate("savings", YEAR) - + simulation.calculate("cash_isa", YEAR) - + share * simulation.calculate("share_like_capital", YEAR) - ) +def _holdings(simulation, variable=None): + return _household_capital(simulation, YEAR, variable) @SITUATION_SETTINGS @@ -775,8 +785,7 @@ def test_a_pound_counts_once_in_working_age_means_tests(units, holdings): "jsa_income_assessable_capital", "esa_income_assessable_capital", ): - share = _share_counted(name) - weights = _isa_shares(share) + weights = _isa_shares(name) uncounted = sum( (weights[source] * amount * dependants).sum() for source, amount in counted.items() @@ -785,7 +794,7 @@ def test_a_pound_counts_once_in_working_age_means_tests(units, holdings): # Float32 shares of the remainder, and each valuation's penny # rounding, come to within a few pence. assert capital.sum() + uncounted == pytest.approx( - _holdings(simulation, share)[0], rel=1e-5, abs=0.05 + _holdings(simulation, name)[0], rel=1e-5, abs=0.05 ), name # Each unit counts at least its own claimant's and partner's ISAs. own = sum( @@ -901,8 +910,7 @@ def test_a_pound_counts_once_in_pension_credit(households): > 0 ) counts = simulation.calculate("is_claimant_or_partner", YEAR) & in_pension_unit - share = _share_counted("pension_credit_assessable_capital") - weights = _isa_shares(share) + weights = _isa_shares("pension_credit_assessable_capital") uncounted = sum( _by_household(simulation, "person", weights[source] * amount * ~counts) for source, amount in counted.items() @@ -911,7 +919,9 @@ def test_a_pound_counts_once_in_pension_credit(households): # Float32 shares of the remainder, and each valuation's penny rounding, # come to within a few pence. assert _by_household(simulation, "benunit", capital) + uncounted == pytest.approx( - _holdings(simulation, share), rel=1e-5, abs=0.05 + _holdings(simulation, "pension_credit_assessable_capital"), + rel=1e-5, + abs=0.05, ) if households is STORED_TOTALS: # The last household's ISA holdings sum exactly to its totals, so its @@ -1075,28 +1085,30 @@ def test_reforms_to_either_list_keep_each_isa_with_its_household_source(): def capital(name): return list(simulation.calculate(name, YEAR)) - # The lodger's unit counts the 10,000 cash ISA and the 4,000 stocks and - # shares ISA less 10% (3,600), and half the 2,000 of savings. - assert capital("uc_assessable_capital") == [1_000, 14_600] - assert capital("housing_benefit_assessable_capital") == [1_000, 14_600] + # The lodger's unit counts the 10,000 cash ISA, the 4,000 stocks and + # shares ISA at face value, and half the 2,000 of savings. + assert capital("uc_assessable_capital") == [1_000, 15_000] + assert capital("housing_benefit_assessable_capital") == [1_000, 15_000] sources = list(_node(uc_path + ".sources")(f"{YEAR}-01-01")) # Dropping cash_isa from UC's sources: savings 2,000 shared, and the - # lodger keeps their stocks and shares ISA less 10%. Dropping - # share_like_capital: the 10,000 cash ISA stays theirs. + # lodger keeps their stocks and shares ISA. Dropping + # share_like_capital_without_sale_expenses, which holds that ISA: the + # 10,000 cash ISA stays theirs. for dropped, expected in ( - ("cash_isa", [1_000, 4_600]), - ("share_like_capital", [1_000, 11_000]), + ("cash_isa", [1_000, 5_000]), + ("share_like_capital_without_sale_expenses", [1_000, 11_000]), ): + assert dropped in sources, dropped kept = [name for name in sources if name != dropped] with _law(simulation, uc_path + ".sources", kept): assert capital("uc_assessable_capital") == expected, dropped # Emptying UC's person_sources returns both ISAs to the pool: savings - # 2,000, the cash ISA and the stocks and shares ISA less 10%, 15,600 in - # all, shared by two claimants. Housing Benefit keeps its own lists. + # 2,000 and the two ISAs, 16,000 in all, shared by two claimants. + # Housing Benefit keeps its own lists. with _law(simulation, uc_path + ".person_sources", []): - assert capital("uc_assessable_capital") == [7_800, 7_800] - assert capital("housing_benefit_assessable_capital") == [1_000, 14_600] - assert capital("uc_assessable_capital") == [1_000, 14_600] + assert capital("uc_assessable_capital") == [8_000, 8_000] + assert capital("housing_benefit_assessable_capital") == [1_000, 15_000] + assert capital("uc_assessable_capital") == [1_000, 15_000] @pytest.mark.parametrize("variable", CAPITAL) diff --git a/policyengine_uk/tests/test_stock_capital_periods.py b/policyengine_uk/tests/test_stock_capital_periods.py index eead7689d9..92d4d82100 100644 --- a/policyengine_uk/tests/test_stock_capital_periods.py +++ b/policyengine_uk/tests/test_stock_capital_periods.py @@ -57,3 +57,40 @@ def test_pension_credit_capital_stocks_are_not_prorated_monthly(): simulation.calculate("pension_credit_assessable_capital", "2026-01")[0] == 33_600 ) + + +def test_itemised_share_like_stocks_are_not_prorated_monthly(): + stocks = { + "savings": 1_000, + "corporate_wealth": 12_000, + "directly_held_shares": 4_000, + "unit_and_investment_trusts": 3_000, + "stocks_and_shares_isa": 2_000, + } + for age, capital in ( + (30, "uc_assessable_capital"), + (70, "pension_credit_assessable_capital"), + ): + situation = { + "people": {"person": {"age": {"2026": age}}}, + "benunits": {"benunit": {"members": ["person"]}}, + "households": { + "household": { + "members": ["person"], + **{name: {"2026": value} for name, value in stocks.items()}, + } + }, + } + simulation = Simulation(situation=situation) + + for name, value in stocks.items(): + assert simulation.calculate(name, "2026-01")[0] == value, name + # 12,000 less the unit trusts and ISA (5,000): the 4,000 of shares + # and the 3,000 not itemised. + assert simulation.calculate("share_like_capital_with_sale_expenses", "2026-01")[ + 0 + ] == (7_000) + # Shares and the part not itemised less 10% for the expenses of + # sale; unit trusts and the ISA at their withdrawal value: + # 1,000 + 90% of 7,000 + 3,000 + 2,000 = 1,000 + 6,300 + 5,000. + assert simulation.calculate(capital, "2026-01")[0] == 12_300, capital diff --git a/policyengine_uk/tests/test_stored_household_totals.py b/policyengine_uk/tests/test_stored_household_totals.py index da9a7e7ab3..265999eaf3 100644 --- a/policyengine_uk/tests/test_stored_household_totals.py +++ b/policyengine_uk/tests/test_stored_household_totals.py @@ -216,25 +216,20 @@ def test_stored_household_totals_grow_past_the_projection_horizon(): assert totals[year][0] == pytest.approx( totals[PROJECTION_END_YEAR][0] * growth, rel=1e-6 ) - # Savings, the cash ISA and the stocks-and-shares ISA make up the capital. - # Savings and the cash ISA count at their value. The stocks-and-shares ISA - # reaches the capital through share_like_capital, which Universal Credit - # values less its sale-expense rate (Universal Credit Regulations 2013 - # reg. 49(1)(a)). The parts grow alike, so capital keeps the same ratio to - # savings in every year: 5.8 for this household. + # Savings, the cash ISA and the stocks-and-shares ISA make up the capital, + # each at its value. A decision maker values an ISA at what its holder + # would get by withdrawing it (ADM H1656), which says nothing about costs + # of sale, so the stored stocks-and-shares ISA reaches the capital through + # share_like_capital_without_sale_expenses. The parts grow alike, so + # capital keeps the same ratio to savings in every year: 6 for this + # household. cash_isa = _values(simulation, "cash_isa") shares_isa = _values(simulation, "stocks_and_shares_isa") ratio = capital[DATA_YEAR][0] / savings[DATA_YEAR][0] for year in YEARS: - rate = simulation.tax_benefit_system.parameters( - period(year).start - ).gov.dwp.universal_credit.means_test.capital.sale_expenses.rate - expected = ( - savings[year][0] + cash_isa[year][0] + shares_isa[year][0] * (1 - rate) - ) - assert capital[year][0] == pytest.approx(expected, rel=1e-5), year face_value = savings[year][0] + cash_isa[year][0] + shares_isa[year][0] - assert capital[year][0] < face_value - 0.01, year + assert capital[year][0] == pytest.approx(face_value, rel=1e-5), year + assert capital[year][0] == pytest.approx(6 * savings[year][0], rel=1e-5), year assert capital[year][0] == pytest.approx(ratio * savings[year][0], rel=1e-5) diff --git a/policyengine_uk/variables/gov/dwp/_person_capital_pool.py b/policyengine_uk/variables/gov/dwp/_person_capital_pool.py index 94683e99d6..4358e94f89 100644 --- a/policyengine_uk/variables/gov/dwp/_person_capital_pool.py +++ b/policyengine_uk/variables/gov/dwp/_person_capital_pool.py @@ -4,13 +4,15 @@ # The formulas map each person source to the household source that already # includes it, subtract its stored household sum, and allocate the remainder. -# cash_isa includes each cash ISA balance, and share_like_capital each stocks -# and shares ISA balance (through stocks_and_shares_isa, inside +# cash_isa includes each cash ISA balance, and +# share_like_capital_without_sale_expenses each stocks and shares ISA balance +# (through stocks_and_shares_isa, which gov.dwp.share_like_capital +# .without_sale_expenses lists, and which share_like_capital holds inside # corporate_wealth or the itemised sum). No household source includes a person # source missing here, such as a Lifetime ISA. HOUSEHOLD_SOURCE_OF = { "cash_isa_countable_capital": "cash_isa", - "stocks_and_shares_isa_countable_capital": "share_like_capital", + "stocks_and_shares_isa_countable_capital": "share_like_capital_without_sale_expenses", } diff --git a/policyengine_uk/variables/gov/dwp/stocks_and_shares_isa_countable_capital.py b/policyengine_uk/variables/gov/dwp/stocks_and_shares_isa_countable_capital.py index 38e90fab4d..06de09029a 100644 --- a/policyengine_uk/variables/gov/dwp/stocks_and_shares_isa_countable_capital.py +++ b/policyengine_uk/variables/gov/dwp/stocks_and_shares_isa_countable_capital.py @@ -12,8 +12,11 @@ class stocks_and_shares_isa_countable_capital(Variable): "investor beneficially owns an ordinary ISA's investments, and the named child " "owns a junior ISA's investments. The household's share_like_capital already " "includes the balance, through stocks_and_shares_isa within corporate_wealth " - "or the itemised sum, so each means test subtracts it from the household pool " - "before allocating the pool between benefit units. The formula bounds the " + "or the itemised sum, and its part without sale expenses " + "(share_like_capital_without_sale_expenses) holds it, since " + "gov.dwp.share_like_capital.without_sale_expenses lists stocks_and_shares_isa. " + "Each means test subtracts the balance from that part before allocating the " + "pool between benefit units, and counts it at face value. The formula bounds the " "person's balance by the smaller of stocks_and_shares_isa and " "share_like_capital, so the household never counts more stocks and shares ISA " "than it holds. When the household's stored balance sum exceeds that total, it " diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_company_holding_pool_scale.py b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_company_holding_pool_scale.py index c208ec85f1..5f676f005f 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_company_holding_pool_scale.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_company_holding_pool_scale.py @@ -1,8 +1,9 @@ from policyengine_uk.model_api import * -# The capital source that holds a disregarded company holding: the share-like -# capital the UC financial pool counts, so holdings are budgeted against it. -HOLDINGS_SOURCE = "share_like_capital" +# The capital source that holds a disregarded company holding: a holding is +# shares in a company, which have expenses of sale, so it sits in that part of +# the share-like capital the UC financial pool counts and is budgeted against it. +HOLDINGS_SOURCE = "share_like_capital_with_sale_expenses" class household_uc_company_holding_pool_scale(Variable): @@ -12,10 +13,10 @@ class household_uc_company_holding_pool_scale(Variable): documentation = ( "Common proportional scale for disregarded company holdings when " "deducting them from the household financial pool. Before budgeting, " - "clip each person's holding to [0, max(0, share_like_capital)], mapping " + "clip each person's holding to [0, max(0, share_like_capital_with_sale_expenses)], mapping " "positive infinity to the upper bound and negative infinity to zero. " "Total bounded holdings " - "share one budget of nonnegative share_like_capital (the share-like " + "share one budget of nonnegative share_like_capital_with_sale_expenses (the share-like " "capital the pool counts) across override " "floors and separate pool deductions. This allocation is independent " "of row order and treats holders equally. It is a defensive rule for " diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_pool_company_holdings.py b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_pool_company_holdings.py index 24f7db19eb..fed3c75aff 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_pool_company_holdings.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_pool_company_holdings.py @@ -34,12 +34,13 @@ class household_uc_pool_company_holdings(Variable): "any part of a disregarded holding. A financial report below its " "holder's known holding still consumes the holding at its counted " "value (household_uc_reported_financial_capital), so no report leaves " - "a holding in the residual pool. A holding " - "is shares, held within the household's share_like_capital. Each " - "person's holding is first clipped to [0, max(0, share_like_capital)], " + "a holding in the residual pool. A holding is shares, which have " + "expenses of sale, held within the household's " + "share_like_capital_with_sale_expenses. Each person's holding is first " + "clipped to [0, max(0, share_like_capital_with_sale_expenses)], " "with positive infinity mapped to the upper bound and negative infinity " "to zero before any multiplication. All household holdings then share " - "one nonnegative share_like_capital budget " + "one nonnegative share_like_capital_with_sale_expenses budget " "through household_uc_company_holding_pool_scale: when their total " "exceeds it, scale each person's holding proportionally before " "either the override floor or this deduction. This is a defensive " @@ -47,7 +48,8 @@ class household_uc_pool_company_holdings(Variable): "shared budget prevents holdings from removing ordinary savings or " "property. It does not change regulation 77 substitution in the " "owner's own assessment. The holdings leave the pool at the value at " - "which the pool counts share_like_capital: 90% where regulation 49(1)(a) " + "which the pool counts the shares that hold them " + "(share_like_capital_with_sale_expenses): 90% where regulation 49(1)(a) " "deducts 10% for the expenses of selling shares." ) definition_period = YEAR @@ -73,7 +75,7 @@ def formula(household, period, parameters): * person.household("household_uc_company_holding_pool_scale", period) * ~off_reported_capital ) - # The holdings sit in share_like_capital, which the pool counts at the + # The holdings sit in HOLDINGS_SOURCE, which the pool counts at the # reg. 49(1) value, so they leave it at that value. p = parameters(period).gov.dwp.universal_credit.means_test.capital return round_to_penny( diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_reported_financial_capital.py b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_reported_financial_capital.py index f8fea0f06c..5733b684a5 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_reported_financial_capital.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/household_uc_reported_financial_capital.py @@ -21,13 +21,13 @@ class household_uc_reported_financial_capital(Variable): "replaces ordinary sources before regulation 77 company substitution, " "so it includes its claimant's and partner's disregarded holdings. " "Consume the larger of the override and those holdings after applying " - "household_uc_company_holding_pool_scale and valuing them as " - "share_like_capital is valued (90% under regulation 49(1)). Each " - "person's holding is " - "first clipped to [0, max(0, share_like_capital)], with positive infinity " + "household_uc_company_holding_pool_scale and valuing them as the " + "shares that hold them are valued (90% under regulation 49(1)). Each " + "person's holding is first clipped to [0, max(0, " + "share_like_capital_with_sale_expenses)], with positive infinity " "mapped to the upper bound and negative infinity to zero before any " - "multiplication. All household holdings share " - "one nonnegative share_like_capital budget: if their total exceeds it, " + "multiplication. All household holdings share one nonnegative " + "share_like_capital_with_sale_expenses budget: if their total exceeds it, " "scale each person's holding proportionally before either this " "override floor or the separate pool deduction. This is a defensive " "rule for inconsistent inputs, not a statutory determination. " @@ -63,7 +63,7 @@ def formula(household, period, parameters): own_holdings = person.benunit.sum( bounded_holdings * person("is_uc_claimant", period) ) * person.household("household_uc_company_holding_pool_scale", period) - # The pool counts share_like_capital, and the holdings in it, at the reg. + # The pool counts the shares, and the holdings in them, at the reg. # 49(1) value, rounded to the nearest penny (reg. 6(1)). A complete # override is a countable figure, so the holdings it must at least # cover are counted at that value. A recorded financial total is used diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/uc_assessable_capital.py b/policyengine_uk/variables/gov/dwp/universal_credit/uc_assessable_capital.py index 9428fd87bc..cbb5875504 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/uc_assessable_capital.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/uc_assessable_capital.py @@ -41,15 +41,15 @@ class uc_assessable_capital(Variable): "holdings. Under regulation 77, it replaces disregarded company holdings with " "the claimant's or partner's share of company capital. Regulation 49(1) " "values the financial pool's sources whose sale would incur expenses " - "(sale_expenses.sources, shares in share_like_capital) at 90%, and the " - "formula values a stocks and shares ISA balance it moves out of " - "share_like_capital at the same 90%. A disregarded holding comes off at " - "the value at which the formula counted it: 90% in the pool and in a " - "complete override, which is a countable figure, and in full from a " - "recorded financial total, which the formula uses without valuation. " - "The formula rounds every amount it calculates to the nearest penny " - "(regulation 6(1)), including this capital, which it tests against the " - "limit." + "(sale_expenses.sources: directly held shares, and all of an " + "unitemised corporate_wealth) at 90%. The formula counts a stocks and " + "shares ISA balance it moves out of share_like_capital_without_sale_expenses " + "at its withdrawal value (ADM H1656-H1658). A disregarded holding comes off at the value at which the formula " + "counted it: 90% in the pool and in a complete override, which is a " + "countable figure, and in full from a recorded financial total, which the " + "formula uses without valuation. The formula rounds every amount it " + "calculates to the nearest penny (regulation 6(1)), including this " + "capital, which it tests against the limit." ) definition_period = YEAR unit = GBP @@ -80,8 +80,9 @@ def formula(benunit, period, parameters): ), p, ) - # A reg. 77 holding sits in share_like_capital, so it is counted at the - # same 90% as the shares around it wherever they are valued. + # A reg. 77 holding sits in the shares with sale expenses, so it is + # counted at the same 90% as the shares around it wherever they are + # valued. holding_value = counted_share(p.sale_expenses, HOLDINGS_SOURCE) benunit_claimants = benunit.sum(claimant_or_partner) person_capital = valued_person_capital( diff --git a/policyengine_uk/variables/gov/dwp/universal_credit/uc_reported_capital.py b/policyengine_uk/variables/gov/dwp/universal_credit/uc_reported_capital.py index c59e6dfb3a..cce696e238 100644 --- a/policyengine_uk/variables/gov/dwp/universal_credit/uc_reported_capital.py +++ b/policyengine_uk/variables/gov/dwp/universal_credit/uc_reported_capital.py @@ -22,7 +22,7 @@ class uc_reported_capital(Variable): "override can change a missing-report unit's capital. The complete " "override consumes its amount, or its claimant's and partner's " "disregarded company holdings after their proportional share of the " - "household share_like_capital budget if larger, " + "household share_like_capital_with_sale_expenses budget if larger, " "from the financial pool, taking " "precedence over the same unit's financial report. " "This variable does not derive from the financial-only FRS total. " diff --git a/policyengine_uk/variables/household/wealth/share_like_capital_with_sale_expenses.py b/policyengine_uk/variables/household/wealth/share_like_capital_with_sale_expenses.py new file mode 100644 index 0000000000..00e7e484f3 --- /dev/null +++ b/policyengine_uk/variables/household/wealth/share_like_capital_with_sale_expenses.py @@ -0,0 +1,44 @@ +from policyengine_uk.model_api import * + +# The share-like holdings a dataset can itemise. The formula treats a +# household as itemising only when one of these is positive, so every name in +# gov.dwp.share_like_capital.without_sale_expenses must be in this list. A +# reform that adds a holding outside it would leave a household that itemises +# only that holding with all of its share-like capital under the deduction. +# share_like_capital sums the same three names, so such a reform must add +# the holding there too. +COMPONENTS = [ + "directly_held_shares", + "unit_and_investment_trusts", + "stocks_and_shares_isa", +] + + +class share_like_capital_with_sale_expenses(Variable): + label = "share-like capital with expenses of sale" + documentation = ( + "The part of share_like_capital whose sale would incur expenses, so " + "that the means tests value it less 10%: share_like_capital less the " + "itemised holdings listed in gov.dwp.share_like_capital." + "without_sale_expenses (unit and investment trusts, stocks and shares " + "ISAs), floored at nil. A household with no itemised holdings has all " + "of its share-like capital here, so datasets that carry only " + "corporate_wealth keep the flat 10% on it." + ) + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + quantity_type = STOCK + + def formula(household, period, parameters): + share_like = household("share_like_capital", period) + itemised = add(household, period, COMPONENTS) + # Summed from a numeric zero so that an empty list (every holding + # taking the deduction) still works. + without = 0 * share_like + for variable in parameters( + period + ).gov.dwp.share_like_capital.without_sale_expenses: + without = without + household(variable, period) + return where(itemised > 0, max_(0, share_like - without), share_like) diff --git a/policyengine_uk/variables/household/wealth/share_like_capital_without_sale_expenses.py b/policyengine_uk/variables/household/wealth/share_like_capital_without_sale_expenses.py new file mode 100644 index 0000000000..ad777f2f0b --- /dev/null +++ b/policyengine_uk/variables/household/wealth/share_like_capital_without_sale_expenses.py @@ -0,0 +1,20 @@ +from policyengine_uk.model_api import * + + +class share_like_capital_without_sale_expenses(Variable): + label = "share-like capital without expenses of sale" + documentation = ( + "The part of share_like_capital the means tests value at full value: " + "share_like_capital less share_like_capital_with_sale_expenses. Nil " + "for a household with no itemised holdings." + ) + entity = Household + definition_period = YEAR + value_type = float + unit = GBP + quantity_type = STOCK + + def formula(household, period, parameters): + return household("share_like_capital", period) - household( + "share_like_capital_with_sale_expenses", period + )