You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
The text was updated successfully, but these errors were encountered:
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).
The text was updated successfully, but these errors were encountered: