本文整理汇总了Python中mpmath.quad方法的典型用法代码示例。如果您正苦于以下问题:Python mpmath.quad方法的具体用法?Python mpmath.quad怎么用?Python mpmath.quad使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpmath
的用法示例。
在下文中一共展示了mpmath.quad方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _noncentral_chi_cdf
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def _noncentral_chi_cdf(x, df, nc, dps=None):
if dps is None:
dps = mpmath.mp.dps
x, df, nc = mpmath.mpf(x), mpmath.mpf(df), mpmath.mpf(nc)
with mpmath.workdps(dps):
res = mpmath.quad(lambda t: _noncentral_chi_pdf(t, df, nc), [0, x])
return res
示例2: integral_inf
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def integral_inf(fn):
integral, _ = integrate.quad(fn, -np.inf, np.inf)
return integral
开发者ID:SAP-samples,项目名称:machine-learning-diff-private-federated-learning,代码行数:5,代码来源:gaussian_moments.py
示例3: integral_bounded
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def integral_bounded(fn, lb, ub):
integral, _ = integrate.quad(fn, lb, ub)
return integral
开发者ID:SAP-samples,项目名称:machine-learning-diff-private-federated-learning,代码行数:5,代码来源:gaussian_moments.py
示例4: integral_inf_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def integral_inf_mp(fn):
integral, _ = mp.quad(fn, [-mp.inf, mp.inf], error=True)
return integral
开发者ID:SAP-samples,项目名称:machine-learning-diff-private-federated-learning,代码行数:5,代码来源:gaussian_moments.py
示例5: integral_bounded_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def integral_bounded_mp(fn, lb, ub):
integral, _ = mp.quad(fn, [lb, ub], error=True)
return integral
开发者ID:SAP-samples,项目名称:machine-learning-diff-private-federated-learning,代码行数:5,代码来源:gaussian_moments.py
示例6: _integral_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def _integral_mp(self, fn, bounds=(-inf, inf)):
integral, _ = quad(fn, bounds, error=True, maxdegree=8)
return integral
示例7: _integral_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def _integral_mp(self, fn, bounds=(-mp.inf, mp.inf)):
integral, _ = mp.quad(fn, bounds, error=True, maxdegree=8)
return integral
示例8: _integral_inf_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def _integral_inf_mp(self, fn):
integral, _ = mp.quad(
fn, [-mp.inf, mp.inf], error=True,
maxdegree=7) # maxdegree = 6 is not enough
return integral
示例9: _integral_bounded_mp
# 需要导入模块: import mpmath [as 别名]
# 或者: from mpmath import quad [as 别名]
def _integral_bounded_mp(self, fn, lb, ub):
integral, _ = mp.quad(fn, [lb, ub], error=True)
return integral