chaospy.quadrature.gegenbauer

chaospy.quadrature.gegenbauer(order, alpha, lower=- 1, upper=1, physicist=False)[source]

Gauss-Gegenbauer quadrature rule.

Compute the sample points and weights for Gauss-Gegenbauer quadrature. The sample points are the roots of the nth degree Gegenbauer polynomial. These sample points and weights correctly integrate polynomials of degree \(2N-1\) or less.

Gaussian quadrature come in two variants: physicist and probabilist. For Gauss-Gegenbauer physicist means a weight function \((1-x^2)^{lpha-0.5}\) and weights that sum to :math`2^{2lpha-1}`, and probabilist means a weight function is \(B(lpha+0.5, lpha+0.5) (x-x^2)^{lpha+1/2}\) (where \(B\) is the beta normalizing constant) which sum to 1.

Args:
order (int):

The quadrature order.

alpha (float):

Gegenbauer shape parameter.

lower (float):

Lower bound for the integration interval.

upper (float):

Upper bound for the integration interval.

physicist (bool):

Use physicist weights instead of probabilist.

Returns:
abscissas (numpy.ndarray):

The order+1 quadrature points for where to evaluate the model function with.

weights (numpy.ndarray):

The quadrature weights associated with each abscissas.

Examples:
>>> abscissas, weights = chaospy.quadrature.gegenbauer(3, alpha=2)
>>> abscissas
array([[-0.72741239, -0.26621648,  0.26621648,  0.72741239]])
>>> weights
array([0.10452141, 0.39547859, 0.39547859, 0.10452141])
See also:

chaospy.quadrature.gaussian()