Repository navigation
Wealth inheritance - #532
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Deferred balances mature too late, pension eligibility is broadened incorrectly, and persisted-population configuration is bypassed.
3 open findings
What changed in this PR
Adds inheritance, bequest, deferred child balances, pension-pot transfers, orphan handling, and recipient matching to the wealth simulation.
Changes:
- Implements estate settlement and family/synthetic recipient selection.
- Tracks pension components, lineage, orphan exits, and inheritance ledgers.
- Adds extensive tests, research configurations, and updated integration baselines.
| File | Description |
|---|---|
src/main/java/simpaths/model/InheritanceModule.java |
Implements inheritance settlement and reporting. |
src/main/java/simpaths/model/SimPathsModel.java |
Integrates settlement, alignment, and lineage handling. |
src/main/java/simpaths/model/BenefitUnit.java |
Adds inheritance wealth and pension components. |
src/main/java/simpaths/model/Person.java |
Preserves ancestry and personal inheritance balances. |
src/main/java/simpaths/model/person/PrivatePension.java |
Models pension components and retirement conversion. |
src/main/java/simpaths/model/decisions/States.java |
Excludes deferred wealth from decisions. |
src/main/java/simpaths/data/Parameters.java |
Adds pension and projection parameters. |
src/main/java/simpaths/data/startingpop/DataParser.java |
Imports pension component columns. |
src/test/java/simpaths/model/InheritanceModuleTest.java |
Tests core inheritance behavior. |
src/test/java/simpaths/model/InheritanceRecipientRulesTest.java |
Tests heir priority and matching. |
src/test/java/simpaths/model/InheritanceOrphanExitTest.java |
Tests orphan exits and reassignment. |
src/test/java/simpaths/model/PopulationAlignmentDeathTest.java |
Tests dependent-protection safeguards. |
src/test/java/simpaths/model/BenefitUnitPensionComponentsTest.java |
Tests initial pension allocation. |
src/test/java/simpaths/model/person/PrivatePensionComponentsTest.java |
Tests pension growth and retirement. |
src/test/java/simpaths/integrationtest/expected/WellbeingByGender.csv |
Updates wellbeing baseline. |
src/test/java/simpaths/integrationtest/expected/WealthIncomeStatistics.csv |
Updates wealth baseline. |
src/test/java/simpaths/integrationtest/expected/LabourStatistics.csv |
Updates labour baseline. |
src/test/java/simpaths/integrationtest/expected/HealthStatistics.csv |
Updates health baseline. |
src/test/java/simpaths/integrationtest/expected/DemographicStatistics.csv |
Updates demographic baseline. |
input/DoFilesTarget/04_no_ageing_population_targets.do |
Generates no-ageing targets. |
config/wealth_inequality_no_ageing_2070.yml |
Configures no-ageing research run. |
config/wealth_inequality_baseline_2070.yml |
Configures baseline research run. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| // SimPaths treats the imputed starting total as one modelled pot. | ||
| // The source components remain useful for data validation, but do | ||
| // not define bequest eligibility under this simplified convention. | ||
| wealthPensDcValue = total; | ||
| wealthPensDbValue = 0.0; | ||
| wealthPensInPaymentValue = 0.0; | ||
| wealthPensOtherValue = 0.0; | ||
| return new double[]{total, 0.0, 0.0, 0.0}; |
There was a problem hiding this comment.
@LiangShi369 - the revisions that have been introduced here distinguish between DB and DC pensions, and the error raised here is that DB is not transferrable. Can you please revise the pull request to omit the DB/DC pension distinction, as this complicates the codes significantly in a way that the remainder of the wealth module is not currently set-up to support?
| // mortality (migration) and population alignment at year's end | ||
| addCollectionEventToAllYears(persons, Person.Processes.ConsiderMortality); | ||
| addEventToAllYears(Processes.PopulationAlignment); // start population alignment in year 0 (startYear) | ||
| addEventToAllYears(Processes.SettleInheritance); |
There was a problem hiding this comment.
@LiangShi369 - this point looks sensible to me. Can you please move the SettleInheritance process toward the top of the processes list?
| // Processed populations predate the inheritance lineage repair and | ||
| // discard unresolved source-parent references. Rebuild from the raw | ||
| // input while inheritance is enabled until the cache records lineage. | ||
| Processed processed = null; |
There was a problem hiding this comment.
@LiangShi369: This revision also looks odd. It is possible that the getProcessed() method isn't working perfectly at the moment, but I don't think a hard-coded omission from the project is a good idea - please undo this change.
…and amend retirement definition at load
Mature deferred inheritance after Aging while retaining estate settlement at year end. Carry releases through opening wealth accounts and refresh affected benefit units. Restore versioned population caching with source-family lineage, invalidate legacy caches, and update regression references for cache reuse.
|
Do yesterday's commits (ae7b6c5, db88e87, and 58f709d) address all the outstanding issues? Is the PR ready to be merged? |
I am trying to ensure that the wealth data are consistent with the model, and will push changes as soon as that is done. |


This pull request adds a bequest and inheritance mechanism to the updated wealth module on
develop. The main rules are:Inheritable wealth. Bequests comprise net financial wealth, net housing wealth and eligible pension pots. For financial and housing wealth, the combined net estate must be positive; debts reduce the amount available to inherit.
Timing of redistribution. Financial and housing wealth belongs to the benefit unit and remains there while a responsible adult survives. It is redistributed once, when the last responsible adult dies. The eligible remaining pension pot of a person who dies before retirement is distributed at their death, following the same family inheritance hierarchy. Pension inheritance applies automatically. Adult recipients receive the amount as financial wealth; children receive a deferred balance until age 18.
Family priority. The order is surviving partner -> children or their descendants -> surviving parents -> then matched adults. A surviving partner retains the pooled wealth. Children share equally through family branches, with descendants taking a deceased child's share. If no child or descendant branches remain, identified surviving parents share the estate equally, even when they live in different benefit units. Matching is used when family recipients are unavailable.
How recipients receive the money. Adult recipients receive inheritance as an addition to their benefit unit's financial wealth, including the proceeds of inherited housing. An identified child's inheritance is held aside until age 18. It counts as wealth but is unavailable for current spending. If the child dies before adulthood, the held balance follows the same family inheritance hierarchy.
The inheritance matching mechanism. Where no family heirs are identified, the estate is split equally between two matched adults remaining in the simulation. Matching also replaces an unavailable family heir's allocated share. For donors aged under 48, a target age is drawn uniformly between 18 and 28. For donors aged 48 or above, it is drawn uniformly between 20 and 30 years below the donor's age. Eligible adult recipients are ranked by closeness to the target age, followed by similarity in education and then region. If the target age is unavailable, the closest eligible adult age is used. Remaining ties are resolved randomly using a fixed seed.
Population alignment and orphan exits. Population alignment can assign death or emigration. Alignment deaths trigger the same inheritance rules as other deaths; emigration is accounted for separately as wealth leaving the sample. The alignment safeguard prevents removal of the last living responsible adult when dependent children remain. If all responsible adults nevertheless die, the children leave the simulation with an explicit orphan exit. Any inheritance already held for them and any new inheritance due are reassigned once to matched adults. Matching uses the last deceased parent's age, education and region. If both parents die in the same year, the higher individual person ID determines the reference parent.
The current specification makes no separate deduction for inheritance tax or estate administration costs. Children's deferred balances do not explicitly accrue investment returns.
The PR also includes the baseline and no-ageing research settings and their supporting inputs in two yaml files. The 2021 initial-population CSV remains local and is excluded from the PR.