Discrete Statistics

apama.analyticsbuilder.blocks.DiscreteStatistics

Generates statistics of sum, count, average (mean), standard deviation, minimum and maximum for discrete input values.

This block is suitable for discrete time inputs, where the number of samples (or inputs) is significant, while the time between them is not. The Average (Mean) and Standard Deviation blocks are more suitable for continuous values that may be irregularly sampled, such as temperature readings. Use this block, for example, if each sample represents a transaction such as a ticket being sold.

If the Sample input port is not connected, every value is sampled. If a new value is received during the same activation period as a reset, the value is sampled after the reset, otherwise it is ignored. As every value is used, the standard deviation uses the generic formula: σ² = ∑(x - µ)² / N.

If the Sample input port is connected, the block only samples the data when the Sample input port receives a signal. In this case, the sampling standard deviation uses the formula: σ² = ∑(x - µ)² / (N-1).

If reset and sample signals are received together, the reset is processed first.

Input Port Details

Name | Description | Type |

Value | The current value. | float |

Sample | Use the current value in generating statistics. If left unconnected, all values are used. | pulse |

Reset | Reset the state of the block. | pulse |

Output Port Details

Name | Description | Type |

Sum | Sum of the sampled input values, ∑x. | float |

Count | Count of the number of sampled input values, N. | float |

Average | Average (mean) of the sampled input values, µ = ∑x / N. | float |

Standard Deviation | Standard deviation of the sampled input values. If all values are being sampled, with the Sample input port disconnected, the generic standard deviation, σ² = ∑(x - µ)² / N, is used. Otherwise the sampling standard deviation, σ² = ∑(x - µ)² / (N-1), is used. | float |

Minimum | Minimum of the sampled input values. | float |

Maximum | Maximum of the sampled input values. | float |