Click or drag to resize
Accord.NET (logo)

ContinuousHistogram Class

Histogram for continuous random values.
Inheritance Hierarchy
SystemObject
  Accord.MathContinuousHistogram

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.8.0
Syntax
[SerializableAttribute]
public class ContinuousHistogram
Request Example View Source

The ContinuousHistogram type exposes the following members.

Constructors
  NameDescription
Public methodContinuousHistogram
Initializes a new instance of the ContinuousHistogram class.
Top
Properties
  NameDescription
Public propertyMax
Maximum value.
Public propertyMean
Mean value.
Public propertyMedian
Median value.
Public propertyMin
Minimum value.
Public propertyRange
Range of random values.
Public propertyStdDev
Standard deviation.
Public propertyValues
Values of the histogram.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetRange
Get range around median containing specified percentage of values.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUpdate
Update statistical value of the histogram.
Top
Extension Methods
  NameDescription
Public Extension MethodHasMethod
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)
Public Extension MethodIsEqual
Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices.
(Defined by Matrix.)
Public Extension MethodTo(Type)Overloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Public Extension MethodToTOverloaded.
Converts an object into another type, irrespective of whether the conversion can be done at compile time or not. This can be used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)
Top
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:

// 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 );
See Also