__init__.py 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. """
  2. ========================================
  3. Special functions (:mod:`scipy.special`)
  4. ========================================
  5. .. module:: scipy.special
  6. Nearly all of the functions below are universal functions and follow
  7. broadcasting and automatic array-looping rules. Exceptions are
  8. noted.
  9. .. seealso::
  10. `scipy.special.cython_special` -- Typed Cython versions of special functions
  11. Error handling
  12. ==============
  13. Errors are handled by returning NaNs or other appropriate values.
  14. Some of the special function routines can emit warnings or raise
  15. exceptions when an error occurs. By default this is disabled; to
  16. query and control the current error handling state the following
  17. functions are provided.
  18. .. autosummary::
  19. :toctree: generated/
  20. geterr -- Get the current way of handling special-function errors.
  21. seterr -- Set how special-function errors are handled.
  22. errstate -- Context manager for special-function error handling.
  23. SpecialFunctionWarning -- Warning that can be emitted by special functions.
  24. SpecialFunctionError -- Exception that can be raised by special functions.
  25. Available functions
  26. ===================
  27. Airy functions
  28. --------------
  29. .. autosummary::
  30. :toctree: generated/
  31. airy -- Airy functions and their derivatives.
  32. airye -- Exponentially scaled Airy functions and their derivatives.
  33. ai_zeros -- [+]Compute `nt` zeros and values of the Airy function Ai and its derivative.
  34. bi_zeros -- [+]Compute `nt` zeros and values of the Airy function Bi and its derivative.
  35. itairy -- Integrals of Airy functions
  36. Elliptic Functions and Integrals
  37. --------------------------------
  38. .. autosummary::
  39. :toctree: generated/
  40. ellipj -- Jacobian elliptic functions
  41. ellipk -- Complete elliptic integral of the first kind.
  42. ellipkm1 -- Complete elliptic integral of the first kind around `m` = 1
  43. ellipkinc -- Incomplete elliptic integral of the first kind
  44. ellipe -- Complete elliptic integral of the second kind
  45. ellipeinc -- Incomplete elliptic integral of the second kind
  46. Bessel Functions
  47. ----------------
  48. .. autosummary::
  49. :toctree: generated/
  50. jv -- Bessel function of the first kind of real order and complex argument.
  51. jve -- Exponentially scaled Bessel function of order `v`.
  52. yn -- Bessel function of the second kind of integer order and real argument.
  53. yv -- Bessel function of the second kind of real order and complex argument.
  54. yve -- Exponentially scaled Bessel function of the second kind of real order.
  55. kn -- Modified Bessel function of the second kind of integer order `n`
  56. kv -- Modified Bessel function of the second kind of real order `v`
  57. kve -- Exponentially scaled modified Bessel function of the second kind.
  58. iv -- Modified Bessel function of the first kind of real order.
  59. ive -- Exponentially scaled modified Bessel function of the first kind
  60. hankel1 -- Hankel function of the first kind
  61. hankel1e -- Exponentially scaled Hankel function of the first kind
  62. hankel2 -- Hankel function of the second kind
  63. hankel2e -- Exponentially scaled Hankel function of the second kind
  64. The following is not an universal function:
  65. .. autosummary::
  66. :toctree: generated/
  67. lmbda -- [+]Jahnke-Emden Lambda function, Lambdav(x).
  68. Zeros of Bessel Functions
  69. ^^^^^^^^^^^^^^^^^^^^^^^^^
  70. These are not universal functions:
  71. .. autosummary::
  72. :toctree: generated/
  73. jnjnp_zeros -- [+]Compute zeros of integer-order Bessel functions Jn and Jn'.
  74. jnyn_zeros -- [+]Compute nt zeros of Bessel functions Jn(x), Jn'(x), Yn(x), and Yn'(x).
  75. jn_zeros -- [+]Compute zeros of integer-order Bessel function Jn(x).
  76. jnp_zeros -- [+]Compute zeros of integer-order Bessel function derivative Jn'(x).
  77. yn_zeros -- [+]Compute zeros of integer-order Bessel function Yn(x).
  78. ynp_zeros -- [+]Compute zeros of integer-order Bessel function derivative Yn'(x).
  79. y0_zeros -- [+]Compute nt zeros of Bessel function Y0(z), and derivative at each zero.
  80. y1_zeros -- [+]Compute nt zeros of Bessel function Y1(z), and derivative at each zero.
  81. y1p_zeros -- [+]Compute nt zeros of Bessel derivative Y1'(z), and value at each zero.
  82. Faster versions of common Bessel Functions
  83. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  84. .. autosummary::
  85. :toctree: generated/
  86. j0 -- Bessel function of the first kind of order 0.
  87. j1 -- Bessel function of the first kind of order 1.
  88. y0 -- Bessel function of the second kind of order 0.
  89. y1 -- Bessel function of the second kind of order 1.
  90. i0 -- Modified Bessel function of order 0.
  91. i0e -- Exponentially scaled modified Bessel function of order 0.
  92. i1 -- Modified Bessel function of order 1.
  93. i1e -- Exponentially scaled modified Bessel function of order 1.
  94. k0 -- Modified Bessel function of the second kind of order 0, :math:`K_0`.
  95. k0e -- Exponentially scaled modified Bessel function K of order 0
  96. k1 -- Modified Bessel function of the second kind of order 1, :math:`K_1(x)`.
  97. k1e -- Exponentially scaled modified Bessel function K of order 1
  98. Integrals of Bessel Functions
  99. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  100. .. autosummary::
  101. :toctree: generated/
  102. itj0y0 -- Integrals of Bessel functions of order 0
  103. it2j0y0 -- Integrals related to Bessel functions of order 0
  104. iti0k0 -- Integrals of modified Bessel functions of order 0
  105. it2i0k0 -- Integrals related to modified Bessel functions of order 0
  106. besselpoly -- [+]Weighted integral of a Bessel function.
  107. Derivatives of Bessel Functions
  108. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  109. .. autosummary::
  110. :toctree: generated/
  111. jvp -- Compute nth derivative of Bessel function Jv(z) with respect to `z`.
  112. yvp -- Compute nth derivative of Bessel function Yv(z) with respect to `z`.
  113. kvp -- Compute nth derivative of real-order modified Bessel function Kv(z)
  114. ivp -- Compute nth derivative of modified Bessel function Iv(z) with respect to `z`.
  115. h1vp -- Compute nth derivative of Hankel function H1v(z) with respect to `z`.
  116. h2vp -- Compute nth derivative of Hankel function H2v(z) with respect to `z`.
  117. Spherical Bessel Functions
  118. ^^^^^^^^^^^^^^^^^^^^^^^^^^
  119. .. autosummary::
  120. :toctree: generated/
  121. spherical_jn -- Spherical Bessel function of the first kind or its derivative.
  122. spherical_yn -- Spherical Bessel function of the second kind or its derivative.
  123. spherical_in -- Modified spherical Bessel function of the first kind or its derivative.
  124. spherical_kn -- Modified spherical Bessel function of the second kind or its derivative.
  125. Riccati-Bessel Functions
  126. ^^^^^^^^^^^^^^^^^^^^^^^^
  127. These are not universal functions:
  128. .. autosummary::
  129. :toctree: generated/
  130. riccati_jn -- [+]Compute Ricatti-Bessel function of the first kind and its derivative.
  131. riccati_yn -- [+]Compute Ricatti-Bessel function of the second kind and its derivative.
  132. Struve Functions
  133. ----------------
  134. .. autosummary::
  135. :toctree: generated/
  136. struve -- Struve function.
  137. modstruve -- Modified Struve function.
  138. itstruve0 -- Integral of the Struve function of order 0.
  139. it2struve0 -- Integral related to the Struve function of order 0.
  140. itmodstruve0 -- Integral of the modified Struve function of order 0.
  141. Raw Statistical Functions
  142. -------------------------
  143. .. seealso:: :mod:`scipy.stats`: Friendly versions of these functions.
  144. .. autosummary::
  145. :toctree: generated/
  146. bdtr -- Binomial distribution cumulative distribution function.
  147. bdtrc -- Binomial distribution survival function.
  148. bdtri -- Inverse function to `bdtr` with respect to `p`.
  149. bdtrik -- Inverse function to `bdtr` with respect to `k`.
  150. bdtrin -- Inverse function to `bdtr` with respect to `n`.
  151. btdtr -- Cumulative density function of the beta distribution.
  152. btdtri -- The `p`-th quantile of the beta distribution.
  153. btdtria -- Inverse of `btdtr` with respect to `a`.
  154. btdtrib -- btdtria(a, p, x)
  155. fdtr -- F cumulative distribution function.
  156. fdtrc -- F survival function.
  157. fdtri -- The `p`-th quantile of the F-distribution.
  158. fdtridfd -- Inverse to `fdtr` vs dfd
  159. gdtr -- Gamma distribution cumulative density function.
  160. gdtrc -- Gamma distribution survival function.
  161. gdtria -- Inverse of `gdtr` vs a.
  162. gdtrib -- Inverse of `gdtr` vs b.
  163. gdtrix -- Inverse of `gdtr` vs x.
  164. nbdtr -- Negative binomial cumulative distribution function.
  165. nbdtrc -- Negative binomial survival function.
  166. nbdtri -- Inverse of `nbdtr` vs `p`.
  167. nbdtrik -- Inverse of `nbdtr` vs `k`.
  168. nbdtrin -- Inverse of `nbdtr` vs `n`.
  169. ncfdtr -- Cumulative distribution function of the non-central F distribution.
  170. ncfdtridfd -- Calculate degrees of freedom (denominator) for the noncentral F-distribution.
  171. ncfdtridfn -- Calculate degrees of freedom (numerator) for the noncentral F-distribution.
  172. ncfdtri -- Inverse cumulative distribution function of the non-central F distribution.
  173. ncfdtrinc -- Calculate non-centrality parameter for non-central F distribution.
  174. nctdtr -- Cumulative distribution function of the non-central `t` distribution.
  175. nctdtridf -- Calculate degrees of freedom for non-central t distribution.
  176. nctdtrit -- Inverse cumulative distribution function of the non-central t distribution.
  177. nctdtrinc -- Calculate non-centrality parameter for non-central t distribution.
  178. nrdtrimn -- Calculate mean of normal distribution given other params.
  179. nrdtrisd -- Calculate standard deviation of normal distribution given other params.
  180. pdtr -- Poisson cumulative distribution function
  181. pdtrc -- Poisson survival function
  182. pdtri -- Inverse to `pdtr` vs m
  183. pdtrik -- Inverse to `pdtr` vs k
  184. stdtr -- Student t distribution cumulative density function
  185. stdtridf -- Inverse of `stdtr` vs df
  186. stdtrit -- Inverse of `stdtr` vs `t`
  187. chdtr -- Chi square cumulative distribution function
  188. chdtrc -- Chi square survival function
  189. chdtri -- Inverse to `chdtrc`
  190. chdtriv -- Inverse to `chdtr` vs `v`
  191. ndtr -- Gaussian cumulative distribution function.
  192. log_ndtr -- Logarithm of Gaussian cumulative distribution function.
  193. ndtri -- Inverse of `ndtr` vs x
  194. chndtr -- Non-central chi square cumulative distribution function
  195. chndtridf -- Inverse to `chndtr` vs `df`
  196. chndtrinc -- Inverse to `chndtr` vs `nc`
  197. chndtrix -- Inverse to `chndtr` vs `x`
  198. smirnov -- Kolmogorov-Smirnov complementary cumulative distribution function
  199. smirnovi -- Inverse to `smirnov`
  200. kolmogorov -- Complementary cumulative distribution function of Kolmogorov distribution
  201. kolmogi -- Inverse function to `kolmogorov`
  202. tklmbda -- Tukey-Lambda cumulative distribution function
  203. logit -- Logit ufunc for ndarrays.
  204. expit -- Expit ufunc for ndarrays.
  205. boxcox -- Compute the Box-Cox transformation.
  206. boxcox1p -- Compute the Box-Cox transformation of 1 + `x`.
  207. inv_boxcox -- Compute the inverse of the Box-Cox transformation.
  208. inv_boxcox1p -- Compute the inverse of the Box-Cox transformation.
  209. owens_t -- Owen's T Function.
  210. Information Theory Functions
  211. ----------------------------
  212. .. autosummary::
  213. :toctree: generated/
  214. entr -- Elementwise function for computing entropy.
  215. rel_entr -- Elementwise function for computing relative entropy.
  216. kl_div -- Elementwise function for computing Kullback-Leibler divergence.
  217. huber -- Huber loss function.
  218. pseudo_huber -- Pseudo-Huber loss function.
  219. Gamma and Related Functions
  220. ---------------------------
  221. .. autosummary::
  222. :toctree: generated/
  223. gamma -- Gamma function.
  224. gammaln -- Logarithm of the absolute value of the Gamma function for real inputs.
  225. loggamma -- Principal branch of the logarithm of the Gamma function.
  226. gammasgn -- Sign of the gamma function.
  227. gammainc -- Regularized lower incomplete gamma function.
  228. gammaincinv -- Inverse to `gammainc`
  229. gammaincc -- Regularized upper incomplete gamma function.
  230. gammainccinv -- Inverse to `gammaincc`
  231. beta -- Beta function.
  232. betaln -- Natural logarithm of absolute value of beta function.
  233. betainc -- Incomplete beta integral.
  234. betaincinv -- Inverse function to beta integral.
  235. psi -- The digamma function.
  236. rgamma -- Gamma function inverted
  237. polygamma -- Polygamma function n.
  238. multigammaln -- Returns the log of multivariate gamma, also sometimes called the generalized gamma.
  239. digamma -- psi(x[, out])
  240. poch -- Rising factorial (z)_m
  241. Error Function and Fresnel Integrals
  242. ------------------------------------
  243. .. autosummary::
  244. :toctree: generated/
  245. erf -- Returns the error function of complex argument.
  246. erfc -- Complementary error function, ``1 - erf(x)``.
  247. erfcx -- Scaled complementary error function, ``exp(x**2) * erfc(x)``.
  248. erfi -- Imaginary error function, ``-i erf(i z)``.
  249. erfinv -- Inverse function for erf.
  250. erfcinv -- Inverse function for erfc.
  251. wofz -- Faddeeva function
  252. dawsn -- Dawson's integral.
  253. fresnel -- Fresnel sin and cos integrals
  254. fresnel_zeros -- Compute nt complex zeros of sine and cosine Fresnel integrals S(z) and C(z).
  255. modfresnelp -- Modified Fresnel positive integrals
  256. modfresnelm -- Modified Fresnel negative integrals
  257. These are not universal functions:
  258. .. autosummary::
  259. :toctree: generated/
  260. erf_zeros -- [+]Compute nt complex zeros of error function erf(z).
  261. fresnelc_zeros -- [+]Compute nt complex zeros of cosine Fresnel integral C(z).
  262. fresnels_zeros -- [+]Compute nt complex zeros of sine Fresnel integral S(z).
  263. Legendre Functions
  264. ------------------
  265. .. autosummary::
  266. :toctree: generated/
  267. lpmv -- Associated Legendre function of integer order and real degree.
  268. sph_harm -- Compute spherical harmonics.
  269. These are not universal functions:
  270. .. autosummary::
  271. :toctree: generated/
  272. clpmn -- [+]Associated Legendre function of the first kind for complex arguments.
  273. lpn -- [+]Legendre function of the first kind.
  274. lqn -- [+]Legendre function of the second kind.
  275. lpmn -- [+]Sequence of associated Legendre functions of the first kind.
  276. lqmn -- [+]Sequence of associated Legendre functions of the second kind.
  277. Ellipsoidal Harmonics
  278. ---------------------
  279. .. autosummary::
  280. :toctree: generated/
  281. ellip_harm -- Ellipsoidal harmonic functions E^p_n(l)
  282. ellip_harm_2 -- Ellipsoidal harmonic functions F^p_n(l)
  283. ellip_normal -- Ellipsoidal harmonic normalization constants gamma^p_n
  284. Orthogonal polynomials
  285. ----------------------
  286. The following functions evaluate values of orthogonal polynomials:
  287. .. autosummary::
  288. :toctree: generated/
  289. assoc_laguerre -- Compute the generalized (associated) Laguerre polynomial of degree n and order k.
  290. eval_legendre -- Evaluate Legendre polynomial at a point.
  291. eval_chebyt -- Evaluate Chebyshev polynomial of the first kind at a point.
  292. eval_chebyu -- Evaluate Chebyshev polynomial of the second kind at a point.
  293. eval_chebyc -- Evaluate Chebyshev polynomial of the first kind on [-2, 2] at a point.
  294. eval_chebys -- Evaluate Chebyshev polynomial of the second kind on [-2, 2] at a point.
  295. eval_jacobi -- Evaluate Jacobi polynomial at a point.
  296. eval_laguerre -- Evaluate Laguerre polynomial at a point.
  297. eval_genlaguerre -- Evaluate generalized Laguerre polynomial at a point.
  298. eval_hermite -- Evaluate physicist's Hermite polynomial at a point.
  299. eval_hermitenorm -- Evaluate probabilist's (normalized) Hermite polynomial at a point.
  300. eval_gegenbauer -- Evaluate Gegenbauer polynomial at a point.
  301. eval_sh_legendre -- Evaluate shifted Legendre polynomial at a point.
  302. eval_sh_chebyt -- Evaluate shifted Chebyshev polynomial of the first kind at a point.
  303. eval_sh_chebyu -- Evaluate shifted Chebyshev polynomial of the second kind at a point.
  304. eval_sh_jacobi -- Evaluate shifted Jacobi polynomial at a point.
  305. The following functions compute roots and quadrature weights for
  306. orthogonal polynomials:
  307. .. autosummary::
  308. :toctree: generated/
  309. roots_legendre -- Gauss-Legendre quadrature.
  310. roots_chebyt -- Gauss-Chebyshev (first kind) quadrature.
  311. roots_chebyu -- Gauss-Chebyshev (second kind) quadrature.
  312. roots_chebyc -- Gauss-Chebyshev (first kind) quadrature.
  313. roots_chebys -- Gauss-Chebyshev (second kind) quadrature.
  314. roots_jacobi -- Gauss-Jacobi quadrature.
  315. roots_laguerre -- Gauss-Laguerre quadrature.
  316. roots_genlaguerre -- Gauss-generalized Laguerre quadrature.
  317. roots_hermite -- Gauss-Hermite (physicst's) quadrature.
  318. roots_hermitenorm -- Gauss-Hermite (statistician's) quadrature.
  319. roots_gegenbauer -- Gauss-Gegenbauer quadrature.
  320. roots_sh_legendre -- Gauss-Legendre (shifted) quadrature.
  321. roots_sh_chebyt -- Gauss-Chebyshev (first kind, shifted) quadrature.
  322. roots_sh_chebyu -- Gauss-Chebyshev (second kind, shifted) quadrature.
  323. roots_sh_jacobi -- Gauss-Jacobi (shifted) quadrature.
  324. The functions below, in turn, return the polynomial coefficients in
  325. :class:`~.orthopoly1d` objects, which function similarly as :ref:`numpy.poly1d`.
  326. The :class:`~.orthopoly1d` class also has an attribute ``weights`` which returns
  327. the roots, weights, and total weights for the appropriate form of Gaussian
  328. quadrature. These are returned in an ``n x 3`` array with roots in the first
  329. column, weights in the second column, and total weights in the final column.
  330. Note that :class:`~.orthopoly1d` objects are converted to ``poly1d`` when doing
  331. arithmetic, and lose information of the original orthogonal polynomial.
  332. .. autosummary::
  333. :toctree: generated/
  334. legendre -- [+]Legendre polynomial.
  335. chebyt -- [+]Chebyshev polynomial of the first kind.
  336. chebyu -- [+]Chebyshev polynomial of the second kind.
  337. chebyc -- [+]Chebyshev polynomial of the first kind on :math:`[-2, 2]`.
  338. chebys -- [+]Chebyshev polynomial of the second kind on :math:`[-2, 2]`.
  339. jacobi -- [+]Jacobi polynomial.
  340. laguerre -- [+]Laguerre polynomial.
  341. genlaguerre -- [+]Generalized (associated) Laguerre polynomial.
  342. hermite -- [+]Physicist's Hermite polynomial.
  343. hermitenorm -- [+]Normalized (probabilist's) Hermite polynomial.
  344. gegenbauer -- [+]Gegenbauer (ultraspherical) polynomial.
  345. sh_legendre -- [+]Shifted Legendre polynomial.
  346. sh_chebyt -- [+]Shifted Chebyshev polynomial of the first kind.
  347. sh_chebyu -- [+]Shifted Chebyshev polynomial of the second kind.
  348. sh_jacobi -- [+]Shifted Jacobi polynomial.
  349. .. warning::
  350. Computing values of high-order polynomials (around ``order > 20``) using
  351. polynomial coefficients is numerically unstable. To evaluate polynomial
  352. values, the ``eval_*`` functions should be used instead.
  353. Hypergeometric Functions
  354. ------------------------
  355. .. autosummary::
  356. :toctree: generated/
  357. hyp2f1 -- Gauss hypergeometric function 2F1(a, b; c; z).
  358. hyp1f1 -- Confluent hypergeometric function 1F1(a, b; x)
  359. hyperu -- Confluent hypergeometric function U(a, b, x) of the second kind
  360. hyp0f1 -- Confluent hypergeometric limit function 0F1.
  361. hyp2f0 -- Hypergeometric function 2F0 in y and an error estimate
  362. hyp1f2 -- Hypergeometric function 1F2 and error estimate
  363. hyp3f0 -- Hypergeometric function 3F0 in y and an error estimate
  364. Parabolic Cylinder Functions
  365. ----------------------------
  366. .. autosummary::
  367. :toctree: generated/
  368. pbdv -- Parabolic cylinder function D
  369. pbvv -- Parabolic cylinder function V
  370. pbwa -- Parabolic cylinder function W
  371. These are not universal functions:
  372. .. autosummary::
  373. :toctree: generated/
  374. pbdv_seq -- [+]Parabolic cylinder functions Dv(x) and derivatives.
  375. pbvv_seq -- [+]Parabolic cylinder functions Vv(x) and derivatives.
  376. pbdn_seq -- [+]Parabolic cylinder functions Dn(z) and derivatives.
  377. Mathieu and Related Functions
  378. -----------------------------
  379. .. autosummary::
  380. :toctree: generated/
  381. mathieu_a -- Characteristic value of even Mathieu functions
  382. mathieu_b -- Characteristic value of odd Mathieu functions
  383. These are not universal functions:
  384. .. autosummary::
  385. :toctree: generated/
  386. mathieu_even_coef -- [+]Fourier coefficients for even Mathieu and modified Mathieu functions.
  387. mathieu_odd_coef -- [+]Fourier coefficients for even Mathieu and modified Mathieu functions.
  388. The following return both function and first derivative:
  389. .. autosummary::
  390. :toctree: generated/
  391. mathieu_cem -- Even Mathieu function and its derivative
  392. mathieu_sem -- Odd Mathieu function and its derivative
  393. mathieu_modcem1 -- Even modified Mathieu function of the first kind and its derivative
  394. mathieu_modcem2 -- Even modified Mathieu function of the second kind and its derivative
  395. mathieu_modsem1 -- Odd modified Mathieu function of the first kind and its derivative
  396. mathieu_modsem2 -- Odd modified Mathieu function of the second kind and its derivative
  397. Spheroidal Wave Functions
  398. -------------------------
  399. .. autosummary::
  400. :toctree: generated/
  401. pro_ang1 -- Prolate spheroidal angular function of the first kind and its derivative
  402. pro_rad1 -- Prolate spheroidal radial function of the first kind and its derivative
  403. pro_rad2 -- Prolate spheroidal radial function of the secon kind and its derivative
  404. obl_ang1 -- Oblate spheroidal angular function of the first kind and its derivative
  405. obl_rad1 -- Oblate spheroidal radial function of the first kind and its derivative
  406. obl_rad2 -- Oblate spheroidal radial function of the second kind and its derivative.
  407. pro_cv -- Characteristic value of prolate spheroidal function
  408. obl_cv -- Characteristic value of oblate spheroidal function
  409. pro_cv_seq -- Characteristic values for prolate spheroidal wave functions.
  410. obl_cv_seq -- Characteristic values for oblate spheroidal wave functions.
  411. The following functions require pre-computed characteristic value:
  412. .. autosummary::
  413. :toctree: generated/
  414. pro_ang1_cv -- Prolate spheroidal angular function pro_ang1 for precomputed characteristic value
  415. pro_rad1_cv -- Prolate spheroidal radial function pro_rad1 for precomputed characteristic value
  416. pro_rad2_cv -- Prolate spheroidal radial function pro_rad2 for precomputed characteristic value
  417. obl_ang1_cv -- Oblate spheroidal angular function obl_ang1 for precomputed characteristic value
  418. obl_rad1_cv -- Oblate spheroidal radial function obl_rad1 for precomputed characteristic value
  419. obl_rad2_cv -- Oblate spheroidal radial function obl_rad2 for precomputed characteristic value
  420. Kelvin Functions
  421. ----------------
  422. .. autosummary::
  423. :toctree: generated/
  424. kelvin -- Kelvin functions as complex numbers
  425. kelvin_zeros -- [+]Compute nt zeros of all Kelvin functions.
  426. ber -- Kelvin function ber.
  427. bei -- Kelvin function bei
  428. berp -- Derivative of the Kelvin function `ber`
  429. beip -- Derivative of the Kelvin function `bei`
  430. ker -- Kelvin function ker
  431. kei -- Kelvin function ker
  432. kerp -- Derivative of the Kelvin function ker
  433. keip -- Derivative of the Kelvin function kei
  434. These are not universal functions:
  435. .. autosummary::
  436. :toctree: generated/
  437. ber_zeros -- [+]Compute nt zeros of the Kelvin function ber(x).
  438. bei_zeros -- [+]Compute nt zeros of the Kelvin function bei(x).
  439. berp_zeros -- [+]Compute nt zeros of the Kelvin function ber'(x).
  440. beip_zeros -- [+]Compute nt zeros of the Kelvin function bei'(x).
  441. ker_zeros -- [+]Compute nt zeros of the Kelvin function ker(x).
  442. kei_zeros -- [+]Compute nt zeros of the Kelvin function kei(x).
  443. kerp_zeros -- [+]Compute nt zeros of the Kelvin function ker'(x).
  444. keip_zeros -- [+]Compute nt zeros of the Kelvin function kei'(x).
  445. Combinatorics
  446. -------------
  447. .. autosummary::
  448. :toctree: generated/
  449. comb -- [+]The number of combinations of N things taken k at a time.
  450. perm -- [+]Permutations of N things taken k at a time, i.e., k-permutations of N.
  451. Lambert W and Related Functions
  452. -------------------------------
  453. .. autosummary::
  454. :toctree: generated/
  455. lambertw -- Lambert W function.
  456. wrightomega -- Wright Omega function.
  457. Other Special Functions
  458. -----------------------
  459. .. autosummary::
  460. :toctree: generated/
  461. agm -- Arithmetic, Geometric Mean.
  462. bernoulli -- Bernoulli numbers B0..Bn (inclusive).
  463. binom -- Binomial coefficient
  464. diric -- Periodic sinc function, also called the Dirichlet function.
  465. euler -- Euler numbers E0..En (inclusive).
  466. expn -- Exponential integral E_n
  467. exp1 -- Exponential integral E_1 of complex argument z
  468. expi -- Exponential integral Ei
  469. factorial -- The factorial of a number or array of numbers.
  470. factorial2 -- Double factorial.
  471. factorialk -- [+]Multifactorial of n of order k, n(!!...!).
  472. shichi -- Hyperbolic sine and cosine integrals.
  473. sici -- Sine and cosine integrals.
  474. softmax -- Softmax function.
  475. spence -- Spence's function, also known as the dilogarithm.
  476. zeta -- Riemann zeta function.
  477. zetac -- Riemann zeta function minus 1.
  478. Convenience Functions
  479. ---------------------
  480. .. autosummary::
  481. :toctree: generated/
  482. cbrt -- Cube root of `x`
  483. exp10 -- 10**x
  484. exp2 -- 2**x
  485. radian -- Convert from degrees to radians
  486. cosdg -- Cosine of the angle `x` given in degrees.
  487. sindg -- Sine of angle given in degrees
  488. tandg -- Tangent of angle x given in degrees.
  489. cotdg -- Cotangent of the angle `x` given in degrees.
  490. log1p -- Calculates log(1+x) for use when `x` is near zero
  491. expm1 -- exp(x) - 1 for use when `x` is near zero.
  492. cosm1 -- cos(x) - 1 for use when `x` is near zero.
  493. round -- Round to nearest integer
  494. xlogy -- Compute ``x*log(y)`` so that the result is 0 if ``x = 0``.
  495. xlog1py -- Compute ``x*log1p(y)`` so that the result is 0 if ``x = 0``.
  496. logsumexp -- Compute the log of the sum of exponentials of input elements.
  497. exprel -- Relative error exponential, (exp(x)-1)/x, for use when `x` is near zero.
  498. sinc -- Return the sinc function.
  499. .. [+] in the description indicates a function which is not a universal
  500. .. function and does not follow broadcasting and automatic
  501. .. array-looping rules.
  502. """
  503. from __future__ import division, print_function, absolute_import
  504. from .sf_error import SpecialFunctionWarning, SpecialFunctionError
  505. from ._ufuncs import *
  506. from .basic import *
  507. from ._logsumexp import logsumexp, softmax
  508. from . import specfun
  509. from . import orthogonal
  510. from .orthogonal import *
  511. from .spfun_stats import multigammaln
  512. from ._ellip_harm import ellip_harm, ellip_harm_2, ellip_normal
  513. from .lambertw import lambertw
  514. from ._spherical_bessel import (spherical_jn, spherical_yn, spherical_in,
  515. spherical_kn)
  516. from numpy import deprecate
  517. hyp2f0 = deprecate(hyp2f0, message="hyp2f0 is deprecated in SciPy 1.2")
  518. hyp1f2 = deprecate(hyp1f2, message="hyp1f2 is deprecated in SciPy 1.2")
  519. hyp3f0 = deprecate(hyp3f0, message="hyp3f0 is deprecated in SciPy 1.2")
  520. del deprecate
  521. __all__ = [s for s in dir() if not s.startswith('_')]
  522. from numpy.dual import register_func
  523. register_func('i0',i0)
  524. del register_func
  525. from scipy._lib._testutils import PytestTester
  526. test = PytestTester(__name__)
  527. del PytestTester