Cramér-von Mises indices
A sensitivity index based on the Cramér-von Mises distance. In contrast to the variance based Sobol indices, it takes into account the whole distribution of the model output and is therefore considered as a moment-free method [38]. Furthermore the index can be naturally extended to multivariate model outputs (not implemented yet in UQPy).
Consider a model \(Y=f(X): \mathbb{R}^d \rightarrow \mathbb{R}^k\) with \(d\) inputs \(X_{(1)}, X_{(2)}, \ldots, X_{(d)}\) and \(k\) outputs \(Y_{(1)}, Y_{(2)}, \ldots, Y_{(k)}\). We define the cumulative distribution function \(F(t)\) of \(Y\) as:
and the conditional distribution function \(F(t)\) of \(Y\) as:
where, \(\{Z \leqslant t\} \text { means that } \left\{Z_{1} \leqslant t_{1}, \ldots, Z_{k} \leqslant t_{k}\right\}\).
The first order Cramér-von Mises index \(S_{2, C V M}^{i}\) (for input \(v = {i}\)) is defined as:
and the total Cramér-von Mises index \(S_{2, C V M}^{T o t, i}\) (for input \(v = {i}\)) is defined as:
The above first and total order indices are estimated using the Pick-and-Freeze approach. This requires \(N(d+2)\) model evaluations, where \(N\) is the number of samples. (For implementation details, see also [37].)
Cramér-von Mises Class
The CramerVonMisesSensitivity
class is imported using the following command:
>>> from UQpy.sensitivity.CramerVonMisesSensitivity import CramerVonMisesSensitivity
Methods
- class CramerVonMisesSensitivity(runmodel_object, dist_object, random_state=None)[source]
Compute the Cramér-von Mises indices.
Currently only available for models with scalar output.
- Parameters:
runmodel_object – The computational model. It should be of type
RunModel
. The output QoI can be a scalar or vector of lengthny
, then the sensitivity indices of allny
outputs are computed independently.distributions – List of
Distribution
objects corresponding to each random variable, orJointIndependent
object (multivariate RV with independent marginals).random_state – Random seed used to initialize the pseudo-random number generator. Default is
None
.
Methods:
- run(n_samples=1000, estimate_sobol_indices=False, num_bootstrap_samples=None, confidence_level=0.95, disable_CVM_indices=False)[source]
Compute the Cramér-von Mises indices.
- Parameters:
n_samples (
int
) – Number of samples used to compute the Cramér-von Mises indices. Default is 1,000.estimate_sobol_indices (
bool
) – IfTrue
, the Sobol indices are estimated using the pick-and-freeze samples.num_bootstrap_samples (
Optional
[int
]) – Number of bootstrap samples used to estimate the Sobol indices. Default isNone
.confidence_level (
float
) – Confidence level used to compute the confidence intervals of the Cramér-von Mises indices.disable_CVM_indices (
bool
) – IfTrue
, the Cramér-von Mises indices are not computed.
Attributes
- CramerVonMisesSensitivity.first_order_CramerVonMises_indices
First order Cramér-von Mises indices,
numpy.ndarray
of shape(n_variables, 1)
- CramerVonMisesSensitivity.confidence_interval_CramerVonMises
Confidence intervals of the first order Cramér-von Mises indices,
numpy.ndarray
of shape(n_variables, 2)
- CramerVonMisesSensitivity.first_order_sobol_indices
First order Sobol indices computed using the pick-and-freeze samples,
numpy.ndarray
of shape(n_variables, 1)
- CramerVonMisesSensitivity.total_order_sobol_indices
Total order Sobol indices computed using the pick-and-freeze samples,
numpy.ndarray
of shape(n_variables, 1)