Click or drag to resize
Accord.NET (logo)

HistogramGetRange Method

Get range around median containing specified percentage of values.

Namespace:  Accord.Statistics.Visualizations
Assembly:  Accord.Statistics (in Accord.Statistics.dll) Version: 3.8.0
Syntax
public IntRange GetRange(
	double percent
)
Request Example View Source

Parameters

percent
Type: SystemDouble
Values percentage around median.

Return Value

Type: IntRange
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
Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } );
// get 50% range
IntRange range = histogram.GetRange( 0.5 );
// show the range ([4, 6])
Console.WriteLine( "50% range = [" + range.Min + ", " + range.Max + "]" );
See Also