Unequal bins -> slower that equidistant bins algorithm.
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;
#include "MtxExpr.hpp" #include "Statistics.hpp" void __fastcall Example() { sVector Data, Bins, CumRelFreq; Data.SetIt(false,OPENARRAY(double,(1,2,3,4,5,6,7,8,9,10))); // define centerpoints, note that values are sorted! Bins.SetIt(false, OPENARRAY(double,(1.5, 2, 6, 9))); CumulativeHist(Data,Bins, CumRelFreq); // CumRelFreq holds the relative cumulative count of // elements in each bin. }
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|