(problem, Y)
return ie_names, IE
Computes the second order effects

    Computes the second order effects (interactions) between
    all combinations of pairs of input factors

    Parameters
    ----------
    problem: dict
        The problem definition
    Y: numpy.array
        The NumPy array containing the model outputs

    Returns
    -------
    ie_names: list
        The names of the interaction pairs
    IE: list
        The sensitivity indices for the pairwise interactions
Computes the second order effects
Computes the second order effects
def interactions(problem, Y):
    """Computes the second order effects

    Computes the second order effects (interactions) between
    all combinations of pairs of input factors

    Parameters
    ----------
    problem: dict
        The problem definition
    Y: numpy.array
        The NumPy array containing the model outputs

    Returns
    -------
    ie_names: list
        The names of the interaction pairs
    IE: list
        The sensitivity indices for the pairwise interactions
    """
    names = problem['names']
    num_vars = problem['num_vars']

    X = generate_contrast(problem)

    ie_names = []
    IE = []

    for col in range(X.shape[1]):
        for col_2 in range(col):
            x = X[:, col] * X[:, col_2]
            var_names = (names[col_2], names[col])
            ie_names.append(var_names)
            IE.append((1. / (2 * num_vars)) * np.dot(Y, x))

    return ie_names, IE
def interactions ( problem , Y ) : names = problem [ 'names' ] num_vars = problem [ 'num_vars' ] X = generate_contrast ( problem ) ie_names = [ ] IE = [ ] for col in range ( X . shape [ 1 ] ) : for col_2 in range ( col ) : x = X [ : , col ] * X [ : , col_2 ] var_names = ( names [ col_2 ] , names [ col ] ) ie_names . append ( var_names ) IE . append ( ( 1. / ( 2 * num_vars ) ) * np . dot ( Y , x ) ) return ie_names , IE