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