You are here: Symbol Reference > Statistics Namespace > Functions > Statistics.CumulativeHist Function
Stats Master VCL
ContentsIndex
Example

Equal bins -> faster algorithm.

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;
#include "MtxExpr.hpp"
#include "StatRandom.hpp"
#include "Statistics.hpp"
void __fastcall Example()
{
  sVector Data, Bins, CumRelFreq;
  Data.Size(1000,false);
  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.
}
Copyright (c) 1999-2025 by Dew Research. All rights reserved.