Skip to content

← statistics package

Averages

Compute multiple averages in multiple sub-ranges along an axis of interest.

This node is usually used to reduce the dimensionality of some data by averaging neighboring values in some ranges of interest. The most common use cases are a) calculating averages in multiple short time slices on segmented data (i.e., after the Segmentation filter has been run) to extract event-related potential (ERP) features, and b) calculating averages in multiple frequency bands in the spectrum of some signal to extract frequency features. One can also use this node to average the signal in multiple channels, although this is a less common use case, and there are more suitable nodes for this (e.g., the Combine Channels node). The node can also be used to calculate other kind of aggregate statistics, such as the standard deviation, variance, or maximum. After processing, the previous axis is replaced by a new axis that has as many elements as there were averages to be computed along the old axis. To average over an entire segment of data, such as to average over trials after using the Segmentation node, use the Mean or GroupedMean nodes instead. Version 1.2.1

Ports/Properties

data

Data to process.

  • verbose name: Data
  • default value: None
  • port type: DataPort
  • value type: Packet (can be None)
  • data direction: INOUT

axis

Axis along which to average. For instance, use time to compute time averages, frequency to compute spectral averages, or space to compute averages over multiple channels.

  • verbose name: Axis To Average Over
  • default value: time
  • port type: ComboPort
  • value type: str (can be None)

windows

List of window edges. Each window is given as a pair of values in round brackets that has the start and end of the segment, and it must be formatted as in: [(0.1,0.2), (0.3,0.4), (0.5,1.0)] (spaces inserted for readability and can be omitted). Note that in most cases it is useful to not use indices, but instead values in some other unit of measurement as segment limits, e.g., seconds or Hz. See Unit for more information. It is also important to note that the segment ends one element before the end value (that is, the range is "half-open"). If applied to segmented data, these values are relative to the anchor point for each segment (such as an event marker).

  • verbose name: List Of Values To Average Over
  • default value: []
  • port type: ListPort
  • value type: list (can be None)

unit

Unit in which the window edges are given. Depending on the type of axis, different units are applicable. For instance, if you want to extract time ranges from a time axis and give the values in seconds, you can set the unit to 'seconds'. Likewise, you can use Hz for the frequency axis.

  • verbose name: Unit Of Measurement
  • default value: indices
  • port type: EnumPort
  • value type: str (can be None)

ignore_nans

If activated the channels containing nan values are ignored.

  • verbose name: Ignore Channels With Nan Values
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

operation

Operation to perform on the data. The default is to compute the mean.

  • verbose name: Operation To Perform
  • default value: mean
  • port type: EnumPort
  • value type: str (can be None)

annotate_ranges

Annotate new axis with information about ranges being averaged over. This may create an additional field in the axis.

  • verbose name: Annotate Ranges
  • default value: True
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)