org.knowceans.util
Class Histogram

java.lang.Object
  extended by org.knowceans.util.Histogram

public class Histogram
extends java.lang.Object

Histogram is a static class to output histogram data graphically on an output print stream. It uses lines as columns for the bins.

Author:
gregor

Constructor Summary
Histogram()
           
 
Method Summary
static int[] hist(double[] data, double low, double high, int bins)
          print histogram of the data
static double[] hist(java.io.PrintStream out, double[] data, double low, double high, int bins, int fmax)
          print histogram of the data
static double[] hist(java.io.PrintStream out, double[] data, int size)
          print histogram that spans the complete data set and chooses the proportion of the histogram to be good at a given size (max freqency).
static java.util.TreeMap<java.lang.Integer,java.lang.Integer> hist(java.io.PrintStream out, int[] data, int size)
          Print a histogram of the categorical data.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Histogram

public Histogram()
Method Detail

hist

public static double[] hist(java.io.PrintStream out,
                            double[] data,
                            double low,
                            double high,
                            int bins,
                            int fmax)
print histogram of the data

Parameters:
out - stream to print to
data - vector of evidence
low - lower bin limit
high - upper bin limit
bins - # of bins
fmax - max frequency in display
Returns:
the scaled histogram bin values

hist

public static int[] hist(double[] data,
                         double low,
                         double high,
                         int bins)
print histogram of the data

Parameters:
data - vector of evidence
low - lower bin limit
high - upper bin limit
bins - # of bins
Returns:
the histogram bin counts

hist

public static double[] hist(java.io.PrintStream out,
                            double[] data,
                            int size)
print histogram that spans the complete data set and chooses the proportion of the histogram to be good at a given size (max freqency).

Parameters:
out - output stream
data - data vector
size - controls max frequency and bin number
Returns:
the scaled histogram bin values

hist

public static java.util.TreeMap<java.lang.Integer,java.lang.Integer> hist(java.io.PrintStream out,
                                                                          int[] data,
                                                                          int size)
Print a histogram of the categorical data. All categories whose frequency is zero are omitted, therefore the method returns a treemap with the non-zero frequencies (unnormalised) and not the complete interval between the min and max of the data values.

Parameters:
out -
data -
size -
Returns: