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:
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 UQpy distribution 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 UQpy distribution 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)\).

Parameters:
  • tensor (ndarray) – Input data generated from a normal distribution.

  • mean (float) – Mean value of the original normal distribution.

  • std (float) – Standard deviation of the original normal distribution.

Returns:

Standardized data.

static normalized(degree, samples, a, b, pdf_st, p)[source]

Calculates design matrix and normalized polynomials.

Parameters:
  • degree (int) – polynomial degree

  • samples (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 from UQpy distribution object.

  • p (list) – List containing the orthogonal polynomials generated with scipy.

Returns:

Design matrix,normalized polynomials

get_mean()[source]

Returns a float with the mean of the UQpy distribution object.

get_std()[source]

Returns a float with the variance of the UQpy distribution object.

location()[source]

Returns a float with the location of the UQpy distribution object.

scale()[source]

Returns a float with the scale of the UQpy distribution object.

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:
evaluate(x)[source]

Calculates the normalized Legendre polynomials evaluated at sample points.

Parameters:

x (ndarray) – numpy.ndarray containing the samples.

Returns:

Α list of numpy.ndarray with 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:
get_polys(x)[source]

Calculates the normalized Hermite polynomials evaluated at sample points.

Parameters:

xnumpy.ndarray containing the samples.

Returns:

Α list of numpy.ndarray with 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
class PolynomialsND(distributions, multi_index)[source]

Class for multivariate Wiener-Askey chaos polynomials.

Parameters:
  • distributions – Joint probability distribution.

  • multi_index – Polynomial multi-degree (multi-index).

evaluate(eval_data)[source]

Evaluate Nd chaos polynomial on the given data set.

Parameters:

eval_data – Points upon which the ND chaos polynomial will be evaluated.

Return type:

ndarray

Returns:

Evaluations of the ND chaos polynomial.