本文整理匯總了Python中scipy.special.stdtr方法的典型用法代碼示例。如果您正苦於以下問題:Python special.stdtr方法的具體用法?Python special.stdtr怎麽用?Python special.stdtr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scipy.special
的用法示例。
在下文中一共展示了special.stdtr方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _cdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _cdf(self, x, df):
return sc.stdtr(df, x)
示例2: _sf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _sf(self, x, df):
return sc.stdtr(df, -x)
示例3: test_stdtr
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def test_stdtr(self):
# Ideally the left endpoint for Arg() should be 0.
assert_mpmath_equal(
sp.stdtr,
_student_t_cdf,
[IntArg(1, 100), Arg(1e-10, np.inf)], rtol=1e-7)
示例4: batched_univ_t_cdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def batched_univ_t_cdf(x, loc, scale, dof):
x, loc, scale, dof = np.squeeze(x), np.squeeze(loc), np.squeeze(scale), np.squeeze(dof)
assert x.shape == loc.shape == scale.shape == dof.shape and x.ndim == 1
x_norm = (x - loc) / scale
p = stdtr(dof, x_norm)
return p
示例5: _cdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _cdf(self, x, df, C, Ci):
out = special.stdtr(df, numpy.dot(Ci, special.stdtrit(df, x)))
return out
示例6: _ppf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _ppf(self, q, df, C, Ci):
out = special.stdtr(df, numpy.dot(C, special.stdtrit(df, q)))
return out
示例7: _cdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _cdf(self, x, a, C, Ci, loc):
x = numpy.dot(Ci, (x.T-loc.T).T)
return special.stdtr(a, x)
示例8: _cdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def _cdf(self, x, a):
return special.stdtr(a, x)
示例9: test_nonfinite
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import stdtr [as 別名]
def test_nonfinite():
funcs = [
("btdtria", 3),
("btdtrib", 3),
("bdtrik", 3),
("bdtrin", 3),
("chdtriv", 2),
("chndtr", 3),
("chndtrix", 3),
("chndtridf", 3),
("chndtrinc", 3),
("fdtridfd", 3),
("ncfdtr", 4),
("ncfdtri", 4),
("ncfdtridfn", 4),
("ncfdtridfd", 4),
("ncfdtrinc", 4),
("gdtrix", 3),
("gdtrib", 3),
("gdtria", 3),
("nbdtrik", 3),
("nbdtrin", 3),
("nrdtrimn", 3),
("nrdtrisd", 3),
("pdtrik", 2),
("stdtr", 2),
("stdtrit", 2),
("stdtridf", 2),
("nctdtr", 3),
("nctdtrit", 3),
("nctdtridf", 3),
("nctdtrinc", 3),
("tklmbda", 2),
]
np.random.seed(1)
for func, numargs in funcs:
func = getattr(sp, func)
args_choices = [(float(x), np.nan, np.inf, -np.inf) for x in
np.random.rand(numargs)]
for args in itertools.product(*args_choices):
res = func(*args)
if any(np.isnan(x) for x in args):
# Nan inputs should result to nan output
assert_equal(res, np.nan)
else:
# All other inputs should return something (but not
# raise exceptions or cause hangs)
pass