Skewness (FPScript)

21.09.2021

Calculates the skewness for a data set.

Syntax

Skewness(DataSet, [ Mode = PROCESS_ROWS ] [ , IntervalWidth ])

 

The syntax of the Skewness function consists of the following parts:

Part

Description

DataSet

The data set to be evaluated.

All data structures are allowed. All numeric data types are permitted.

For complex data types the absolute value is formed.

If the argument is a list, then the function is executed for each element of the list and the result is also a list.

Mode

Specifies how data matrices and signal series are to be processed and whether to determine individual, moving or block skewness.

The argument Mode can have the following values:

Constant

Meaning

PROCESS_COLUMNS

Data matrices and signal series are processed column by column. The result is a data series or a signal with one skewness per column.

PROCESS_ROWS

Data matrices and signal series are processed row by row. The result is a data series or a signal with one skewness per row.

PROCESS_COMPLETE

Data matrices and signal series are processed as a whole. The result is a scalar value with one skewness for the entire data set.

...plus an optional constant, which determines the calculation method:

Constant

Meaning

+ CALC_BLOCK

Block-by-block calculation. One value is calculated per interval.

+ CALC_MOVING

Moving calculation. For every value in the data set, a result is determined in the specified interval.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

If this argument is omitted, it will be set to the default value PROCESS_ROWS.

IntervalWidth

This argument is required for determining moving and block skewness. The interval width then specifies the number of values to be examined. The width should be an odd number. Otherwise, the interval is asymmetrical, and one more value is included in the calculation to the right of the center as opposed to the left.

Permitted data structures are scalar value. All integral data types are permitted.

The value must be greater or equal to 1.

If the argument is a list, then the first element in the list is taken. If this is also a list, then the process is repeated.

Remarks

The result always has the data type 64-bit floating point.

The skew of a sample is defined as:

with the mean

For signals and signal series, the Y component is processed and the X or Z component is copied, if possible. When calculating moving skewness and block skewness, the data structure of the result is that of the argument. If, on the other hand, DataSet is a data series or a signal, the result is a scalar value with the skewness searched for; otherwise, the result is a data series or a signal with a skewness per column or row.

Available in

FlexPro Basic, Professional, Developer Suite

Examples

Skewness({1, 1, 3, 2, 4})

Results in 0.3631734744194333.

Skewness({{1, 1, 3, 2, 4}, {1, 3, 2, 4, 4}}, PROCESS_COLUMNS)

Results in { 0.3631734744194333, -0.3631734744194307 }. The function calculates the skewness from the matrix column by column.

Skewness({{1, 3, 5}, {2, 6, 10}, {1, 1, 3}, {3, 4, 4}}, PROCESS_ROWS)

Results in { 0.4933822002181587, 0, 0.9220734033619126 }. The function calculates the skewness from the matrix row by row.

Skewness({1, 2, 3, 2, 1}, CALC_MOVING, 3)

Results in { 0, 0, 0.7071067811866053, 0, 0 }. The function calculates the moving skewness for {1, 2}, {1, 2, 3}, {2, 3, 2}, {3, 2, 1} and {2, 1}.

Skewness({1, 2, 3, 4, 4.5, 4}, CALC_BLOCK, 3)

Results in { 0, 0.7071067811871479 }. The function calculates the skewness block by block for {1, 2, 3} and {4, 4.5, 4}.

See Also

Kurtosis Function

Statistical Quantity Analysis Object

Share article or send as email:

You might be interested in these articles