Python 第三方模块 科学计算 SciPy模块6 特殊函数1

十一.Special模块

几乎所有以下函数均为"通用函数"(Universal Function),遵循"广播"(Broadcasting)"自动数组循环"(Automatic Array-Looping)规则

1.错误处理(Error Handling)
(1)函数:

Get the current way of handling special-function errors:[<err>=]scipy.special.geterr()
Set how special-function errors are handled:[<olderr>=]scipy.special.seterr([all=None,singular=None,underflow=None,overflow=None,slow=None,loss=None,no_result=None,domain=None,arg=None,other=None])

(2)类:

Context manager for special-function error handling:class scipy.special.errstate([all=None,singular=None,underflow=None,overflow=None,slow=None,loss=None,no_result=None,domain=None,arg=None,other=None])

2.特殊函数
(1)艾里函数(Airy Function):

Airy functions and their derivatives:[<Ai>,<Aip>,<Bi>,<Bip>=]scipy.special.airy(<z>)
Exponentially scaled Airy functions and their derivatives:[<eAi>,<eAip>,<eBi>,<eBip>=]scipy.special.airye(<z>)
Compute nt zeros and values of the Airy function Ai and its derivative:[<a>,<ap>,<ai>,<aip>=]scipy.special.ai_zeros(<nt>)
Compute nt zeros and values of the Airy function Bi and its derivative:[<b>,<bp>,<bi>,<bip>=]scipy.special.bi_zeros(<nt>)
Integrals of Airy functions:[<Apt>,<Bpt>,<Ant>,<Bnt>=]scipy.special.itairy(<x>)

(2)椭圆函数(Elliptic Function)与椭圆积分(Elliptic Integral):

Jacobian elliptic functions:[<sn>,<cn>,<dn>,<ph>=]scipy.special.ellipj(<u>,<m>)
Complete elliptic integral of the first kind:[<K>=]scipy.special.ellipk(<m>)
Complete elliptic integral of the first kind around m = 1:[<K>=]scipy.special.ellipkm1(<p>)
Incomplete elliptic integral of the first kind:[<K>=]scipy.special.ellipkinc(<phi>,<m>)
Complete elliptic integral of the second kind:[<E>=]scipy.special.ellipe(<m>)
Incomplete elliptic integral of the second kind:[<E>=]scipy.special.ellipeinc(<phi>,<m>)

(3)贝塞尔函数(Bessel Function):

Bessel function of the first kind of real order and complex argument:[<J>=]scipy.special.jv(<v>,<z>)
Exponentially scaled Bessel function of order v:[<J>=]scipy.special.jve(<v>,<z>)
Bessel function of the second kind of integer order and real argument:[<Y>=]scipy.special.yn(<n>,<x>)
Bessel function of the second kind of real order and complex argument:[<Y>=]scipy.special.yv(<v>,<z>)
Exponentially scaled Bessel function of the second kind of real order:[<Y>=]scipy.special.yve(<v>,<z>)
Modified Bessel function of the second kind of integer order n:[<out>=]scipy.special.kn(<n>,<x>)
Modified Bessel function of the second kind of real order v:[<out>=]scipy.special.kv(<v>,<z>)
Exponentially scaled modified Bessel function of the second kind:[<out>=]scipy.special.kve(<v>,<z>)
Modified Bessel function of the first kind of real order:[<out>=]scipy.special.iv(<v>,<z>)
Exponentially scaled modified Bessel function of the first kind:[<out>=]scipy.special.ive(<v>,<z>)
Hankel function of the first kind:[<out>=]scipy.special.hankel1(<v>,<z>)
Exponentially scaled Hankel function of the first kind:[<out>=]scipy.special.hankel1e(<v>,<z>)
Hankel function of the second kind:[<out>=]scipy.special.hankel2(<v>,<z>)
Exponentially scaled Hankel function of the second kind:[<out>=]scipy.special.hankel2e(<v>,<z>)
Jahnke-Emden Lambda function, Lambdav(x):[<vl>,<dl>=]scipy.special.lmbda(<v>,<x>)
  #非通用函数

########################################Zeros of Bessel function (均非通用函数)#########################################

Compute zeros of integer-order Bessel functions Jn and Jn':[<zo>,<n>,<m>,<t>=]scipy.special.jnjnp_zeros(<nt>)
Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x):[<Jn>,<Jnp>,<Yn>,<Ynp>=]scipy.special.jnyn_zeros(<n>,<nt>)
Compute zeros of integer-order Bessel functions Jn:[<Jn>=]scipy.special.jn_zeros(<n>,<nt>)
Compute zeros of integer-order Bessel function derivatives Jn':[<Jnp>=]scipy.special.jnp_zeros(<n>,<nt>)
Compute zeros of integer-order Bessel function Yn(x):[<Yn>=]scipy.special.yn_zeros(<n>,<nt>)
Compute zeros of integer-order Bessel function derivatives Yn'(x):[<Ynp>=]scipy.special.ynp_zeros(<n>,<nt>)
Compute nt zeros of Bessel function Y0(z), and derivative at each zero:[<z0n>,<y0pz0n>=]scipy.special.y0_zeros(<nt>[,complex=False])
Compute nt zeros of Bessel function Y1(z), and derivative at each zero:[<z1n>,<y1pz1n>=]scipy.special.y1_zeros(<nt>[,complex=False])
Compute nt zeros of Bessel derivative Y1’(z), and value at each zero:[<z1pn>,<y1z1pn>=]scipy.special.y1p_zeros(<nt>[,complex=False])

######################################Faster versions of common Bessel function#######################################

Bessel function of the first kind of order 0:[<J>=]scipy.special.j0(<x>)
Bessel function of the first kind of order 1:[<J>=]scipy.special.j1(<x>)
Bessel function of the second kind of order 0:[<Y>=]scipy.special.y0(<x>)
Bessel function of the second kind of order 1:[<Y>=]scipy.special.y1(x)
Modified Bessel function of order 0:[<I>=]scipy.special.i0(<x>)
Exponentially scaled modified Bessel function of order 0:[<I>=]scipy.special.i0e(<x>)
Modified Bessel function of order 1:[<I>=]scipy.special.i1(<x>)
Exponentially scaled modified Bessel function of order 1:[<I>=]scipy.special.i1e(<x>)
Modified Bessel function of the second kind of order 0, K0:[<K>=]scipy.special.k0(<x>)
Exponentially scaled modified Bessel function K of order 0:[<K>=]scipy.special.k0e(<x>)
Modified Bessel function of the second kind of order 1, K1(x):[<K>=]scipy.special.k1(<x>)
Exponentially scaled modified Bessel function K of order 1:[<K>=]scipy.special.k1e(<x>)

#############################################Integrals of Bessel function#############################################

Integrals of Bessel functions of the first kind of order 0:[<ij0>,<iy0>=]scipy.special.itj0y0(<x>[,out=None])
Integrals related to Bessel functions of the first kind of order 0:[<ij0>,<iy0>=]scipy.special.it2j0y0(<x>[,out=None])
Integrals of modified Bessel functions of order 0:[<ii0>,<ik0>=]scipy.special.iti0k0(<x>[,out=None])
Integrals related to modified Bessel functions of order 0:[<ii0>,<ik0>=]scipy.special.it2i0k0(<x>[,out=None])
Weighted integral of the Bessel function of the first kind:[<out>=]scipy.special.besselpoly(<a>,<lmb>,<nu><x>[,out=None])

############################################Derivatives of Bessel function############################################

Compute derivatives of Bessel functions of the first kind:[<out>=]scipy.special.jvp(<v>,<z>[,n=1])
Compute derivatives of Bessel functions of the second kind:[<out>=]scipy.special.yvp(<v>,<z>[,n=1])
Compute nth derivative of real-order modified Bessel function Kv(z):[<out>=]scipy.special.kvp(<v>,<z>[,n=1])
Compute derivatives of modified Bessel functions of the first kind:[<out>=]scipy.special.ivp(<v>,<z>[,n=1])
Compute nth derivative of Hankel function H1v(z) with respect to z:[<out>=]scipy.special.h1vp(<v>,<z>[,n=1])
Compute nth derivative of Hankel function H2v(z) with respect to z:[<out>=]scipy.special.h2vp(<v>,<z>[,n=1])

##############################################Spherical Bessel function###############################################

