Expand description
Quadrature: the composite Simpson rule (simpson, try_simpson,
simpson_weight) and the Gauss rules (gauss_hermite, gauss_legendre, and
gaussian_nodes, the nodes of a Gaussian expectation), re-exported at the root.
Functions§
- gauss_
chebyshev - The nodes $x_{k} = \cos\frac{(2k - 1)\pi}{2n}$ and the equal weights $\pi/n$ of the $n$-point Gauss–Chebyshev rule of the first kind: $\int_{-1}^{1} \frac{f(x)}{\sqrt{1 - x^{2}}},dx \approx \frac{\pi}{n}\sum_{k=1}^{n} f(x_{k})$, exact for polynomials of degree $2n - 1$. A smooth integrand $g$ on $[-1, 1]$ is integrated as $f(x) = g(x)\sqrt{1 - x^{2}}$ (the form of Ding et al. 2014, eq. (4)).
- gauss_
hermite - Nodes and weights of the
n-point Gauss–Hermite rule,∫ f(t) e^{-t²} dt ≈ Σ_k w_k f(t_k), exact for polynomials of degree2n - 1. - gauss_
legendre - Nodes and weights of the
n-point Gauss–Legendre rule on $[-1, 1]$,∫ f(t) dt ≈ Σ_k w_k f(t_k), exact for polynomials of degree2n - 1. - gaussian_
nodes - Quadrature nodes
(w, weight)of Gaussian noise,E f(W) ≈ Σ weight f(w), from then-pointgauss_hermiterule:W ~ CN(0, σ²)by the product rule on the two dimensions (complex), orW ~ N(0, σ²)on the real axis. The nodes of negligible weight (below1e-300) are left out. - simpson
- Composite Simpson’s rule $\int_{a}^{b} f(t), dt$ on
nintervals (neven, at least 2), exact for cubics. - simpson_
weight - The weight of node
kof Simpson’s rule onnintervals (neven), before the factor $h/3$: 1 at the ends, 4 at the odd nodes, 2 at the even inner ones. - try_
simpson simpsonof a fallible integrand: the first error stops the quadrature.