chaospy.lanczos

chaospy.lanczos(order, dist, rule='clenshaw_curtis', tolerance=1e-12, scaling=3, n_max=10000.0)[source]

Discretized Lanczos’ method.

Iterative increase the quadrature order until the norms converges.

Args:
order (int):

The order create recurrence coefficients for.

dist (chaospy.Distribution):

The distribution to create recurrence coefficients with respect to.

rule (str):

The rule to use to create quadrature nodes and weights from.

tolerance (float):

The allowed relative error in norm between two quadrature orders before method assumes convergence.

scaling (float):

A multiplier the adaptive order increases with for each step quadrature order is not converged. Use 0 to indicate unit increments.

n_max (int):

The allowed number of quadrature points to use in approximation.

Returns:
(numpy.ndarray, numpy.ndarray, numpy.ndarray):
coefficients:

The recurrence coefficients created using the discretized Stieltjes’ method, with shape == (2, D, order+1).

Examples:
>>> dist = chaospy.J(chaospy.Beta(3, 6), chaospy.Normal())
>>> alpha, beta = chaospy.lanczos(3, dist)
>>> alpha.round(5)
array([[ 0.33333,  0.39394,  0.42657,  0.44615],
       [-0.     , -0.     , -0.     , -0.     ]])
>>> beta.round(5)
array([[1.     , 0.02222, 0.03471, 0.04227],
       [1.     , 1.     , 2.     , 3.     ]])
Notes:

The script is adapted from the routine RKPW in W.B. Gragg and W.J. Harrod, “The numerically stable reconstruction of Jacobi matrices from spectral data”, Numer. Math. 44 (1984), 317-335.