jeudi 18 août 2016

Long tail distribution of random numbers in Python

I need to make a randomizing function in Python returning values using long tail distribution. Unfortunately, my math skills are nowhere near my programming skills so I'm stuck.

This is the kind of distribution I'm looking for: .

Returned value must be between 0 and 1, and it must be possible to assign a peak value (where the graph peaks on the Y axis), which would be a number between 0 and 1.

Example usage:

def random_long_tail(peak):
    #magic

value = random_long_tail(0.2)
print(value) #outputs i.e. 0.345811242

I will be incredibly grateful for any help in solving this issue. Thank you!




Aucun commentaire:

Enregistrer un commentaire