(D: int, num_resamples: int, keep_resamples: bool, calc_second_order: bool)
return S
initialize empty dict to store sensitivity indices
initialize empty dict to store sensitivity indices
initialize empty dict to store sensitivity indices
def create_Si_dict(D: int, num_resamples: int, keep_resamples: bool, calc_second_order: bool):
    """initialize empty dict to store sensitivity indices"""
    S = ResultDict((k, np.zeros(D))
                   for k in ('S1', 'S1_conf', 'ST', 'ST_conf'))

    if keep_resamples:
        # Create entries to store intermediate resampling results
        S['S1_conf_all'] = np.zeros((num_resamples, D))
        S['ST_conf_all'] = np.zeros((num_resamples, D))

    if calc_second_order:
        S['S2'] = np.full((D, D), np.nan)
        S['S2_conf'] = np.full((D, D), np.nan)

    return S
def create_Si_dict ( D : int , num_resamples : int , keep_resamples : bool , calc_second_order : bool ) : S = ResultDict ( ( k , np . zeros ( D ) ) for k in ( 'S1' , 'S1_conf' , 'ST' , 'ST_conf' ) ) if keep_resamples : # Create entries to store intermediate resampling results S [ 'S1_conf_all' ] = np . zeros ( ( num_resamples , D ) ) S [ 'ST_conf_all' ] = np . zeros ( ( num_resamples , D ) ) if calc_second_order : S [ 'S2' ] = np . full ( ( D , D ) , np . nan ) S [ 'S2_conf' ] = np . full ( ( D , D ) , np . nan ) return S