本文整理汇总了Python中scipy.special.chdtrc方法的典型用法代码示例。如果您正苦于以下问题:Python special.chdtrc方法的具体用法?Python special.chdtrc怎么用?Python special.chdtrc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类scipy.special
的用法示例。
在下文中一共展示了special.chdtrc方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: chisqprob
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import chdtrc [as 别名]
def chisqprob(chisq, df):
"""
Probability value (1-tail) for the Chi^2 probability distribution.
Broadcasting rules apply.
Parameters
----------
chisq : array_like or float > 0
df : array_like or float, probably int >= 1
Returns
-------
chisqprob : ndarray
The area from `chisq` to infinity under the Chi^2 probability
distribution with degrees of freedom `df`.
"""
return special.chdtrc(df,chisq)
示例2: _chisquare
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import chdtrc [as 别名]
def _chisquare(f_obs, f_exp):
"""Fast replacement for scipy.stats.chisquare.
Version from https://github.com/scipy/scipy/pull/2525 with additional
optimizations.
"""
f_obs = np.asarray(f_obs, dtype=np.float64)
k = len(f_obs)
# Reuse f_obs for chi-squared statistics
chisq = f_obs
chisq -= f_exp
chisq **= 2
with np.errstate(invalid="ignore"):
chisq /= f_exp
chisq = chisq.sum(axis=0)
return chisq, special.chdtrc(k - 1, chisq)
示例3: _sf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import chdtrc [as 别名]
def _sf(self, x, df):
return sc.chdtrc(df, x)
示例4: test_chdtrc
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import chdtrc [as 别名]
def test_chdtrc(self):
assert_equal(cephes.chdtrc(1,0),1.0)
示例5: test_chi2c_smalldf
# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import chdtrc [as 别名]
def test_chi2c_smalldf():
assert_almost_equal(special.chdtrc(0.6,3), 1-0.957890536704110)