Closed finnwiz closed 3 weeks ago
@finnwiz Thanks for this, and I'm glad you're enjoying the package. I'd love some part-time help, if you're willing -- feel free to tackle an open issue or propose your own. Happy to discuss more.
So there's a few things going on in the issue you're describing. First, for a Poisson distribution, the standard deviation always equals the square root of the mean, so there's no need to set the SD field independently -- the DemandSource
only needs the mean
.
But more importantly, the GSM code doesn't handle anything other than normally distributed demand. So you could set the standard_deviation
and it would avoid the bug, but since the safety-stock calculation assumes normally distributed demand, it wouldn't reflect the Poisson-ness of your random variable at all. (Actually I don't think it would be too hard to handle non-normal demands; see also issue #20.)
So I'm going to
mean
and standard_deviation
are provided, and And I'll leave handling non-normal demand to fix one day in #20.
Hi Larry,
Firstly, thank you so much for creating this fantastic library!
Secondly, if you'd like some part-time help, I'd be be happy to contribute an occasional PR, although I expect I would be more useful in some of the code-structuring or testing than in any of the actual optimization / simulation.
Lastly, I've noticed a bug that affects
DemandSource
. When usingoptimize_committed_service_times()
, I realized that the Poisson distribution I was passing as a demand source didn't actually have its standard deviation set.Output:
But if I force the standard deviations to be set, I get a non-zero result.
Output:
I'm not sure if you intended generic demand sources to be used in the
gsm_tree
module (although I didn't see that limitation strictly in the documentation) - but it seems like, withindemand_source.py
, you could just leverage some of SciPy's properties for the distribution you're constructing.For example, in lieu of keeping private instance variables in the
DemandSource
class, you could just do something like:See https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.rv_discrete.std.html#scipy.stats.rv_discrete.std.
Welcome feedback either way and thank you again for contributing this great library!