使用 Python 生成指数威布尔分布的随机样本
对于运行此 scipy 函数 的分布来检测指数威布尔分布的最佳拟合,并且该函数输出 4 个参数值。但是如何生成遵循这种分布的大小为 n 的数据示例列表列表。
我不想重写函数。任何执行此操作的 python 包都会有所帮助。
For a distribution for running this scipy function to detect the best fit as Exponentiated Weibull distribution and the function outputs 4 parameter values. But how to generate a sample list
of data of size n
that honours this kind of distribution.
I don't want to re-write function. Any python package which does this, would be helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通常,您将使用
ppf
从Rando种子生成。对于一个简单的完全假的示例,假设我们将一个统一的随机变量(值从0到15)拟合到Weibull分布。然后,创建一个种子随机变量(从0到1,因为它是您将获得的分位数的值),然后将其放入
ppf
函数中。您将拥有类似以下内容。
请小心,并检查有关Weibull Distrubiton的
ppf
的文档。在我的函数st.exponweib.ppf中它的形式可能是不正确的。
Usually you will use a
ppf
to generate from a rando seed.For a simple completely fake example, let's say we fit a uniform random variable (with values from 0 to 15) to a Weibull distribution. Then, create a seed random variable (from 0 to 1 because it's the value of the quantiles that you will get) and put it in the
ppf
function.You'll have something like the following.
Please be careful and check for the documentation of the
ppf
concerning the weibull distrubiton. In my functionst.exponweib.ppf(sample_seed, *dist)
I just use*dist
but it might be the case that the parameters should be sent differently, you can see it with the form of the orange plot which might not be correct.