Overload List
| # | Signature | Description |
|---|---|---|
| 1 | procedure CumulativeHist(const Data: TVec; const Bins: TVec; const results: TVec); | Cumulative histogram. |
| 2 | procedure CumulativeHist(const Data: TVec; const NumBins: Integer; const results: TVec; const Bins: TVec; CenterBins: Boolean); | Divide the Data vector elements into NumBins equal intervals. |
Overload 1: procedure CumulativeHist(const Data: TVec; const Bins: TVec; const results: TVec);
Cumulative histogram.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TVec | |
| 2 | Bins | TVec | |
| 3 | results | TVec |
Result: stored in self (calling object)
Divide the Data vector elements into intervals, specified by the Bins vector. The Bins elements define the center points for the individual intervals. The Bins elements must be sorted in ascending order. The number of elements falling in each interval is counted and the relative cumulative frequency for each interval is written to the Results vector. The Length and Complex properties of the Results vector are adjusted automatically.
Note
Use this version if you need non-equidistant histogram.
Uses MtxExpr, Statistics;
procedure Example;
var Data, Bins,CumRelFreq: Vector;
begin
Data.SetIt(false,[1,2,3,4,5,6,7,8,9,10]);
Bins.Size(4); // define 4 intervals - centerpoints
// define centerpoints, note that values are sorted!
Bins.SetIt([1.5, 2, 6, 9]);
CumulativeHist(Data,Bins, CumRelFreq);
// Freq holds the relative cumulative count of
// elements in each bin.
end;
Overload 2: procedure CumulativeHist(const Data: TVec; const NumBins: Integer; const results: TVec; const Bins: TVec; CenterBins: Boolean);
Divide the Data vector elements into NumBins equal intervals.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TVec | |
| 2 | NumBins | Integer | |
| 3 | results | TVec | |
| 4 | Bins | TVec | |
| 5 | CenterBins | Boolean |
Result: stored in self (calling object)
The number of elements falling in each interval is counted and the relative cumulative frequency for each interval is written to the Results vector. if CenterBins is true then Bins will store bins center points. If CenterBins is false, Bins will store bins edges. The Length and Complex properties of the Results and Bins vectors are adjusted automatically.
Note
Use this version if you need equidistant cumulative histogram.
Uses MtxExpr, Statistics, StatRandom;
procedure Example;
var Data, Bins, CumRelFreq: Vector;
begin
Data.Size(1000);
RandomNormal(-3,0.2,Data); // generate some normally distributed data
// Now, divide the data into 15 equal intervals
CumulativeHist(Data,15,CumRelFreq,Bins);
// Bins holds the 15 intervals centerpoints
// and CumRelFreq holds the relative cumulative count of
// elements in each bin.
end;