Last active
March 2, 2022 15:57
-
-
Save optilude/5d9cace4fa3b001c9f8993f7d7a619ae to your computer and use it in GitHub Desktop.
Kanban lead time weibull distribution estimator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def weibull_estimate(min_, max_, shape=1.25): | |
"""Draw a random number between min_ and max_ using a Weibull | |
distribution with shape `shape`. | |
Thanks to Troy Magennis for the inspiration! | |
""" | |
return min(max_, ((max_ - min_) / 4.0) * np.random.weibull(shape) + min_) | |
# e.g. to plot a histogram: | |
import matplotlib.pyplot as plt | |
plt.hist([weibull_estimate(5, 20) for x in range(1000)]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment