Polynomials
Different families of univariate polynomials can be used for the PCE method. These polynomials must always be orthonormal
with respect to the arbitrary distribution. In UQpy, two families of polynomials are currently available that can be
used from their corresponding classes, namely the Legendre and Hermite polynomial class, appropriate for
data generated from a Uniform and a Normal distribution respectively.
The Polynomials class is imported using the following command:
>>> from UQpy.surrogates.polynomial_chaos.polynomials.baseclass.Polynomials import Polynomials
- class Polynomials(distributions, degree)[source]
Class for polynomials used for the polynomial_chaos method.
- Parameters:
distributions (
Union[Distribution,list[Distribution]]) – Object from a distribution class.degree (
int) – Maximum degree of the polynomials.
- static standardize_sample(x, joint_distribution)[source]
Static method: Standardize data based on the joint probability distribution.
- Parameters:
x – Input data generated from a joint probability distribution.
joint_distribution – joint probability distribution from
UQpydistribution object
- Returns:
Standardized data.
- static standardize_pdf(x, joint_distribution)[source]
Static method: PDF of standardized distributions associated to Hermite or Legendre polynomials.
- Parameters:
x – Input data generated from a joint probability distribution
joint_distribution – joint probability distribution from
UQpydistribution object
- Returns:
Value of standardized PDF calculated for x
- static standardize_normal(tensor, mean, std)[source]
Static method: Standardize data based on the standard normal distribution \(\mathcal{N}(0,1)\).
- static normalized(degree, samples, a, b, pdf_st, p)[source]
Calculates design matrix and normalized polynomials.
- Parameters:
degree (
int) – polynomial degreesamples (
ndarray) – Input samples.a (
float) – Left bound of the support the distribution.b (
float) – Right bound of the support of the distribution.pdf_st (
Callable) – Pdf function generated fromUQpydistribution object.p (
list) – List containing the orthogonal polynomials generated with scipy.
- Returns:
Design matrix,normalized polynomials
Legendre Class
The Legendre class is imported using the following command:
>>> from UQpy.surrogates.polynomial_chaos.polynomials.Legendre import Legendre
- class Legendre(degree, distributions)[source]
Class of univariate polynomials appropriate for data generated from a uniform distribution.
- Parameters:
degree (
int) – Maximum degree of the polynomials.distributions (
Union[Distribution,list[Distribution]]) – Distribution object of the generated samples.
- evaluate(x)[source]
Calculates the normalized Legendre polynomials evaluated at sample points.
- Parameters:
x (
ndarray) –numpy.ndarraycontaining the samples.- Returns:
Α list of
numpy.ndarraywith the design matrix and the normalized polynomials.
Hermite Class
The Hermite class is imported using the following command:
>>> from UQpy.surrogates.polynomial_chaos.polynomials.Hermite import Hermite
- class Hermite(degree, distributions)[source]
Class of univariate polynomials appropriate for data generated from a normal distribution.
- Parameters:
degree (
int) – Maximum degree of the polynomials.distributions (
Union[Distribution,list[Distribution]]) – Distribution object of the generated samples.
- get_polys(x)[source]
Calculates the normalized Hermite polynomials evaluated at sample points.
- Parameters:
x –
numpy.ndarraycontaining the samples.- Returns:
Α list of
numpy.ndarraywith the design matrix and the normalized polynomials.
PolynomialsND Class
The PolynomialsND class is imported using the following command:
>>> from UQpy.surrogates.polynomial_chaos.polynomials.PolynomialsND import PolynomialsND