You are here: Symbol Reference > Dew.Stats Namespace > Statistics Class > Statistics Methods > CumulativeHist Method > CumulativeHist Method (TVec, TVec, TVec)
Dew Stats for .NET
Contents
PreviousUpNext
Statistics.CumulativeHist Method (TVec, TVec, TVec)

Cumulative histogram.

C#
public CumulativeHist(TVec Data, TVec Bins, TVec Results);

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.

Use this version if you need non-equidistant histogram.

Unequal bins -> slower that equidistant bins algorithm.

using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
  private void Example()
  {
    Vector Data  = new Vector(0);
    Vector Bins = new Vecttor(0);
    Vector CumRelFreq = new Vector(0);
    Data.SetIt(false, new double[] {1,2,3,4,5,6,7,8,9,10});
    // define centerpoints, note that values are sorted!
    Bins.SetIt(false, new double[] {1.5, 2, 6, 9});
    Statistics.CumulativeHist(Data,Bins, CumRelFreq);
    // 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.