本文整理汇总了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