nigsp.operations.metrics.gsdi

nigsp.operations.metrics.gsdi(ts_split, mean=False, keys=None)[source]

Compute the generalised SDI.

Parameters:
ts_splitdict or numpy.ndarray

A dictionary containing two entries. If the two entries are “low” and “high”, then SDI will be computed as the norm of the high vs the norm of the low, otherwise as the ratio between the second (second key in sorted keys) and the first.

meanbool, optional

If True, compute mean over the last axis (e.g. between subjects)

keysNone or list of str, optional

Can be used to select two entries from a bigger dictionary and/or to specify the order in which the keys should be read (e.g. forcing a different order from the sorted keys).

Returns:
dict of numpy.ndarray

Returns a dictionary of computed gSDI.

Raises:
ValueError

If keys are provided but not contained in the dictionary.