How to random sample a 2-parameter weibull distribution in python

后端 未结 2 1891
抹茶落季
抹茶落季 2021-01-19 20:54

I was wondering how to generate a random weibull distribution with 2-parameter (lambda, k) in python. I know that numpy has a numpy.random.weibull, but it only accepts the <

2条回答
  •  囚心锁ツ
    2021-01-19 21:06

    Well, if you sample a number from weibull distribution with scale parameter missing (which assumes scale is equal to 1), then to get it scale multiply by lambda.

    x = numpy.random.weibull(a)
    return lambda*x
    

提交回复
热议问题