RustQuant_math

Module integration

Source
Expand description

Numerical integration routines. The primary (useful) integrator is the Tanh-Sinh (double exponential) implementation. This module contains functions for numerical integration.

The Tanh-Sinh quadrature is used for the integration. This method uses the hyperbolic trig functions to transform the integral over $[-1, +1]$ to an integral over $\mathbb{R} = (-\infty, +\infty)$.

We have the approximation:

$$ \int_{-1}^{+1} f(x) dx \approx \sum_{\mathbb{R}} w_k f(x_k) $$

The abscissae and weights are calculated as follows:

$$ x_k = \tanh \left( \frac{1}{2} \pi \sinh(kh) \right) $$

$$ w_k = \frac{1}{2} h \pi \cosh(kh) \cosh^{-2} \left( \frac{1}{2} \pi \sinh(kh) \right) $$

Constants§

  • Abscissae: the nodes for the sum evaluation.
  • Weights for the sum evaluation.

Functions§

  • Integrates a function from a to b. Uses the Tanh-Sinh quadrature over [-1, +1] and then transforms to an integral over [a, b].