Quadrature¶
Gaussian quadrature utilities for use with the Python Active-subspaces Utility Library.
-
active_subspaces.utils.quadrature.
g1d
(N, quadtype)¶ One-dimensional Gaussian quadrature rule.
Parameters: - N (int) – number of nodes in the quadrature rule
- quadtype (str) – type of quadrature rule {‘Legendre’, ‘Hermite’}
Returns: - x (ndarray) – N-by-1 array of quadrature nodes
- w (ndarray) – N-by-1 array of quadrature weights
See also
utils.quadrature.gauss_hermite()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
gauss_hermite
(N)¶ Tensor product Gauss-Hermite quadrature rule.
Parameters: N (int[]) – number of nodes in each dimension of the quadrature rule Returns: - x (ndarray) – N-by-1 array of quadrature nodes
- w (ndarray) – N-by-1 array of quadrature weights
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
gauss_legendre
(N)¶ Tensor product Gauss-Legendre quadrature rule.
Parameters: N (int[]) – number of nodes in each dimension of the quadrature rule Returns: - x (ndarray) – N-by-1 array of quadrature nodes
- w (ndarray) – N-by-1 array of quadrature weights
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
gh1d
(N)¶ One-dimensional Gauss-Hermite quadrature rule.
Parameters: N (int) – number of nodes in the quadrature rule Returns: - x (ndarray) – N-by-1 array of quadrature nodes
- w (ndarray) – N-by-1 array of quadrature weights
See also
utils.quadrature.gauss_hermite()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
gl1d
(N)¶ One-dimensional Gauss-Legendre quadrature rule.
Parameters: N (int) – number of nodes in the quadrature rule Returns: - x (ndarray) – N-by-1 array of quadrature nodes
- w (ndarray) – N-by-1 array of quadrature weights
See also
utils.quadrature.gauss_legendre()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
jacobi_matrix
(ab)¶ Tri-diagonal Jacobi matrix of recurrence coefficients.
Parameters: ab (ndarray) – N-by-2 array of recurrence coefficients Returns: J – (N-1)-by-(N-1) symmetric, tridiagonal Jacobi matrix associated with the orthogonal polynomials Return type: ndarray See also
utils.quadrature.r_hermite()
,utils.quadrature.gauss_hermite()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
r_hermite
(N)¶ Recurrence coefficients for the Hermite orthogonal polynomials.
Parameters: N (int) – the number of recurrence coefficients Returns: ab – an N-by-2 array of the recurrence coefficients Return type: ndarray See also
utils.quadrature.jacobi_matrix()
,utils.quadrature.gauss_hermite()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.
-
active_subspaces.utils.quadrature.
r_jacobi
(N, l, r, a, b)¶ Recurrence coefficients for the Legendre orthogonal polynomials.
Parameters: - N (int) – the number of recurrence coefficients
- l (float) – the left endpoint of the interval
- r (float) – the right endpoint of the interval
- a (float) – Jacobi weight parameter
- b (float) – Jacobi weight parameter
Returns: ab – an N-by-2 array of the recurrence coefficients
Return type: ndarray
See also
utils.quadrature.jacobi_matrix()
,utils.quadrature.gauss_legendre()
Notes
This computation is inspired by Walter Gautschi’s code at https://www.cs.purdue.edu/archives/2002/wxg/codes/OPQ.html.