Histogram for continuous random values.

Namespace:  AForge.Math
Assembly:  AForge.Math (in AForge.Math.dll) Version: 2.2.5.0 (2.2.5.0)

Syntax

C#
[SerializableAttribute]
public class ContinuousHistogram

Remarks

The class wraps histogram for continuous stochastic function, which is represented by integer array and range of the function. Values of the integer array are treated as total amount of hits on the corresponding subranges, which are calculated by splitting the specified range into required amount of consequent ranges.

For example, if the integer array is equal to { 1, 2, 4, 8, 16 } and the range is set to [0, 1], then the histogram consists of next subranges:

  • [0.0, 0.2] - 1 hit;
  • [0.2, 0.4] - 2 hits;
  • [0.4, 0.6] - 4 hits;
  • [0.6, 0.8] - 8 hits;
  • [0.8, 1.0] - 16 hits.

Sample usage:

CopyC#
// create histogram
ContinuousHistogram histogram = new ContinuousHistogram(
    new int[] { 0, 0, 8, 4, 2, 4, 7, 1, 0 }, new Range( 0.0f, 1.0f ) );
// get mean and standard deviation values
Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );

Inheritance Hierarchy

System..::.Object
  AForge.Math..::.ContinuousHistogram

See Also