本文整理匯總了Python中scipy.special.assoc_laguerre方法的典型用法代碼示例。如果您正苦於以下問題:Python special.assoc_laguerre方法的具體用法?Python special.assoc_laguerre怎麽用?Python special.assoc_laguerre使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類scipy.special
的用法示例。
在下文中一共展示了special.assoc_laguerre方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _pdf_skip
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import assoc_laguerre [as 別名]
def _pdf_skip(self, x, dfn, dfd, nc):
# ncf.pdf(x, df1, df2, nc) = exp(nc/2 + nc*df1*x/(2*(df1*x+df2))) *
# df1**(df1/2) * df2**(df2/2) * x**(df1/2-1) *
# (df2+df1*x)**(-(df1+df2)/2) *
# gamma(df1/2)*gamma(1+df2/2) *
# L^{v1/2-1}^{v2/2}(-nc*v1*x/(2*(v1*x+v2))) /
# (B(v1/2, v2/2) * gamma((v1+v2)/2))
n1, n2 = dfn, dfd
term = -nc/2+nc*n1*x/(2*(n2+n1*x)) + sc.gammaln(n1/2.)+sc.gammaln(1+n2/2.)
term -= sc.gammaln((n1+n2)/2.0)
Px = np.exp(term)
Px *= n1**(n1/2) * n2**(n2/2) * x**(n1/2-1)
Px *= (n2+n1*x)**(-(n1+n2)/2)
Px *= sc.assoc_laguerre(-nc*n1*x/(2.0*(n2+n1*x)), n2/2, n1/2-1)
Px /= sc.beta(n1/2, n2/2)
# This function does not have a return. Drop it for now, the generic
# function seems to work OK.
示例2: test_assoc_laguerre
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import assoc_laguerre [as 別名]
def test_assoc_laguerre(self):
a1 = special.genlaguerre(11,1)
a2 = special.assoc_laguerre(.2,11,1)
assert_array_almost_equal(a2,a1(.2),8)
a2 = special.assoc_laguerre(1,11,1)
assert_array_almost_equal(a2,a1(1),8)
示例3: _pdf_skip
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import assoc_laguerre [as 別名]
def _pdf_skip(self, x, dfn, dfd, nc):
n1, n2 = dfn, dfd
term = -nc/2+nc*n1*x/(2*(n2+n1*x)) + sc.gammaln(n1/2.)+sc.gammaln(1+n2/2.)
term -= sc.gammaln((n1+n2)/2.0)
Px = np.exp(term)
Px *= n1**(n1/2) * n2**(n2/2) * x**(n1/2-1)
Px *= (n2+n1*x)**(-(n1+n2)/2)
Px *= sc.assoc_laguerre(-nc*n1*x/(2.0*(n2+n1*x)), n2/2, n1/2-1)
Px /= sc.beta(n1/2, n2/2)
# This function does not have a return. Drop it for now, the generic
# function seems to work OK.
示例4: _pdf
# 需要導入模塊: from scipy import special [as 別名]
# 或者: from scipy.special import assoc_laguerre [as 別名]
def _pdf(self, x, dfn, dfd, nc):
n1, n2 = dfn, dfd
term = -nc/2.+nc*n1*x/(2*(n2+n1*x)) + special.gammaln(n1/2.)+special.gammaln(1+n2/2.)
term -= special.gammaln((n1+n2)/2.)
Px = numpy.exp(term)
Px *= n1**(n1/2.) * n2**(n2/2.) * x**(n1/2.-1)
Px *= (n2+n1*x)**(-(n1+n2)/2.)
Px *= special.assoc_laguerre(-nc*n1*x/(2.*(n2+n1*x)), n2/2., n1/2.-1)
Px /= special.beta(n1/2., n2/2.)
return Px