C# 클래스 AForge.Math.Histogram

Histogram for discrete random values.

The class wraps histogram for discrete stochastic function, which is represented by integer array, where indexes of the array are treated as values of the stochastic function, but array values are treated as "probabilities" (total amount of hits).

Sample usage:

// create histogram Histogram histogram = new Histogram( new int[10] { 0, 0, 1, 3, 6, 8, 11, 0, 0, 0 } ); // get mean and standard deviation values Console.WriteLine( "mean = " + histogram.Mean + ", std.dev = " + histogram.StdDev );
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

공개 메소드들

메소드 설명
GetRange ( double percent ) : IntRange

Get range around median containing specified percentage of values.

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 + "]" );
Histogram ( int values ) : System

Initializes a new instance of the Histogram class.

Indexes of the input array are treated as values of stochastic function, but array values are treated as "probabilities" (total amount of hits).

Update ( ) : void

Update statistical value of the histogram.

The method recalculates statistical values of the histogram, like mean, standard deviation, etc., in the case if histogram's values were changed directly. The method should be called only in the case if histogram's values were retrieved through Values property and updated after that.

메소드 상세

GetRange() 공개 메소드

Get range around median containing specified percentage of values.

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 + "]" );
public GetRange ( double percent ) : IntRange
percent double Values percentage around median.
리턴 IntRange

Histogram() 공개 메소드

Initializes a new instance of the Histogram class.

Indexes of the input array are treated as values of stochastic function, but array values are treated as "probabilities" (total amount of hits).

public Histogram ( int values ) : System
values int Values of the histogram.
리턴 System

Update() 공개 메소드

Update statistical value of the histogram.
The method recalculates statistical values of the histogram, like mean, standard deviation, etc., in the case if histogram's values were changed directly. The method should be called only in the case if histogram's values were retrieved through Values property and updated after that.
public Update ( ) : void
리턴 void