Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Stock Model: Negative inflow correction #10

Open
SPDeetman opened this issue Nov 21, 2018 · 0 comments
Open

Dynamic Stock Model: Negative inflow correction #10

SPDeetman opened this issue Nov 21, 2018 · 0 comments

Comments

@SPDeetman
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant