Base Polynomial Chaos Expansion¶
base
¶
Base class for Polynomial Chaos Expansion (PCE) models.
This module provides the base class for Polynomial Chaos Expansion (PCE) models. The class provides the basic functionality for constructing and evaluating PCE models.
Classes:
Name | Description |
---|---|
BasePCE |
Base class for Polynomial Chaos Expansion (PCE) models. |
multichaos.base.BasePCE
¶
Base class for Polynomial Chaos Expansion (PCE) models.
This class provides the basic functionality for constructing and evaluating PCE models. The class is designed to be inherited by other PCE models.
Attributes:
Name | Type | Description |
---|---|---|
dist |
ot.Distribution
|
Input probability distribution. |
index_set |
np.ndarray
|
Index set of the PCE. |
n_basis |
int
|
Number of basis functions in the PCE. |
risk |
float
|
|
coefficients |
np.ndarray
|
Coefficients of the PCE. |
input_dim |
int
|
Input dimension. |
output_dim |
int
|
Output dimension. |
tf |
callable
|
Transformation function. |
tf_inv |
callable
|
Inverse transformation function. |
__init__
¶
Initialize Base PCE object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dist
|
ot.Distribution
|
Input probability distribution. |
required |
index_set
|
np.ndarray
|
Index set of the PCE. |
None
|
risk
|
float
|
0
|
set_transformation
¶
Set the transformation functions.
This method sets up the necessary components for transforming the input distribution to the underlying measure of the PCE.
__call__
¶
Evaluate the PCE at the given input data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_in
|
np.ndarray
|
Input data points. |
required |
compute_mean
¶
Compute the mean of the PCE.
This returns the mean of the PCE \(P = \sum_{\lambda \in \Lambda} c_\lambda P_\lambda\), which, due to orthonormality, is given by \(\mathbb{E}[P] = c_\mathbf{0}\).
Returns:
Type | Description |
---|---|
float
|
Mean of the PCE. |
compute_variance
¶
Compute the variance of the PCE.
This returns the variance of the PCE \(P = \sum_{\lambda \in \Lambda} c_\lambda P_\lambda\), which, due to orthonormality, is given by \(\mathbb{V}[P] = \sum_{\lambda \in \Lambda \setminus \{\mathbf{0}\}} c_\lambda^2\).
Returns:
Type | Description |
---|---|
float
|
Variance of the PCE. |
l2_error
¶
Compute the \(L^2\) error of the PCE.
This method computes the root mean squared error as an estimate to the \(L^2\) error of the PCE with respect to the given data, i.e.
where \(\{(\omega_i, Q_i)\}_{i=1}^N\) denotes the data and \(\hat{Q}\) the PCE model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data_in
|
np.ndarray
|
Input data points of shape |
required |
data_out
|
np.ndarray
|
Output data points of shape |
required |
Returns:
Type | Description |
---|---|
float
|
Root mean squared error. |