Moving Statistics block
This block calculates a time-weighted moving statistics of the input fields.
Moving Statistics block
Description
The output of the block is respectively, the quality, average, variance, standard deviation, max, min, skew and kurtosis of each input variable, calculated over a moving window. The window moves forward as time progresses with the one end anchored to current execution time.
Moving statistics block
Block Type
Statistical block (Moving window)
Input/Output ports
The input port may only contain fields of type double. There are 7 output fields and 3 quality fields for every input field.
The 7 output fields have the following postfixes appended to the configured output field name (by default the configured output field has the same name as the input field name):
-
_AVG
-
_VAR
-
_STD
-
_MAX
-
_MIN
-
_SKEW
-
_KURT
The 3 quality fields have the following postfixes appended to the configured output field name (by default the configured output field has the same name as the input field):
-
_DurationBad
-
_DurationGood
-
_Windowspan
If a new field is added to the input port the 7 output fields will be created in their respective output ports. The output fields will have the default window span and quality threshold. The default window span and quality threshold is either the last configured window span and quality threshold or, if no new value was specified, it takes on the default block window span and quality threshold values.
In order for this block to run, the input port must be connected to a valid source that contains only double fields. All configured window spans must also be larger than 0 seconds.
There is also a parameter port of type double. During configuration, the parameter ports' fields can be used to substitute the fixed window span and quality thresholds values. During execution, the first value of the parameter field (that was used to substitute fixed values) is then used as the value for the window span and quality threshold
Example:
Input field name = Asset
“Average” port’s field name: Asset_AVG
“Variance” port’s field name: Asset_VAR
“Standard Deviation” port’s field name: Asset_STD
“Maximum” port’s field name: Asset_Max
“Minimum” port’s field name: Asset_Min
“Skew” port’s field name: Asset_SKEW
“Kurtosis” port’s field name: Asset_KURT
“Quality” port’s field names:
-
Asset_DurationBad
-
Asset_DurationGood
-
Asset_Windowspan
Parameter port
The parameter port does not have to be used. The block reads its parameters from the parameter port, if it's configured to do so.
On the first execute, the block will read the value(s) from the parameter field(s) and lock on that value. The parameter value will not change during execution.
Why are parameter ports great?
If you have 10 Moving window blocks and you want to change the configured quality threshold and window span, you only have to change it in one place.
Functions performed on tags
-
On the values:
-
-
“Average” port’s fields – The output value is the calculated moving average of the signal over the window.
-
”Variance” port’s fields – The output value is the moving variance of the signal over the window set in the configuration.
-
”Standard Deviation” port’s fields – The output value is the moving standard deviation of the signal over the window set in the configuration.
-
“Maximum” port’s fields – The largest value in the input variable time window.
-
”Minimum” port’s fields – The smallest value in the input variable time window.
-
Skew” port’s fields – The output value indicates the input signals skewness over the moving window set in the configuration.
-
”Kurtosis” port’s fields – The output value indicates the input signals kurtosis over the moving window set in the configuration.
-
-
On the timestamp - The output time stamp is always set to the execute time.
-
On the quality - The quality is set based on the quality threshold. The quality level is calculated as the number of seconds that the signal had good quality over the window. This quality level is expressed as a percentage of the window span. If the quality level is less that the quality threshold, the output quality is set to bad, otherwise it is good.
Example
-
Sample period = 60s
-
Window span = 300s
-
Quality threshold = 80%
Example of processing by Moving Statistics block
Related topics: