Click or drag to resize
Accord.NET (logo)

ContinuousHistogramGetRange Method

Get range around median containing specified percentage of values.

Namespace:  Accord.Math
Assembly:  Accord.Math (in Accord.Math.dll) Version: 3.7.0
Syntax
public Range GetRange(
	float percent
)
Request Example View Source

Parameters

percent
Type: SystemSingle
Values percentage around median.

Return Value

Type: Range
Returns the range which containes specifies percentage of values.
Remarks

The method calculates range of stochastic variable, which summary probability comprises the specified percentage of histogram's 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 50% range
Range range = histogram.GetRange( 0.5f );
// show the range ([0.25, 0.75])
Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
See Also