• + 0 comments

    The distribution of the remaining supply is really not normal anymore and is only positive since you clearly cant have a negative balance. My approach is to explicitly simulate the weekly remainder but having a check for less than 0 remainder, in which case, I force it to take the weekly delivered amount as the left over amount for that week.

    remainder = 0
    num_exp=100000
    delivery = 47
    res = []
    for exp in range(1,num_exp):
        start = 74
        remainder = start
        for week in range(1,12):
            remainder = remainder - np.random.normal(50, 10)
            if (remainder <=0):
                remainder = delivery
            else:
                remainder += delivery
        res.append(remainder)