lundi 16 mai 2016

how to set scale and size in np.random.exponential

How can I implement this:

Stock loss error is modelled as a renewal process that occurs between time intervals. The time intervals are based on an exponential distribution with a mean time between stock loss events (TBSLE). The frequency of stock loss occurrence is the reciprocal of TBSLE. The expected value for the mean stock loss quantity can be estimated as 2.05.

I tried to implement it like this, but I don't know how to set scale and size in exponential or if this approach is correct.

def stockLossError(self):
    stockLossErrorProbability = 0
    inverseLambda = 0.5
    errors = 0

    randomnumber = np.random.exponential(inverseLambda,none)
    if(randomnumber > stockLossErrorProbability):
        self.daysSinceLastError += 1
        self.errors += 2.05




Aucun commentaire:

Enregistrer un commentaire