Spherical Bessel function of the first kind or its derivative:[<jn>=]scipy.special.spherical_jn(<n>,<z>[,derivative=False])
Spherical Bessel function of the second kind or its derivative:[<yn>=]scipy.special.spherical_yn(<n>,<z>[,derivative=False])
Modified spherical Bessel function of the first kind or its derivative:[<in>=]scipy.special.spherical_in(<n>,<z>[,derivative=False])
Modified spherical Bessel function of the second kind or its derivative:[<kn>=]scipy.special.spherical_kn(<n>,<z>[,derivative=False])

########################################Riccati-Bessel function (均非通用函数)##########################################

Compute Ricatti-Bessel function of the first kind and its derivative:[<jn>,<jnp>=]scipy.special.riccati_jn(<n>,<x>)
Compute Ricatti-Bessel function of the second kind and its derivative:[<yn>,<ynp>=]scipy.special.riccati_yn(<n>,<x>)

(4)斯特鲁夫函数(Struve Function):

Struve function:[<H>=]scipy.special.struve(<v>,<x>)
Modified Struve function:[<L>=]scipy.special.modstruve(<v>,<x>)
Integral of the Struve function of order 0:[<I>=]scipy.special.itstruve0(<x>)
Integral related to the Struve function of order 0:[<I>=]scipy.special.it2struve0(<x>)
Integral of the modified Struve function of order 0:[<I>=]scipy.special.itmodstruve0(<x>)

(5)统计函数(Raw Statistical Function):

