本文整理汇总了Python中fitter.Fitter.xmax方法的典型用法代码示例。如果您正苦于以下问题:Python Fitter.xmax方法的具体用法?Python Fitter.xmax怎么用?Python Fitter.xmax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fitter.Fitter
的用法示例。
在下文中一共展示了Fitter.xmax方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_gamma
# 需要导入模块: from fitter import Fitter [as 别名]
# 或者: from fitter.Fitter import xmax [as 别名]
def test_gamma():
from scipy import stats
data = stats.gamma.rvs(2, loc=1.5, scale=2, size=100000)
f = Fitter(data, bins=100)
f.xmin = -10 #should have no effect
f.xmax = 1000000 # no effet
f.xmin=0.1
f.xmax=10
f.distributions = f.distributions[:3:]
f.fit()
f.summary()
f.plot_pdf(names=['anglit', 'alpha'])
示例2: test_gamma
# 需要导入模块: from fitter import Fitter [as 别名]
# 或者: from fitter.Fitter import xmax [as 别名]
def test_gamma():
from scipy import stats
data = stats.gamma.rvs(2, loc=1.5, scale=2, size=10000)
f = Fitter(data, bins=100)
f.xmin = -10 #should have no effect
f.xmax = 1000000 # no effet
f.xmin=0.1
f.xmax=10
f.distributions = ['gamma', "alpha"]
f.fit()
df = f.summary()
assert len(df)
f.plot_pdf(names=["gamma"])
f.plot_pdf(names="gamma")
res = f.get_best()
assert "gamma" in res.keys()
示例3: test_fitter
# 需要导入模块: from fitter import Fitter [as 别名]
# 或者: from fitter.Fitter import xmax [as 别名]
def test_fitter():
f = Fitter([1,1,1,2,2,2,2,2,3,3,3,3], distributions=['gamma'], xmin=0, xmax=4)
f.fit()
f.summary()
assert f.xmin == 0
assert f.xmax == 4
# reset the range:
f.xmin = None
f.xmax = None
assert f.xmin == 1
assert f.xmax == 3
f = Fitter([1,1,1,2,2,2,2,2,3,3,3,3], distributions=['gamma'])
f.fit()
f.summary()
assert f.xmin == 1
assert f.xmax == 3