backend_pytorch.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:python-weibullfit 作者: mlosch 项目源码 文件源码
def compare_fits(x):
    shape, scale = fit(x)
    app_shape, app_scale = x.mean() / x.std(), x.mean()
    # _, np_shape, _, np_scale = exponweib.fit(x, floc=0)

    # # Plot
    # def weib(x, n, a): # a == shape
    #   return (a / n) * (x / n)**(a - 1) * np.exp(-(x / n)**a)
    #
    # count, _, _ = plt.hist(x, 100)
    # xx = np.linspace(x.min(), x.max(), 10000)
    # yy = weib(xx, scale, shape)
    # yy_app = weib(xx, app_scale, app_shape)
    # yy_np = weib(xx, np_scale, np_shape)
    # plt.plot(xx, yy*(count.max() / yy.max()), label='MLE')
    # plt.plot(xx, yy_app*(count.max() / yy_app.max()), label='App')
    # plt.plot(xx, yy_np*(count.max() / yy_np.max()), label='Scipy')
    # plt.legend()
    # plt.show()

    return (shape, scale), (app_shape, app_scale)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号