scipy.stats中定义了以下各函数的1个更用户友好的版本
Binomial distribution cumulative distribution function:[<y>=]scipy.special.bdtr(<k>,<n>,<p>)
Binomial distribution survival function:[<y>=]scipy.special.bdtrc(<k>,<n>,<p>)
Inverse function to bdtr with respect to p:[<p>=]scipy.special.bdtri(<k>,<n>,<y>)
Inverse function to bdtr with respect to k:[<k>=]scipy.special.bdtrik(<y>,<n>,<p>)
Inverse function to bdtr with respect to n:[<n>=]scipy.special.bdtrin(<k>,<y>,<p>)
Cumulative distribution function of the beta distribution:[<I>=]scipy.special.btdtr(<a>,<b>,<x>)
The p-th quantile of the beta distribution:[<x>=]scipy.special.btdtri(<a>,<b>,<p>)
Inverse of btdtr with respect to a:[<a>=]scipy.special.btdtria(<p>,<b>,<x>)
Inverse of btdtr with respect to b:[<b>=]scipy.special.btdtrib(<a>,<p>,<x>)
F cumulative distribution function:[<y>=]scipy.special.fdtr(<dfn>,<dfd>,<x>)
F survival function:[<y>=]scipy.special.fdtrc(<dfn>,<dfd>,<x>)
The p-th quantile of the F-distribution:[<x>=]scipy.special.fdtri(<dfn>,<dfd>,<p>)
Inverse to fdtr vs dfd:[<dfd>=]scipy.special.fdtridfd(<dfn>,<p>,<x>)
Gamma distribution cumulative distribution function:[<F>=]scipy.special.gdtr(<a>,<b>,<x>)
Gamma distribution survival function:[<F>=]scipy.special.gdtrc(<a>,<b>,<x>)
Inverse of gdtr vs a:[<a>=]scipy.special.gdtria(<p>,<b>,<x>[,out=None])
Inverse of gdtr vs b:[<b>=]scipy.special.gdtrib(<a>,<p>,<x>[,out=None])
Inverse of gdtr vs x:[<x>=]scipy.special.gdtrix(<a>,<b>,<p>[,out=None])
Negative binomial cumulative distribution function:[<F>=]scipy.special.nbdtr(<k>,<n>,<p>)
Negative binomial survival function:[<F>=]scipy.special.nbdtrc(<k>,<n>,<p>)
Inverse of nbdtr vs p:[<p>=]scipy.special.nbdtri(<k>,<n>,<y>)
Inverse of nbdtr vs k:[<k>=]scipy.special.nbdtrik(<y>,<n>,<p>)
Inverse of nbdtr vs n:[<n>=]scipy.special.nbdtrin(<k>,<y>,<p>)
Cumulative distribution function of the non-central F distribution:[<cdf>=]scipy.special.ncfdtr(<dfn>,<dfd>,<nc>,<f>)
Calculate degrees of freedom (denominator) for the noncentral F-distribution:[<dfd>=]scipy.special.ncfdtridfd(<dfn>,<p>,<nc>,<f>)
Calculate degrees of freedom (numerator) for the noncentral F-distribution:[<dfn>=]scipy.special.ncfdtridfn(<p>,<dfd>,<nc>,<f>)
Inverse with respect to f of the CDF of the non-central F distribution:[<f>=]scipy.special.ncfdtri(<dfn>,<dfd>,<nc>,<p>)
Calculate non-centrality parameter for non-central F distribution:[<nc>=]scipy.special.ncfdtrinc(<dfn>,<dfd>,<p>,<f>)
Cumulative distribution function of the non-central t distribution:[<cdf>=]scipy.special.nctdtr(<df>,<nc>,<t>)
Calculate degrees of freedom for non-central t distribution:[<df>=]scipy.special.nctdtridf(<p>,<nc>,<t>)
Inverse cumulative distribution function of the non-central t distribution:[<icdf>=]scipy.special.nctdtrit(<df>,<nc>,<p>)
Calculate non-centrality parameter for non-central t distribution:[<nc>=]scipy.special.nctdtrinc(<df>,<p>,<t>)
Calculate mean of normal distribution given other params:[<mn>=]scipy.special.nrdtrimn(<p>,<x>,<std>)
Calculate standard deviation of normal distribution given other params:[<std>=]scipy.special.nrdtrisd(<p>,<x>,<mn>)
Poisson cumulative distribution function:[<F>=]scipy.special.pdtr(<k>,<m>[,out=None])
Poisson survival function:[<F>=]scipy.special.pdtrc(<k>,<m>)
Inverse to pdtr vs m:[<m>=]scipy.special.pdtri(<k>,<y>)
Inverse to pdtr vs k:[<k>=]scipy.special.pdtrik(<p>,<m>)
Student t distribution cumulative distribution function:[<F>=]scipy.special.stdtr(<df>,<t>)
Inverse of stdtr vs df:[<df>=]scipy.special.stdtridf(<p>,<t>)
Inverse of stdtr vs t:[<t>=]scipy.special.stdtrit(<df>,<p>)
Chi square cumulative distribution function:[<F>=]scipy.special.chdtr(v, x[,out=None])
Chi square survival function:[<F>=]scipy.special.chdtrc(<v>,<x>[,out=None])
Inverse to chdtrc with respect to x:[<x>=]scipy.special.chdtri(<v>,<p>[,out=None])
Inverse to chdtr with respect to v:[<v>=]scipy.special.chdtriv(<p>,<x>[,out=None])
Gaussian cumulative distribution function:[<F>=]scipy.special.ndtr(<x>)
Logarithm of Gaussian cumulative distribution function:[<F>=]scipy.special.log_ndtr(<x>)
Inverse of ndtr vs x:[<x>=]scipy.special.ndtri(<y>)
Non-central chi square cumulative distribution function:[<F>=]scipy.special.chndtr(<x>,<df>,<nc>)
Inverse to chndtr vs df:[<df>=]scipy.special.chndtridf(<x>,<p>,<nc>)
Inverse to chndtr vs nc:[<nc>=]scipy.special.chndtrinc(<x>,<df>,<p>)
Inverse to chndtr vs x:[<x>=]scipy.special.chndtrix(<p>,<df>,<nc>)
Kolmogorov-Smirnov complementary cumulative distribution function:[<s>=]scipy.special.smirnov(<n>,<d>)
Inverse to smirnov:[<is>=]scipy.special.smirnovi(<n>,<p>)
Complementary cumulative distribution (Survival Function) function of Kolmogorov distribution:[<k>=]scipy.special.kolmogorov(<y>)
Inverse Survival Function of Kolmogorov distribution:[<ik>=]scipy.special.kolmogi(<p>)
Tukey-Lambda cumulative distribution function:[<F>=]scipy.special.tklmbda(<x>,<lmbda>)
Logit ufunc for ndarrays:[<out>=]scipy.special.logit(<x>)
Expit (a.k.a. logistic sigmoid) ufunc for ndarrays:[<out>=]scipy.special.expit(x)
Compute the Box-Cox transformation:[<y>=]scipy.special.boxcox(<x>,<lmbda>)
Compute the Box-Cox transformation of 1 + x:[<y>=]scipy.special.boxcox1p(<x>,<lmbda>)
Compute the inverse of the Box-Cox transformation:[<x>=]scipy.special.inv_boxcox(<y>,<lmbda>)
Compute the inverse of the Box-Cox transformation:[<y>=]scipy.special.inv_boxcox1p(<y>,<lmbda>)
Owen's T Function:[<t>=]scipy.special.owens_t(<h>,<a>)

