|
Dew Stats for .NET
|
Divide the Data vector elements into NumBins equal intervals.
public CumulativeHist(TVec Data, int NumBins, TVec Results, TVec Bins, bool CenterBins);
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.
Use this version if you need equidistant cumulative histogram.
Equal bins -> faster algorithm.
using Dew.Math; using Dew.Stats; using Dew.Stats.Units; namespace Dew.Examples { private void Example() { Vector Data = new Vector(1000,false); Vector Bins = new Vecttor(0); Vector CumRelFreq = new Vector(0); // generate some normally distributed data StatRandom.RandomNormal(-3.0, 0.2, Data); Statistics.CumulativeHist(Data,15,CumRelFreq,Bins); // Bins holds the 15 intervals centerpoints // and CumRelFreq holds the relative cumulative count of // elements in each bin. } }
|
What do you think about this topic? Send feedback!
|
|
Copyright (c) 1999-2010 by Dew Research. All rights reserved.
|