本文整理匯總了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)