(6)信息论函数(Information Theory Function):

Elementwise function for computing entropy:[<res>=]scipy.special.entr(<x>)
Elementwise function for computing relative entropy:[<rres>=]scipy.special.rel_entr(<x>,<y>[,out=None])
Elementwise function for computing Kullback-Leibler divergence:[<res>=]scipy.special.kl_div(<x>,<y>[,out=None])
Huber loss function:[<res>=]scipy.special.huber(<delta>,<r>)
Pseudo-Huber loss function:[<res>=]scipy.special.pseudo_huber(<delta>,<r>)

(7)伽马函数(Gamma Function):

gamma function:[<gamma>=]scipy.special.gamma(<z>)
Logarithm of the absolute value of the gamma function:[<gammaln>=]scipy.special.gammaln(<x>[,out=None])
Principal branch of the logarithm of the gamma function:[<loggamma>=]scipy.special.loggamma(<z>[,out=None])
Sign of the gamma function:[<gammasgn>=]scipy.special.gammasgn(<x>)
Regularized lower incomplete gamma function:[<gammainc>=]scipy.special.gammainc(<a>,<x>)
Inverse to the lower incomplete gamma function with respect to x:[<igammainc>=]scipy.special.gammaincinv(<a>,<y>)
Regularized upper incomplete gamma function:[<gammaincc>=]scipy.special.gammaincc(<a>,<x>)
Inverse of the upper incomplete gamma function with respect to x:[<igammaincc>=]scipy.special.gammainccinv(<a>,<y>)
Beta function:[<beta>=]scipy.special.beta(<a>,<b>[,out=None])
Natural logarithm of absolute value of beta function:s[<betaln>=]cipy.special.betaln(<a>,<b>)
Incomplete beta function:[<betainc>=]scipy.special.betainc(<a>,<b>,<x>[,out=None])
Inverse of the incomplete beta function:[<ibetainc>=]scipy.special.betaincinv(<a>,<b>,<y>[,out=None])
The digamma function:[<psi>=]scipy.special.psi(z[,out=None])
Reciprocal of the gamma function:[<rgamma>=]scipy.special.rgamma(<z>[,out=None])
Polygamma functions:[<pgamma>=]scipy.special.polygamma(<n>,<x>)
Returns the log of multivariate gamma, also sometimes called the generalized gamma:[<ngammaln>=]scipy.special.multigammaln(<a>,<d>)
The digamma function:[<digamma>=]scipy.special.digamma(<z>[,out=None])
Pochhammer symbol:[<poch>=]scipy.special.poch(<z>,<m>)

(8)误差函数(Error Function)/高斯误差函数(Gauss Error Function):

Returns the error function of complex argument:[<erf>=]scipy.special.erf(<z>)
Complementary error function, 1 - erf(x):[<erfc>=]scipy.special.erfc(x[,out=None])
Scaled complementary error function, exp(x**2) * erfc(x):[<erfcx>=]scipy.special.erfcx(<x>[,out=None])
Imaginary error function, -i * erf(i * z):[<erfi>=]scipy.special.erfi(<z>[,out=None])
Inverse of the error function:[<ierf>=]scipy.special.erfinv(<x>[,out=None,where=True,casting='same_kind',order='K',dtype=None,subok=True])
Inverse of the complementary error function:[<ierfc>=]scipy.special.erfcinv(<x>[,out=None,where=True,casting='same_kind',order='K',dtype=None,subok=True])
Faddeeva function:[<w>=]scipy.special.wofz(<z>)
Dawson's integral:[<d>=]scipy.special.dawsn(<x>)

#####################################################以下非通用函数#####################################################

Compute the first nt zero in the first quadrant, ordered by absolute value:[<erfz>=]scipy.special.erf_zeros(<nt>)

猜你喜欢

转载自blog.csdn.net/weixin_46131409/article/details/114640747