Skip to content

Speed up branch calculations by reimplementing neutralize #300

Open
@nikhilwoodruff

Description

@nikhilwoodruff

Currently, when a simulation branches, we can choose to either:

  • Clone the tax-benefit system (policy) to make it fully independent from the original TBS (at a cost of the TBS initialisation, often a few seconds)
  • Leave attached to the original TBS

For labour and capital gains responses, we need to create branches to measure marginal tax rates. In those branches, we have to neutralise the behavioural response variables (in order to avoid an infinite loop). Neutralisation is a change to the tax benefit policy, not the simulation data, so we need to clone the TBS. But we could implement an alternative neutralisation as a change to data not policy, by saying that instead of:

  • Neutralise(variable) -> adjust the simulation logic to always return 0
  • Neutralise(variable) -> set the simulation input data to include an array of zeros (size of entity population)

Then the LSR and CG branches wouldn't need to clone the TBS.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions