Skip to main content

Module quadrature

Module quadrature 

Source
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 degree 2n - 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 degree 2n - 1.
gaussian_nodes
Quadrature nodes (w, weight) of Gaussian noise, E f(W) ≈ Σ weight f(w), from the n-point gauss_hermite rule: W ~ CN(0, σ²) by the product rule on the two dimensions (complex), or W ~ N(0, σ²) on the real axis. The nodes of negligible weight (below 1e-300) are left out.
simpson
Composite Simpson’s rule $\int_{a}^{b} f(t), dt$ on n intervals (n even, at least 2), exact for cubics.
simpson_weight
The weight of node k of Simpson’s rule on n intervals (n even), before the factor $h/3$: 1 at the ends, 4 at the odd nodes, 2 at the even inner ones.
try_simpson
simpson of a fallible integrand: the first error stops the quadrature.