當前位置: 首頁>>代碼示例>>Python>>正文


Python special.xlog1py方法代碼示例

本文整理匯總了Python中scipy.special.xlog1py方法的典型用法代碼示例。如果您正苦於以下問題:Python special.xlog1py方法的具體用法?Python special.xlog1py怎麽用?Python special.xlog1py使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在scipy.special的用法示例。


在下文中一共展示了special.xlog1py方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _logpdf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def _logpdf(self, x, a, b):
        lPx = sc.xlog1py(b - 1.0, -x) + sc.xlogy(a - 1.0, x)
        lPx -= sc.betaln(a, b)
        return lPx 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:6,代碼來源:_continuous_distns.py

示例2: _logsf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def _logsf(self, x, c, d):
        return sc.xlog1py(-d, x**c) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:4,代碼來源:_continuous_distns.py

示例3: _logpmf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def _logpmf(self, x, n, p):
        k = floor(x)
        combiln = (gamln(n+1) - (gamln(k+1) + gamln(n-k+1)))
        return combiln + special.xlogy(k, p) + special.xlog1py(n-k, -p) 
開發者ID:ryfeus,項目名稱:lambda-packs,代碼行數:6,代碼來源:_discrete_distns.py

示例4: test_xlog1py

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def test_xlog1py():
    def xfunc(x, y):
        if x == 0 and not np.isnan(y):
            return x
        else:
            return x * np.log1p(y)

    z1 = np.asarray([(0,0), (0, np.nan), (0, np.inf), (1.0, 2.0),
                     (1, 1e-30)], dtype=float)
    w1 = np.vectorize(xfunc)(z1[:,0], z1[:,1])
    assert_func_equal(special.xlog1py, w1, z1, rtol=1e-13, atol=1e-13) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:13,代碼來源:test_basic.py

示例5: pdf

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def pdf(self, pX, pR, pP):
        """
        PDF for a continuous generalization of NB distribution
        """

        gamma_part = gammaln(pR + pX) - gammaln(pX + 1) - gammaln(pR)
        return np.exp(gamma_part + (pR * log(pP)) + special.xlog1py(pX, -pP)) 
開發者ID:deeptools,項目名稱:HiCExplorer,代碼行數:9,代碼來源:viewpoint.py

示例6: test_xlog1py

# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import xlog1py [as 別名]
def test_xlog1py():
    def xfunc(x, y):
        with np.errstate(invalid='ignore'):
            if x == 0 and not np.isnan(y):
                return x
            else:
                return x * np.log1p(y)

    z1 = np.asarray([(0,0), (0, np.nan), (0, np.inf), (1.0, 2.0),
                     (1, 1e-30)], dtype=float)
    w1 = np.vectorize(xfunc)(z1[:,0], z1[:,1])
    assert_func_equal(special.xlog1py, w1, z1, rtol=1e-13, atol=1e-13) 
開發者ID:Relph1119,項目名稱:GraphicDesignPatternByPython,代碼行數:14,代碼來源:test_basic.py


注:本文中的scipy.special.xlog1py方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。