sensitivity.sensitivity_morris

sensitivity.sensitivity_morris

Morris sensitivity analysis.

Method of Morris, including groups and optimal trajectories (Morris 1991, Campolongo et al. 2007)

Classes

Name Description
MorrisSensitivityAnalysis Morris sensitivity analysis.

MorrisSensitivityAnalysis

sensitivity.sensitivity_morris.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,
)

Morris sensitivity analysis.

Campolongo et al., [2] 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 in [2]) and selecting a subset of r trajectories which have the highest spread in parameter space. The r variable in [2] 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., [3] 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.

[1] Morris, M.D., 1991. Factorial Sampling Plans for Preliminary Computational Experiments. Technometrics 33, 161-174. https://doi.org/10.1080/00401706.1991.10484804 [2] 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 [3] 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

Methods

Name Description
calculate_sensitivity Perform extended Fourier Amplitude Sensitivity Test on model outputs.
create_samples Create samples using the Method of Morris.
plot Morris plot.
calculate_sensitivity
sensitivity.sensitivity_morris.MorrisSensitivityAnalysis.calculate_sensitivity(
    cache_filename=None,
    cache=False,
)

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

create_samples
sensitivity.sensitivity_morris.MorrisSensitivityAnalysis.create_samples()

Create samples using the Method of Morris. Three variants of Morris’ sampling for elementary effects is supported:

  • Vanilla Morris (see [1]) when optimal_trajectories is None/False and local_optimization is False
  • Optimised trajectories when optimal_trajectories=True using Campolongo’s enhancements (see [2]) and optionally Ruano’s enhancement (see [3]) when local_optimization=True
  • Morris with groups when the problem definition specifies groups of parameters
plot
sensitivity.sensitivity_morris.MorrisSensitivityAnalysis.plot()

Morris plot.

[“mu”, “mu_star”, “sigma”, “mu_star_conf”]

Functions

Name Description
plot_morris_indices Barplots and scatterplots of Morris indices.

plot_morris_indices

sensitivity.sensitivity_morris.plot_morris_indices(sa, fig_path)

Barplots and scatterplots of Morris indices.