Performs Global Sensitivity Analysis (GSA) using the Saltelli formulation of Sobol indices.
More...
|
| | SobolSaltelli ()=default |
| | Default constructor.
|
| |
| | SobolSaltelli (size_t nObs, size_t dim, bool secondOrder=false) |
| | Constructs a Sobol-Saltelli analyzer with the given configuration.
|
| |
| size_t | nTotalObs () const |
| | Gets the total number of evaluations required based on \( N \), \( d \), and analysis order.
|
| |
| size_t | dim () const |
| | Gets the number of dimension parameters \( d \).
|
| |
| size_t | nObs () const |
| | Gets the number of base samples \( N \).
|
| |
| Eigen::MatrixXd | evaluationGrid (size_t nObs, std::shared_ptr< cmp::grid::Grid > gridType, bool secondOrder=false) |
| | Constructs the Sobol evaluation grid using the Saltelli sampling scheme.
|
| |
| Eigen::VectorXd | sliceSaltelliOutput (const Eigen::VectorXd &Y, const Eigen::VectorXs &idx, size_t nObs, size_t dim, bool secondOrder) |
| | Slices the output vector Y from the Sobol evaluation grid to keep only valid or specified indices.
|
| |
| SobolResults | compute (const Eigen::VectorXd &Y) |
| | Computes Sobol indices from the output vector Y obtained by evaluating the Saltelli grid.
|
| |
| std::pair< SobolResults, SobolResults > | computeWithBootstrap (const Eigen::VectorXd &Y, size_t nBootstrap, size_t randomSeed=42) |
| | Computes Sobol indices with bootstrap resampling to estimate statistical confidence intervals.
|
| |
Performs Global Sensitivity Analysis (GSA) using the Saltelli formulation of Sobol indices.
Mathematical Foundations
Sobol sensitivity analysis decomposes the total variance \(V(Y)\) of a model \(Y = f(X_1, \dots, X_d)\) with independent inputs into contributions from individual inputs and their interactions:
\[ V(Y) = \sum_{i=1}^d V_i + \sum_{1 \le i < j \le d} V_{ij} + \dots + V_{1\dots d} \]
Where:
- First-Order Index (Main Effect): Measures the fractional variance contribution of input \(X_i\) alone:
\[ S_i = \frac{V_i}{V(Y)} = \frac{\mathrm{Var}_{X_i}\left(\mathbb{E}_{\mathbf{X}_{\sim i}}[Y | X_i]\right)}{\mathrm{Var}(Y)} \]
- Second-Order Index (Interaction Effect): Measures the interaction effect of inputs \(X_i\) and \(X_j\):
\[ S_{ij} = \frac{V_{ij}}{V(Y)} = \frac{\mathrm{Var}_{X_i, X_j}\left(\mathbb{E}_{\mathbf{X}_{\sim i,j}}[Y | X_i, X_j]\right) - V_i - V_j}{\mathrm{Var}(Y)} \]
- Total-Order Index: Measures the total effect of \(X_i\) including all its interactions:
\[ S_{Ti} = 1 - \frac{\mathrm{Var}_{\mathbf{X}_{\sim i}}\left(\mathbb{E}_{X_i}[Y | \mathbf{X}_{\sim i}]\right)}{\mathrm{Var}(Y)} \]
Implementation Algorithms (Saltelli 2010 Scheme)
- Grid Generation: We draw two independent sample matrices \(\mathbf{A}\) and \(\mathbf{B}\) of size \(N \times d\). We construct \(d\) hybrid matrices \(\mathbf{A}_B^i\) (where column \(i\) is from \(\mathbf{B}\), rest from \(\mathbf{A}\)) and \(d(d-1)/2\) hybrid matrices \(\mathbf{A}_B^{ij}\) (where columns \(i\) and \(j\) are from \(\mathbf{B}\), rest from \(\mathbf{A}\)).
- Evaluation: Evaluate the model outputs: \(\mathbf{y}_A\), \(\mathbf{y}_B\), \(\mathbf{y}_{AB}^i\), and \(\mathbf{y}_{AB}^{ij}\).
- Estimator Formulations:
Constraints & Invariants
- Sample Independence: The input matrices \(\mathbf{A}\) and \(\mathbf{B}\) must be statistically independent.
- Computational Complexity: The number of model evaluations required is \(N(d + 2)\) for first and total order, and \(N(2d + 2 + d(d-1)/2)\) if second-order interaction indices are requested.