当前位置: 首页>>代码示例>>Python>>正文


Python special.i1方法代码示例

本文整理汇总了Python中scipy.special.i1方法的典型用法代码示例。如果您正苦于以下问题:Python special.i1方法的具体用法?Python special.i1怎么用?Python special.i1使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在scipy.special的用法示例。


在下文中一共展示了special.i1方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: estimate_kappa

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def estimate_kappa(N, ssx, scx):
        if N == 0:
            return 10.**-6
        elif N == 1:
            return 10*pi
        else:
            rbar2 = (ssx / N) ** 2. + (scx / N) ** 2.
            rbar = rbar2 ** .5
            kappa = rbar*(2. - rbar2) / (1. - rbar2)

        A_p = lambda k : bessel_1(k) / bessel_0(k)

        Apk = A_p(kappa)
        kappa_1 = kappa - (Apk - rbar)/(1. - Apk**2 - (1. / kappa) * Apk)
        Apk = A_p(kappa_1)
        kappa = kappa_1 - (Apk - rbar)/(1. - Apk**2 - (1. / kappa_1) * Apk)
        Apk = A_p(kappa)
        kappa_1 = kappa - (Apk - rbar)/(1. - Apk**2 - (1. / kappa) * Apk)
        Apk = A_p(kappa_1)
        kappa = kappa_1 - (Apk - rbar)/(1. - Apk**2 - (1. / kappa_1) * Apk)

        if isnan(kappa):
            return 10.**-6
        else:
            return abs(kappa) 
开发者ID:probcomp,项目名称:cgpm,代码行数:27,代码来源:vonmises.py

示例2: mmse_stsa

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def mmse_stsa(xi, gamma):
	"""
	Computes the MMSE-STSA gain function.

	Argument/s:
		xi - a priori SNR.
		gamma - a posteriori SNR.

	Returns:
		G - MMSE-STSA gain function.
	"""
	nu = np.multiply(xi, np.divide(gamma, np.add(1, xi)))
	G = np.multiply(np.multiply(np.multiply(np.divide(np.sqrt(np.pi), 2),
		np.divide(np.sqrt(nu), gamma)), np.exp(np.divide(-nu,2))),
		np.add(np.multiply(np.add(1, nu), i0(np.divide(nu,2))),
		np.multiply(nu, i1(np.divide(nu, 2))))) # MMSE-STSA gain function.
	idx = np.isnan(G) | np.isinf(G) # replace by Wiener gain.
	G[idx] = np.divide(xi[idx], np.add(1, xi[idx])) # Wiener gain.
	return G 
开发者ID:anicolson,项目名称:DeepXi,代码行数:21,代码来源:gain.py

示例3: _entropy

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def _entropy(self, kappa):
        return (-kappa * sc.i1(kappa) / sc.i0(kappa) +
                np.log(2 * np.pi * sc.i0(kappa))) 
开发者ID:ryfeus,项目名称:lambda-packs,代码行数:5,代码来源:_continuous_distns.py

示例4: test_i1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1(self):
        assert_equal(cephes.i1(0),0.0) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:4,代码来源:test_basic.py

示例5: test_i1_series

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1_series(self):
        for z in [1., 10., 200.5]:
            value, err = self.iv_series(1, z)
            assert_tol_equal(special.i1(z), value, atol=err, err_msg=z) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:6,代码来源:test_basic.py

示例6: test_i1_series

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def test_i1_series(self):
        for z in [1., 10., 200.5]:
            value, err = self.iv_series(1, z)
            assert_allclose(special.i1(z), value, atol=err, err_msg=z) 
开发者ID:Relph1119,项目名称:GraphicDesignPatternByPython,代码行数:6,代码来源:test_basic.py

示例7: cy_bispev

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def cy_bispev(tx, ty, c, kx, ky, x, y):
    '''Possible optimization: Do not evaluate derivatives, ever.
    '''
    nx = len(tx)
    ny = len(ty)
    mx = len(x)
    my = len(y)

    kx1 = kx + 1
    ky1 = ky + 1

    nkx1 = nx - kx1
    nky1 = ny - ky1
    
    wx = [[0.0]*kx1]*mx
    wy = [[0.0]*ky1]*my
    lx = [0]*mx
    ly = [0]*my

    size_z = mx*my
    
    z = [0.0]*size_z
    init_w(tx, kx, x, lx, wx)
    init_w(ty, ky, y, ly, wy)
    
    for j in range(my):
        for i in range(mx):
            sp = 0.0
            err = 0.0
            for i1 in range(kx1):
                for j1 in range(ky1):
                    l2 = lx[i]*nky1 + ly[j] + i1*nky1 + j1
                    a = c[l2]*wx[i][i1]*wy[j][j1] - err
                    tmp = sp + a
                    err = (tmp - sp) - a
                    sp = tmp
            z[j*mx + i] += sp
    return z 
开发者ID:CalebBell,项目名称:fluids,代码行数:40,代码来源:__init__.py

示例8: i1

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def i1(*args, **kwargs):
        from scipy.special import i1
        return i1(*args, **kwargs) 
开发者ID:CalebBell,项目名称:fluids,代码行数:5,代码来源:__init__.py

示例9: erf

# 需要导入模块: from scipy import special [as 别名]
# 或者: from scipy.special import i1 [as 别名]
def erf(*args, **kwargs):
            from scipy.special import erf
            return erf(*args, **kwargs)


#    from scipy.special import lambertw, ellipe, gammaincc, gamma # fluids
#    from scipy.special import i1, i0, k1, k0, iv # ht
#    from scipy.special import hyp2f1    
#    if erf is None:
#        from scipy.special import erf 
开发者ID:CalebBell,项目名称:fluids,代码行数:12,代码来源:__init__.py


注:本文中的scipy.special.i1方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。