roots_hermite#
- scipy.special.roots_hermite(n, mu=False)[原始碼]#
高斯-厄米 (物理學家) 正交。
計算高斯-厄米正交的樣本點和權重。樣本點是 n 次厄米多項式的根,\(H_n(x)\)。這些樣本點和權重可以正確地積分次數為 \(2n - 1\) 或更小的多項式,積分區間為 \([-\infty, \infty]\),權重函數為 \(w(x) = e^{-x^2}\)。詳情請參閱 [AS] 中的 22.2.14 節。
- 參數:
- nint
正交階數
- mubool, optional
如果為 True,則返回權重之和(可選)。
- 返回:
- xndarray
樣本點
- wndarray
權重
- mufloat
權重之和
註解
對於小於等於 150 的 n 值,使用修改後的 Golub-Welsch 演算法。節點從特徵值問題計算而來,並通過一步牛頓迭代法改進。權重從著名的解析公式計算而來。
對於大於 150 的 n 值,應用最佳漸近演算法,以數值穩定的方式計算節點和權重。該演算法具有線性運行時間,使得非常大的 n 值(數千或更多)的計算成為可能。
參考文獻
[townsend.trogdon.olver-2014]Townsend, A., Trogdon, T., and Olver, S. (2014) Fast computation of Gauss quadrature nodes and weights on the whole real line. arXiv:1410.5286.
[townsend.trogdon.olver-2015]Townsend, A., Trogdon, T., and Olver, S. (2015) Fast computation of Gauss quadrature nodes and weights on the whole real line. IMA Journal of Numerical Analysis DOI:10.1093/imanum/drv002.
[AS]Milton Abramowitz 和 Irene A. Stegun,編輯。《數學函數手冊,包含公式、圖形和數學表格》。紐約:Dover,1972 年。