paretovariate

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • zhjchen

    paretovariate


    I want to realize a list of numbers. They follow pareto distribution.
    For instance, the average value is 10 and alpha is 1.0
    I do not know how to use the function of paretovariate(a lpha). It only provides
    alpha parameter. How should I set the average value?


  • Casey

    #2
    Re: paretovariate

    On Aug 11, 3:14 am, "zhjchen" <zhjc...@mail.u stc.edu.cnwrote :
    I want to realize a list of numbers. They follow pareto distribution.
    For instance, the average value is 10 and alpha is 1.0
    I do not know how to use the function of paretovariate(a lpha). It only provides
    alpha parameter. How should I set the average value?
    I'm guessing that paretovalue(alp ha) treats alpha as the shape
    parameter and assumes a mode of 1.0, in which case you would multiply
    by 10 for your example.

    Alternatively, you could define your own Pareto function:

    # pareto for mode, shape 0.0
    def pareto(mode, shape): return mode * pow(1.0 - random.random() ,
    -1.0 / shape)

    Comment

    Working...