sensitivity.sensitivity_morris¶
Morris sensitivity analysis.
This module implements the Method of Morris for global screening-based sensitivity analysis. The Morris method estimates elementary effects by sampling trajectories through the parameter space and provides qualitative and semi-quantitative measures of parameter importance.
The implementation supports:
- Classical Morris sampling (Morris, 1991)
- Optimized trajectories (Campolongo et al., 2007)
- Local optimization of trajectories (Ruano et al., 2012)
For each output variable, the following Morris indices are computed:
- mu: Mean of elementary effects
- mu_star: Mean of absolute elementary effects
- sigma: Standard deviation of elementary effects
- mu_star_conf: Confidence interval of mu_star
- r: Combined importance measure
References
- Morris, M.D., 1991. Factorial Sampling Plans for Preliminary Computational Experiments. Technometrics 33, 161-174. https://doi.org/10.1080/00401706.1991.10484804
- Campolongo, F., Cariboni, J., & Saltelli, A. 2007. An effective screening design for sensitivity analysis of large models. Environmental Modelling & Software, 22(10), 1509-1518. https://doi.org/10.1016/j.envsoft.2006.10.004
- Ruano, M.V., Ribes, J., Seco, A., Ferrer, J., 2012. An improved sampling strategy based on trajectory design for application of the Morris method to systems with many input factors. Environmental Modelling & Software 37, 103-109. https://doi.org/10.1016/j.envsoft.2012.03.008
MorrisSensitivityAnalysis
¶
MorrisSensitivityAnalysis(
sensitivity_simulation,
parameters,
groups,
results_path,
N,
optimal_trajectories,
num_levels=4,
local_optimization=True,
seed=None,
n_cores=None,
cache_results=False,
**kwargs,
)
Bases: SensitivityAnalysis
Morris sensitivity analysis.
Campolongo et al., introduces an optimal trajectories approach which attempts to maximize the parameter space scanned for a given number of trajectories (where optimal_trajectories). The approach accomplishes this aim by randomly generating a high number of possible trajectories (500 to 1000) and selecting a subset of r trajectories which have the highest spread in parameter space. The r variable in corresponds to the optimal_trajectories parameter here.
Calculating all possible combinations of trajectories can be computationally expensive. The number of factors makes little difference, but the ratio between number of optimal trajectories and the sample size results in an exponentially increasing number of scores that must be computed to find the optimal combination of trajectories. We suggest going no higher than 4 levels from a pool of 100 samples with this “brute force” approach.
Ruano et al., proposed an alternative approach with an iterative process that maximizes the distance between subgroups of generated trajectories, from which the final set of trajectories are selected, again maximizing the distance between each. The approach is not guaranteed to produce the most optimal spread of trajectories, but are at least locally maximized and significantly reduce the time taken to select trajectories. With local_optimization = True (which is default), it is possible to go higher than the previously suggested 4 levels from a pool of 100 samples.
Resulting simulations are (D+1) * N/T with D number of parameters.
N (int) – The number of trajectories to generate optimal_trajectories - The number of optimal trajectories to sample (between 2 and N) num_levels - The number of grid levels to use (should be even) local_optimization - Flag whether to use local optimization according to Ruano et al. (2012) Speeds up the process tremendously for bigger N and num_levels. If set to False brute force method is used
create_samples
¶
Create samples using the Method of Morris.
Three variants of Morris' sampling for elementary effects are supported:
- Vanilla Morris
when
optimal_trajectoriesisNone/Falseandlocal_optimizationisFalse - Optimised trajectories when
optimal_trajectories=Trueusing Campolongo's enhancements and optionally Ruano's enhancement whenlocal_optimization=True - Morris with groups when the problem definition specifies groups of parameters
calculate_sensitivity
¶
Perform extended Fourier Amplitude Sensitivity Test on model outputs.
Returns a dictionary with keys 'S1' and 'ST', where each entry is a list of size D (the number of parameters) containing the indices in the same order as the parameter file.
Returns a result set with keys mu, mu_star, sigma, and mu_star_conf, where each entry corresponds to the parameters defined in the problem spec or parameter file.
mu metric indicates the mean of the distribution mu_star metric indicates the mean of the distribution of absolute values sigma is the standard deviation of the distribution