Module: statistics

Statistical estimators.

Includes nodes implementing standard statistical estimators and other statistical procedures.

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). 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, use the Mean node instead.

Version 1.0.1

Ports/Properties

  • 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)
  • 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: EnumPort
    • value type: object (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: object (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)

CDF

Evaluate the cumulative distribution function for a given distribution with some fixed parameters element-wise.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • distribution
    Type of distribution to use.

    • verbose name: Distribution
    • default value: Normal
    • port type: EnumPort
    • value type: object (can be None)
  • location
    Location parameter. The meaning depends on the type of distribution. For example, for the normal distribution this is the mean.

    • verbose name: Location
    • default value: 0.0
    • port type: FloatPort
    • value type: float (can be None)
  • scale
    Scale parameter. The meaning depends on the type of distribution. For example, for the normal distribution this is the standard deviation.

    • verbose name: Scale
    • default value: 1.0
    • port type: FloatPort
    • value type: float (can be None)
  • shape1
    First shape parameter. Only some distributions have shape parameters, and the meaning depends on the type of distribution.

    • verbose name: Shape1
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • shape2
    Second shape parameter. Only some distributions have shape parameters, and the meaning depends on the type of distribution.

    • verbose name: Shape2
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)

Centering

Produce zero-mean or 'centered' data by first calculating the mean of the data and then subtracting it.

Note that, if your data is segmented or otherwise comes in the form of multiple instances, you can decide whether the mean should be taken over the instances or over the time axis in each instance. You also can decide whether the mean should be updated on every chunk, or if it should only be updated on the calibration data (non-streaming chunks), and whether it should be recomputed on subsequent non-streaming chunks (e.g., subsequent test data).

Version 1.1.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which the statistic should be aggregated. For instance, if this is set to time, then the mean will be computed over time.

    • verbose name: Take Statistics Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • robust
    Use robust estimator (median). Enabling this will make the node more robust to outlier elements, but if the data is clean, then the statistic will be somewhat less precise than it it could be.

    • verbose name: Use Robust Estimator
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • adapt_on_streaming
    Adapt state parameters on streaming chunks. If this is False (the default), then this node will not adapt itself on streaming chunks, i.e., only on non-streaming chunks, such as imported calibration recordings. This is useful if the streaming chunks would be too short to meaningfully sadapt the parameters on and the calibration recording is sufficietly similar to the streaming data for it to be meaningful to adapt the state only on these data. Or if set to True, the node will simply adapt itself on every chunk it receives, whether it is streaming or not.

    • verbose name: Adapt On Streaming Chunks
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • initialize_once
    Initialize (adapt state parameters) only once. If False, this node will recalibrate itself on any qualifying chunk (based on the setting of adapt on streaming chunks).

    • verbose name: Adapt Only Once
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)

CorrelationCoefficient

Compute the correlation coefficient between elements along a given axis, and average over another axis.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • avg_axis
    Axis over which to compute correlation. After correlation, this axis will be removed from the data unless 'keep correlation axis' is checked..

    • verbose name: Axis Over Which The Correlation Is Computed
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • cov_axis
    Axis containing the independent variables between which correlation will be calculated. This axis will be duplicated in the data.

    • verbose name: Axis With Ivs To Correlate
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)
  • keep_avg_axis
    Keep the axis over which correlation is computed. If enabled, the axis will be retained as a 1-element axis. This axis will be of the same type as the original axis if it was a time or frequency axis, and a generic axis otherwise.

    • verbose name: Keep Correlation Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

CorrelationFromCovariance

This node converts a covariance matrix into a matrix of correlations, and optionally applies significant thresholding to the values.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • cov_axis
    Axis between whose elements the correlation coefficient is calculated. This axis will be duplicated in the data.

    • verbose name: Axis Over Which The Correlation Is Calculated
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)
  • num_dof
    Number of degrees of freedom. This is only needed if T-scores should be computed.

    • verbose name: Num Dof
    • default value: 100
    • port type: IntPort
    • value type: int (can be None)
  • fix_roundoff_errors
    Fix round-off errors. If enabled, some additional steps are performed that fix correlations that should be 1/-1 but are not. This can be disabled to increase performance.

    • verbose name: Fix Roundoff Errors
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • sig_test
    Perform significance test. If given, the data will be tested for statistical significance, and correlations below the threshold will be set to 0.

    • verbose name: Significance Test
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • alpha
    Significance threshold. If given, a significance test will be performed.

    • verbose name: Significance Threshold
    • default value: 0.05
    • port type: FloatPort
    • value type: float (can be None)

Covariance

Compute the covariance matrix between all elements of a given axis, and average over another axis.

The result will be a new data packet where the axis to average over is removed from the data, and the axis between whose elements the covariance was computed is duplicated. For instance, for a segmented multi-channel time series with time (samples), space (channels), and instance (segments) axes, after applying this node between space, and averaged over time, the result will be a new chunk with space, space, and instance axes.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • shrinkage
    Shrinkage regularization parameter. This parameter (between 0 and 1) controls the amount of shrinkage regularization applied to the covariance matrix estimates. This can be useful when channels are linearly dependent, and in that case a small amount (e.g., 0.001) is enugh to prevent degenerate solutions. Larger values may be used to implement regularization in the context of a pipeline.

    • verbose name: Shrinkage Regularization Parameter
    • default value: 0.0
    • port type: FloatPort
    • value type: float (can be None)
  • avg_axis
    Axis to average over. After the average has been taken, this axis will drop out of the data.

    • verbose name: Average Over Axis
    • default value: time
    • port type: EnumPort
    • value type: object (can be None)
  • cov_axis
    Axis between whose elements the covariance should be calculated. This axis will be duplicated in the data.

    • verbose name: Calculate Between Elements Of Axis
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)
  • assume_zeromean
    Assume that the data is already zero-mean. If so, the mean will not be subtracted by this node, which saves compute time. Data that has previously been high-pass filtered can often be treated as being zero-mean.

    • verbose name: Assume Zeromean
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • unbiased_estimate
    Use unbiased estimator. If enabled, this will normalize by N-1 instead of N (making it the best unbiased estimate). If disabled, it will be the second moment matrix. Note that the difference is usually negligible except when trying to match other covariance implementations (e.g., MATLAB) exactly.

    • verbose name: Unbiased Estimate
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

CurveLength

Compute the curve length of the data over a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis. In the special case that the curve length is taken over time, a dummy time axis will be retained, unless this behavior is overriden using the force feature axis parameter.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the curve length. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Calculate Curve Length Over
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • diff_order
    Number of times the values are differenced.

    • verbose name: Degrees Of Freedom To Subtract
    • default value: 1
    • port type: IntPort
    • value type: int (can be None)
  • force_feature_axis
    Always create a feature axis, even when the curve length is taken over time. If this is False, then a time axis will instead be created if the curve length is taken over time.

    • verbose name: Force Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

GroupedMean

Group instances then calculate the mean (and optionally error) for each group.

Grouping is performed according to the instance axis data table. Only fields marked as category will be used for grouping. For the remaining fields, the group average will be calculated. This node can be used, for example, to get an event-related potential (ERP) after appropriate segmenting and other processing.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

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

    • verbose name: Mean Type
    • default value: mean
    • port type: EnumPort
    • value type: object (can be None)
  • trim_proportion
    Proportion of data instances to trim (per variable) on the lower and upper tails of the data. If only a single number is provided then it is used for both lower and upper. If no non-zero numbers are provided then no trimming is performed (default).

    • verbose name: Trim Proportion
    • default value: [0, 0]
    • port type: ListPort
    • value type: list (can be None)
  • winsorize
    If trim_proportion has a non-zero value, then setting winsorize to True (default) will cause winsorization to be used instead of standard trimming.

    • verbose name: Winsorize
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • error_type
    Add 'grouped-mean' StatisticAxis to the chunk, containing param_types=[stats.P arameterType.ESTIMATE, stats.ParameterType.ERROR]. std: standard deviation; sem: standard error of the mean; var: variance; mad: median absolute difference; CI: upper confidence interval - mean. See ci_range parameter.

    • verbose name: Error Type
    • default value: none
    • port type: EnumPort
    • value type: object (can be None)
  • group_cols
    Optionally specify the names of instance data table fields that will be used to determine grouping. e.g. ['Marker'] or ['Subject', 'Marker']

    • verbose name: Group Cols
    • default value: None
    • port type: ListPort
    • value type: list (can be None)
  • fill_cols
    If True, instance columns that are not used for grouping will be filled with reasonable default values. If False, instance columns that are not used for grouping will be masked out in the output instance axis data.

    • verbose name: Fill Cols
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • grouping_type
    If levels (default), then means (and optionally errors) are calculated per unique level of each factor and interaction. If unpaired-diffs, then differences of means are calculated for each pair of levels. Use this option to calculate differences in means and difference error analogous to a two independent sample t-test assuming equal variances. When error_type is not none, a common variance is calculated instead of using the group-variances. If global, then only a single mean (and error) is calculated for all instances.

    • verbose name: Grouping Type
    • default value: levels
    • port type: EnumPort
    • value type: object (can be None)
  • equal_var
    If grouping_type is 'unpaired-diffs', set this to True to assume equal population variance among groups. If False (default), unequal population variance among groups is assumed.

    • verbose name: Equal Var
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • ddof
    Passed to numpy.s td. In standard statistical practice, ddof=1 provides an unbiased estimator of the variance of the infinite population. ddof=0 provides a maximum likelihood estimate of the variance for normally distributed variables.

    • verbose name: Ddof
    • default value: 1
    • port type: IntPort
    • value type: int (can be None)
  • ci_range
    Range for confidence interval if CI selected as error_type.

    • verbose name: Ci Range
    • default value: 0.95
    • port type: FloatPort
    • value type: float (can be None)
  • allow_markers
    If true, marker streams with an instance axis will be affected .

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

Largest

Find the largest value along a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis.

Version 1.0.0

Ports/Properties

  • 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)
  • 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 find the largest element. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature).

    • verbose name: Act Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)

Mean

Compute the mean (average) over a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis. In the special case that the mean is taken over time, frequency, or instances, a dummy time/frequency/instance axis will be retained, unless this behavior is overriden using the force feature axis parameter. It is also possible to compute a robust variant of the mean instead.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the average. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Average Over
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • robust
    Use robust estimator (median). Enabling this will make the node more robust to outlier elements, but if the data is clean, then the statistic will be somewhat less precise than it it could be.

    • verbose name: Use Robust Estimator
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • force_feature_axis
    Always create a feature axis, even when the mean is taken over time. If this is False, then a time axis will instead be created if the mean is taken over time.

    • verbose name: Force Creation Of Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (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)
  • robust_estimator_type
    Type of robust estimator to use.

    • verbose name: Robust Estimator Type
    • default value: median
    • port type: EnumPort
    • value type: object (can be None)
  • trim_proportion
    Proportion to trim for trim_mean estimator. Applied to both the smallest and largest values in the data.

    • verbose name: Trim Proportion
    • default value: 0.1
    • port type: FloatPort
    • value type: float (can be None)

MedianAbsoluteDeviation

A robust measure of the variability of some data.

This is a robust alternative to the standard deviation, which is unaffected by outliers up to a breakdown point where 50% of the data consists of outliers. The MAD is statistically less efficient than the standard deviation if the data has no outliers, that is, the value is a worse estimate. Also note that the scale of the MAD differs from that of the STD by a factor of about 1.4.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the measure. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Average Over
    • default value: instance
    • port type: EnumPort
    • value type: object (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)
  • force_feature_axis
    Always create a feature axis, even when the mean is taken over time. If this is False, then a time axis will instead be created if the mean is taken over time.

    • verbose name: Force Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

PDF

Evaluate the probability density function for a given distribution with some fixed parameters element-wise.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • distribution
    Type of distribution to use.

    • verbose name: Distribution
    • default value: Normal
    • port type: EnumPort
    • value type: object (can be None)
  • location
    Location parameter. The meaning depends on the type of distribution. For example, for the normal distribution this is the mean.

    • verbose name: Location
    • default value: 0.0
    • port type: FloatPort
    • value type: float (can be None)
  • scale
    Scale parameter. The meaning depends on the type of distribution. For example, for the normal distribution this is the standard deviation.

    • verbose name: Scale
    • default value: 1.0
    • port type: FloatPort
    • value type: float (can be None)
  • shape1
    First shape parameter. Only some distributions have shape parameters, and the meaning depends on the type of distribution.

    • verbose name: Shape1
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)
  • shape2
    Second shape parameter. Only some distributions have shape parameters, and the meaning depends on the type of distribution.

    • verbose name: Shape2
    • default value: None
    • port type: FloatPort
    • value type: float (can be None)

PerElementCovariance

Compute the per-element covariance matrix between elements of a given axis.

This node is best understood when contrasted to the average (sample) covariance matrix, which can be viewed as an average over n matrices, where each of the n matrices is the outer product of some data vector (one of n samples) and itself. This node will perform only the outer product calculation, but leaves it to the user to subsequently perform the averaging. The utility of this node lies in the ability to use other kinds of averages than the regular mean, such as, for instance, a running average (yielding a running average covariance matrix), or a robust average (yielding a robust estimate for the covariance matrix). Thus, this node is best used in combination with nodes such as MovingAverage, or ExponentialMovingAverage. When applied to a tensor, this node will replicate the axis of choice (so it occurs twice in the output data), and it will treat each vector along this axis separately and replace it by a matrix that is the outer product by the vector and itself.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • shrinkage
    Amount of shrinkage to apply to covariance estimate. This is a regularization parameter that can be used to ensure that the resulting covariance matrices (or their averages) are full-rank matrices (i.e., non-degenerate / non-singular).

    • verbose name: Shrinkage Regularization Parameter
    • default value: 0.0
    • port type: FloatPort
    • value type: float (can be None)
  • axis
    Axis between whose elements the covariance shall be computed. The resulting matrix will quantify to what extent elements along the given axis covary with other elements at other positions along the axis.

    • verbose name: Calculate Between Elements Of Axis
    • default value: space
    • port type: EnumPort
    • value type: object (can be None)

RootMeanSquare

Compute the root mean square over a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis. In the special case that the RMS is taken over time or instances, a dummy time/instance axis will be retained, unless this behavior is overriden using the force feature axis parameter. It is also possible to compute a robust variant of the mean instead.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the RMS. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Average Over
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • robust
    Use robust estimator (median). Enabling this will make the node more robust to outlier elements, but if the data is clean, then the statistic will be somewhat less precise than it it could be.

    • verbose name: Use Robust Estimator
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • force_feature_axis
    Always create a feature axis, even when the RMS is taken over time. If this is False, then a time axis will instead be created if the RMS is taken over time.

    • verbose name: Force Creation Of Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (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)

Smallest

Find the smallest value along a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis.

Version 1.0.0

Ports/Properties

  • 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)
  • 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 find the smallest element. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature).

    • verbose name: Act Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)

Standardization

Scale the data such that it is standardized.

Standardization will scale the data such that the standard deviation (or some other measure of choice) is 1.0. Note that this does not set the mean of the data to zero, though (that is handled by the Centering node, and should be done beforehand, unless the data is already zero, for instance after highpass filtering, or you do not want the mean to be zero). Note that, if your data is segmented or otherwise comes in the form of multiple instances, you can decide whether the statistics should be taken over the instances or over the time axis in each instance. You also can decide whether the statistics should be updated on every chunk, or if it should only be updated on the calibration data (non-streaming chunks), and whether they should be recomputed on subsequent non-streaming chunks ( e.g., subsequent test data). Note that there is also a moving-window standardization node available, though that one will by default also correct the mean.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which the statistic should be aggregated. For instance, if this is set to time, then the mean/standard deviation will be computed over time.

    • verbose name: Take Statistics Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • measure
    Measure to use for standardization. After standardizing, the measure will yield 1.0 on the standardized data. Mad is the median absolute deviation (a robust alterantive to the standard deviation).

    • verbose name: Standardize Using Measure
    • default value: std
    • port type: EnumPort
    • value type: object (can be None)

Sum

Compute the sum along a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis. In the special case that the mean is taken over time, a dummy time axis will be retained, unless this behavior is overriden using the force feature axis parameter.

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the sum. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Sum Over
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • axis_occurrence
    Index of the occurrence of the axis of desired type. (0 is the first axis of the desired type, 1 is the second, -1 is the last, -2 is the second-to-last, and so on).

    • verbose name: Axis Occurrence
    • default value: 0
    • port type: IntPort
    • value type: int (can be None)
  • force_feature_axis
    Always create a feature axis, even when the sum is taken over time. If this is False, then a time axis will instead be created if the sum is taken over time.

    • verbose name: Force Creation Of Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

TTest

Compute a t-test.

This node supports 1-sample and 2-sample unpaired and paired t-tests. The node requires that the data has an instance axis. In order to use 2-sample t-tests, the instance axis must have a field (e.g., 'Marker' or 'TargetValue') according to which the individual trials can be grouped. For paired t-tests, an additional field in the instance axis is required (e.g., 'Subject') that identifies trials that shall be paired. The node performs multiple mass-univariate t-tests when additional axes are present in the data. The sign of the 2-sample t-test will be the result of element1-element2, where element1 and element2 are the trials to be compared, specified in that order in the 'grouping' parameter (or previously with SelectInstances). In the output packet, the instance axis will be replaced by a feature axis (with the 'statistic-types' custom label), with fields for the t-stat and p-val values.

More Info...

Version 0.1

Ports/Properties

  • 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)
  • data
    A packet containing at least one signal chunk with an instance axis. For two-sample t-tests, the instances must be separated into two groups according to an instance axis data field. For paired t-tests, these two groups must be identical in size and have another instance axis data field to indicate sample pairing.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • comparison_value
    For 1-sample t-test, compare mean against this value.

    • verbose name: Comparison Value
    • default value: 0
    • port type: FloatPort
    • value type: float (can be None)
  • nan_policy
    Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.

    • verbose name: Nan Policy
    • default value: propagate
    • port type: EnumPort
    • value type: object (can be None)
  • grouping
    A dictionary that describes how the instance axis should be split up to separate instances into two groups for two-sample t-tests. The dict key indicates the instance axis field, and its value is a length-2 list of items to which the instance data are compared to determine grouping. The t-test will be performed on the two items in the order in which they are specified, for example, {'Marker': ['Post', 'Pre']}, will separate instances according to the Marker value, and the t-test will be result of post-pre. Alternatively, this can be left blank if you use SelectInstances to select the trials to test (again listing them in the order in which the operation is to be performed), followed by BakeDesignMatrix if grouping determined by a field other than TargetValue (if available) or Marker.

    • verbose name: Grouping
    • default value: None
    • port type: DictPort
    • value type: dict (can be None)
  • equal_var
    If True, perform a standard independent 2 sample test that assumes equal population variances. If False (default), perform Welch’s t-test, which does not assume equal population variance. This parameter is used only by 2 independent sample test.

    • verbose name: Equal Var
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • pairing_field
    The name of the field in the instance axis data that links pairs of instances that have been separated according to the grouping parameter. Providing this parameter indicates that a paired t-test is desired.

    • verbose name: Pairing Field
    • default value: None
    • port type: StringPort
    • value type: str (can be None)
  • trim_proportion
    Proportion of data instances to trim (per variable) on the lower and upper tails of the data. If only a single number is provided then it is used for both lower and upper. If no non-zero numbers are provided then no trimming is performed (default).

    • verbose name: Trim Proportion
    • default value: [0, 0]
    • port type: ListPort
    • value type: list (can be None)
  • winsorize
    If trim_proportion has a non-zero value, then setting winsorize to True (default) will cause winsorization to be used instead of standard trimming.

    • verbose name: Winsorize
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • use_caching
    Enable caching.

    • verbose name: Use Caching
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

TTestTwoInput

This node support 1-sample and 2-sample unpaired and paired t-tests.

The node requires that the data have an instance axis. For a one-sample t-test, the data in in the second input serves as the null-hypothesis value to compare against and must have either no instance axis, or only a since instance in its instance axis. For a two-sample unpaired t-test, the data in both inputs must have the same shape, except that they can have different numbers of instances. For a paired test, the packets must also have the same number of instances. Pairing assumes that the trials in both packets are ordered the same way. In the output packet, the instance axis will be replaced by a feature axis (with label 'statistic-types'), which has fields for the t-value and the p-value.

More Info...

Version 0.1

Ports/Properties

  • 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)
  • data
    A packet containing at least one signal chunk with an instance axis.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • data2
    A packet containing signal chunks with names matching those in data. If matching chunks have an instance axis of length > 1 then a two-sample t-test is performed. If matching chunks do not have an instance axis or an instance axis of length==1, then a one sample t-test is performed and the values in data2 are used as a comparison value. Other than the instance axis, data2 will be repeated along axes with length==1 to match the shape of data.

    • verbose name: Data2
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: IN
  • perform_paired_test
    If True then a paired t-test comparing data and data2 is performed. If False (default), then an independent samples t-test is performed. Paired t-test requires that the length of data2 instance axis is the same as in data.

    • verbose name: Perform Paired Test
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • nan_policy
    Defines how to handle when input contains nan. ‘propagate’ returns nan, ‘raise’ throws an error, ‘omit’ performs the calculations ignoring nan values. Default is ‘propagate’.

    • verbose name: Nan Policy
    • default value: propagate
    • port type: EnumPort
    • value type: object (can be None)
  • equal_var
    If True, perform a standard independent 2 sample test that assumes equal population variances. If False (default), perform Welch’s t-test, which does not assume equal population variance. This parameter is used only by 2 independent sample test.

    • verbose name: Equal Var
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • use_caching
    Enable caching.

    • verbose name: Use Caching
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

Variance

Compute the variance of the data over a given axis.

The chosen axis will be removed from the data and replaced by a new one-element feature axis. In the special case that the variance is taken over time, a dummy time axis will be retained, unless this behavior is overriden using the force feature axis parameter. It is also possible to compute a robust variant of the mean instead. Note that, if you apply this over time on unsegmented streaming data, you are almost certainly doing it wrong, because streaming chunks can be very short, yielding erratic variance values -- more reasonable uses of the variance are on segmented data, or over other axes. If you need a moving-window estimate of variance, and your signal is zero-mean (e.g., highpass filtered), you can also just use a Squaring node followed by a Moving Average node).

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which to calculate the variance. This axis will drop out of the data and be replaced by a dummy one-element axis (of type feature or time, depending on settings).

    • verbose name: Axis To Average Over
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • degrees_of_freedom
    Number of degrees of freedom to subtract. If set to 1, the 'unbiased sample variance' is computed (otherwise the biased sample variance is computed). Other values can be used for special use cases.

    • verbose name: Degrees Of Freedom To Subtract
    • default value: 0
    • port type: IntPort
    • value type: int (can be None)
  • force_feature_axis
    Always create a feature axis, even when the mean is taken over time. If this is False, then a time axis will instead be created if the mean is taken over time.

    • verbose name: Force Feature Axis
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)

Winsorize

Winsorize the given data.

This node will process the data along a given axis (usually the instance axis), and apply winsorization. In short, it will clip the data at a level that corresponds to a lower and upper percentile (e.g., 10th and 90th) of the data. This is a technique in robust data analysis that allows for subsequent statistics to be resilient to a certain fraction of outliers.

More Info...

Version 0.8.0

Ports/Properties

  • 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)
  • 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 winsorize the data.

    • verbose name: Take Statistics Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • trim_proportion_lower
    Proportion to trim on the lower end of the data.

    • verbose name: Lower Proportion
    • default value: 0.1
    • port type: FloatPort
    • value type: float (can be None)
  • trim_proportion
    Proportion to trim on the upper end of the data.

    • verbose name: Upper Proportion
    • default value: 0.1
    • port type: FloatPort
    • value type: float (can be None)

ZScoring

Produce z-scored data, that is, data with a mean of zero and a variance of one.

Note that, if your data is segmented or otherwise comes in the form of multiple instances, you can decide whether the statistics should be taken over the instances or over the time axis in each instance. You also can decide whether the statistics should be updated on every chunk, or if it should only be updated on the calibration data (non-streaming chunks), and whether they should be recomputed on subsequent non-streaming chunks (e.g., subsequent test data). Note that there is also a moving-window standardization node available.

More Info...

Version 1.0.0

Ports/Properties

  • 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)
  • data
    Data to process.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • axis
    Axis over which the statistic should be aggregated. For instance, if this is set to time, then the mean/standard deviation will be computed over time.

    • verbose name: Take Statistics Along Axis
    • default value: instance
    • port type: EnumPort
    • value type: object (can be None)
  • robust
    Use robust estimators (median and median absolute deviation). Enabling this will make the node more robust to outlier elements, but if the data is clean, then the statistic will be somewhat less precise than it it could be.

    • verbose name: Use Robust Estimator
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • adapt_on_streaming
    Adapt state parameters on streaming chunks. If this is False (the default), then this node will not adapt itself on streaming chunks, i.e., only on non-streaming chunks, such as imported calibration recordings. This is useful if the streaming chunks would be too short to meaningfully adapt the parameters on and the calibration recording is sufficietly similar to the streaming data for it to be meaningful to adapt the state only on these data. Or if set to True, the node will simply adapt itself on every chunk it receives, whether it is streaming or not.

    • verbose name: Adapt On Streaming Chunks
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • initialize_once
    Initialize (adapt state parameters) only once. If False, this node will recalibrate itself on any qualifying chunk (based on the setting of adapt on streaming chunks).

    • verbose name: Adapt Only Once
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • ignore_nans
    If activated the data containing nan values are ignored.

    • verbose name: Ignore Channels With Nan Values
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)
  • epsilon
    Optional epsilon value to prevent div by 0.

    • verbose name: Epsilon
    • default value: 0
    • port type: FloatPort
    • value type: float (can be None)

ZTest

Calculate a z-test.

This node support 1-sample and 2-sample unpaired and paired z-tests. The node requires that the data has an instance axis. In order to use 2-sample z-tests, the instance axis must have a field (e.g., 'Marker' or 'TargetValue') according to which the individual trials can be grouped. The node performs multiple mass-univariate z-tests when additional axes are present in the data. In the output packet, the instance axis will be replaced by a feature axis (with label 'statistic-types'), which has fields for the z-value and the p-value.

Version 0.1

Ports/Properties

  • 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)
  • data
    A packet containing at least one signal chunk with an instance axis. For two-sample z-tests, the instances must be separated into two groups according to an instance axis data field. For paired z-tests, these two groups must be identical in size and have another instance axis data field to indicate sample pairing.

    • verbose name: Data
    • default value: None
    • port type: DataPort
    • value type: Packet (can be None)
    • data direction: INOUT
  • comparison_value
    In the one sample case, value is the mean under the Null hypothesis. In the two sample case, value is the difference between means under the Null hypothesis. The test statistic is x1_mean - x2_mean - value.

    • verbose name: Comparison Value
    • default value: 0
    • port type: FloatPort
    • value type: float (can be None)
  • trim_proportion
    Proportion of data instances to trim (per variable) on the lower and upper tails of the data. If only a single number is provided then it is used for both lower and upper. If no non-zero numbers are provided then no trimming is performed (default).

    • verbose name: Trim Proportion
    • default value: [0, 0]
    • port type: ListPort
    • value type: list (can be None)
  • winsorize
    If trim_proportion has a non-zero value, then setting winsorize to True (default) will cause winsorization to be used instead of standard trimming.

    • verbose name: Winsorize
    • default value: True
    • port type: BoolPort
    • value type: bool (can be None)
  • use_caching
    Enable caching.

    • verbose name: Use Caching
    • default value: False
    • port type: BoolPort
    • value type: bool (can be None)