pycrostates.segmentation.entropy#
- pycrostates.segmentation.entropy(segmentation, ignore_repetitions=False, log_base=2)[source]#
Compute the Shannon entropy of a symbolic sequence.
Compute the Shannon entropy[1] of the microstate symbolic sequence.
- Parameters:
- segmentation
RawSegmentation|EpochsSegmentation Segmentation object containing the microstate symbolic sequence.
- ignore_repetitions
bool If
True, ignores state repetitions. For example, the input sequenceAAABBCCDwill be transformed intoABCDbefore any calculation. This is equivalent to setting the duration of all states to 1 sample.- log_base
float|str The log base to use. If string: *
bits: log_base =2*natural: log_base =np.e*dits: log_base =10Default tobits.
- segmentation
- Returns:
- h
float The Shannon entropy of the sequence.
- h
References