(problem: Dict, X: np.ndarray, Y: np.ndarray,
            num_resamples: int = 100, conf_level: float = 0.95,
            print_to_console: bool = False, num_levels: int = 4,
            seed=None)
return Si
Perform Morris Analysis on model outputs.

    Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
    'mu_star_conf', where each entry is a list of parameters containing
    the indices in the same order as the parameter file.


    Notes
    -----
    Compatible with:
        `morris` : :func:`SALib.sample.morris.sample`


    Parameters
    ----------
    problem : dict
        The problem definition
    X : numpy.array
        The NumPy matrix containing the model inputs of dtype=float
    Y : numpy.array
        The NumPy array containing the model outputs of dtype=float
    num_resamples : int
        The number of resamples used to compute the confidence
        intervals (default 1000)
    conf_level : float
        The confidence interval level (default 0.95)
    print_to_console : bool
        Print results directly to console (default False)
    num_levels : int
        The number of grid levels, must be identical to the value
        passed to SALib.sample.morris (default 4)
    seed : int
        Seed to generate a random number


    Returns
    -------
    Si : dict
        A dictionary of sensitivity indices containing the following entries.

        - `mu` - the mean elementary effect
        - `mu_star` - the absolute of the mean elementary effect
        - `sigma` - the standard deviation of the elementary effect
        - `mu_star_conf` - the bootstrapped confidence interval
        - `names` - the names of the parameters


    References
    ----------
    .. [1] Morris, M. (1991).  "Factorial Sampling Plans for Preliminary
           Computational Experiments."  Technometrics, 33(2):161-174,
           doi:10.1080/00401706.1991.10484804.

    .. [2] Campolongo, F., J. Cariboni, and A. Saltelli (2007).  "An effective
           screening design for sensitivity analysis of large models."
           Environmental Modelling & Software, 22(10):1509-1518,
           doi:10.1016/j.envsoft.2006.10.004.


    Examples
    --------
        >>> X = morris.sample(problem, 1000, num_levels=4)
        >>> Y = Ishigami.evaluate(X)
        >>> Si = morris.analyze(problem, X, Y, conf_level=0.95,
        >>>                     print_to_console=True, num_levels=4)
Perform Morris Analysis on model outputs.
Perform Morris Analysis on model outputs .
def analyze(problem: Dict, X: np.ndarray, Y: np.ndarray,
            num_resamples: int = 100, conf_level: float = 0.95,
            print_to_console: bool = False, num_levels: int = 4,
            seed=None) -> np.ndarray:
    """Perform Morris Analysis on model outputs.

    Returns a dictionary with keys 'mu', 'mu_star', 'sigma', and
    'mu_star_conf', where each entry is a list of parameters containing
    the indices in the same order as the parameter file.


    Notes
    -----
    Compatible with:
        `morris` : :func:`SALib.sample.morris.sample`


    Parameters
    ----------
    problem : dict
        The problem definition
    X : numpy.array
        The NumPy matrix containing the model inputs of dtype=float
    Y : numpy.array
        The NumPy array containing the model outputs of dtype=float
    num_resamples : int
        The number of resamples used to compute the confidence
        intervals (default 1000)
    conf_level : float
        The confidence interval level (default 0.95)
    print_to_console : bool
        Print results directly to console (default False)
    num_levels : int
        The number of grid levels, must be identical to the value
        passed to SALib.sample.morris (default 4)
    seed : int
        Seed to generate a random number


    Returns
    -------
    Si : dict
        A dictionary of sensitivity indices containing the following entries.

        - `mu` - the mean elementary effect
        - `mu_star` - the absolute of the mean elementary effect
        - `sigma` - the standard deviation of the elementary effect
        - `mu_star_conf` - the bootstrapped confidence interval
        - `names` - the names of the parameters


    References
    ----------
    .. [1] Morris, M. (1991).  "Factorial Sampling Plans for Preliminary
           Computational Experiments."  Technometrics, 33(2):161-174,
           doi:10.1080/00401706.1991.10484804.

    .. [2] Campolongo, F., J. Cariboni, and A. Saltelli (2007).  "An effective
           screening design for sensitivity analysis of large models."
           Environmental Modelling & Software, 22(10):1509-1518,
           doi:10.1016/j.envsoft.2006.10.004.


    Examples
    --------
        >>> X = morris.sample(problem, 1000, num_levels=4)
        >>> Y = Ishigami.evaluate(X)
        >>> Si = morris.analyze(problem, X, Y, conf_level=0.95,
        >>>                     print_to_console=True, num_levels=4)
    """
    if seed:
        np.random.seed(seed)

    _define_problem_with_groups(problem)

    _check_if_array_of_floats(X)
    _check_if_array_of_floats(Y)

    delta = _compute_delta(num_levels)

    num_vars = problem['num_vars']
    groups = _check_groups(problem)
    if not groups:
        number_of_groups = num_vars
    else:
        groups, unique_group_names = compute_groups_matrix(groups)
        number_of_groups = len(set(unique_group_names))
    # End if

    num_trajectories = int(Y.size / (number_of_groups + 1))
    trajectory_size = int(Y.size / num_trajectories)

    elementary_effects = _compute_elementary_effects(X, Y,
                                                     trajectory_size, delta)

    Si = _compute_statistical_outputs(elementary_effects, num_vars,
                                      num_resamples, conf_level, groups,
                                      unique_group_names)

    if print_to_console:
        print(Si.to_df())

    return Si
def analyze ( problem : Dict , X : np . ndarray , Y : np . ndarray , num_resamples : int = 100 , conf_level : float = 0.95 , print_to_console : bool = False , num_levels : int = 4 , seed = None ) -> np . ndarray : if seed : np . random . seed ( seed ) _define_problem_with_groups ( problem ) _check_if_array_of_floats ( X ) _check_if_array_of_floats ( Y ) delta = _compute_delta ( num_levels ) num_vars = problem [ 'num_vars' ] groups = _check_groups ( problem ) if not groups : number_of_groups = num_vars else : groups , unique_group_names = compute_groups_matrix ( groups ) number_of_groups = len ( set ( unique_group_names ) ) # End if num_trajectories = int ( Y . size / ( number_of_groups + 1 ) ) trajectory_size = int ( Y . size / num_trajectories ) elementary_effects = _compute_elementary_effects ( X , Y , trajectory_size , delta ) Si = _compute_statistical_outputs ( elementary_effects , num_vars , num_resamples , conf_level , groups , unique_group_names ) if print_to_console : print ( Si . to_df ( ) ) return Si