Legendre polynomials¶
legendre
¶
Legendre polynomials.
This module provides functions to evaluate the orthogonal Legendre polynomials on \([-1, 1]^d\) using tensorized basis functions.
Functions:
Name | Description |
---|---|
legval |
Evaluates Legendre polynomials up to degree \(n\). |
evaluate_basis |
Evaluates a tensorized Legendre basis. |
multichaos.legendre.legval
¶
Evaluates Legendre polynomials up to degree \(n\).
This evaluates the Legendre polynomials \(P_0, \ldots, P_n\) up to degree \(n \in \mathbb{N}_0\) in the given sample. The polynomials are orthonormalized with respect to the uniform weighting on \([-1, 1]\), such that
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
int
|
Number of polynomials to evaluate. |
required |
sample
|
np.ndarray
|
Sample points with shape |
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
Evaluations of shape |
multichaos.legendre.evaluate_basis
¶
Evaluates a tensorized Legendre basis.
Evaluates the tensorized Legendre basis defined by the index set on the given sample. For an index \(\lambda \in \Lambda\) for some multi-index set \(\Lambda \subset \mathbb{N}_0^d\), the corresponding basis function is given by
where \(P_n\) denotes the \(n\)-th univariate Legendre polynomial.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_set
|
np.ndarray
|
Index set \(\Lambda\) of shape |
required |
sample
|
np.ndarray
|
Sample points with shape |
required |
Returns:
Type | Description |
---|---|
np.ndarray
|
Evaluations of the basis on the sample with shape |