Skip to content

Dynamic Stock Model: Negative inflow correction  #10

Description

@SPDeetman

I have a suspicion that the implementation of the NegativeInflowCorrect in the compute_stock_driven_model() function of the DynamicStockModel is not functioning entirely as intended (link):

My understanding:
Negative inflow occurs when the stock goes down rapidly compared to previous years. In this case the NegativeInflowCorrect flag allows for a more realistic representation where inflow is set to zero. However, to satisfy the stock, the stock by cohort (self.s_c) needs to be adjusted downwards. Essentially representing early retirement. This in turn means that the outflow increases.

The Issue:
In the current code however, it exactly the opposite: the stock by cohort is INcreased, while the outflow by cohort is DEcreased. This means that the prescribed stock is no longer satisfied at each time increment (which I guess should be the case in a stock driven model setting).

Solution (?):
A suggested quick fix would be to switch the operators (+&-) in line 374 & 375 of the DSM. This at least makes sure that the stock is satisfied. It would however not solve the issue of negative outflow (which could in turn be solved by defining the surviving fraction relative to the previous year, or by defining a surplus stock, but that's obviously easier said than done).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions