Engee documentation

Variance

The variance or consistency of the input data.

variance

Description

The Variance block computes the unbiased variance of each row or column of the input, or along vectors of a given dimension of the input. It can also calculate the variance of the entire input. You can specify a dimension using the Direction Mode parameter.

Ports

Input

In - data input
vector | matrix

The block accepts multichannel and multidimensional complex or real input data.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Output

Port_1 - dispersion on the given dimensionality
scalar | vector | matrix

When you do not select the Running variance parameter, the block calculates the variance in each row (column) of the input or along vectors of the given dimensionality of the input. It can also calculate the variance of the entire input at each individual calculation step. Each element in the output array y represents the variance of the corresponding column, row, or entire input. The output array y depends on the setting of the Direction Mode parameter.

Consider a three-dimensional input signal of size M by N by P. When you set the Direction Mode parameter to:

  • Entire input - the output in each calculation step is a scalar that contains the variance of the input matrix M by N by P.

  • Each row - the output in each calculation step consists of an array M by N by P, where each element contains the variance of each vector along the second dimension of the input. For the M by N matrix input, the output in each calculation step represents the column vector M by 1.

  • Each column - the output in each calculation step consists of an array M by N by P, where each element contains the variance of each vector along the first dimension of the input. For M - matrix input N the output in each calculation step is a vector-row 1 by N.

    In this mode, the block treats the input undirected vector of length M as M by 1 column vectors.

  • Specified dimension - The output in each calculation step depends on the value of the Dimension parameter. If you set Dimension to 1, the output is the same as if you had selected Each column. If you set Dimension to 2, the result is the same as if you had chosen Each row. If you set Dimension to 3, the output in each calculation step will be a M by N matrix containing the variance of each vector along the third dimension of the input.

The output data type corresponds to the input data type.

Data types: Float64.

Parameters

Direction Mode - the dimension on which the deviation is calculated
Each column (by default) | Entire input | Each row | Specified dimension
  • Each column - The block outputs the deviation for each column.

  • Each row - The block outputs the deviation for each row.

  • Entire input - The block outputs the deviation for the whole input.

  • Specified dimension - The block outputs the deviation for the dimension specified in the Dimension parameter.

Dimension - dimension
1 (by default) | scalar

Specify the dimension (counting from one) of the input signal for which the deviation is calculated. The value of this parameter must be greater than 0 and less than or equal to the number of dimensions in the input signal.

Dependencies

To use this parameter, set the Direction Mode parameter to Specified dimension.