All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jDisco.Histogram

java.lang.Object
   |
   +----jDisco.Tab
           |
           +----jDisco.Histogram

public class Histogram
extends jDisco.Tab
This class can be used for collecting time independent data and for producing a graphical representation of the collected data.

A histogram object records a rough profile of a sequence of real values, by asking in advance for their (expected) lower bound, lower, and upper bound, upper; and also for the number of recording cells, ncells. The range [lower;upper[ is divided into ncell cells, each of the same width.

Example of use:


     class HouseOnFire extends Process {
         static Histogram perDamage = new Tally("Perc.damage", 0, 100, 20);
         public void actions() {
             Variable damage = new Variable(size).start();
             do burning;
             h.update(damage.state * 100 / material);
         }
     }
 
A typical report:
                                      
 title       /  (re)set/   obs/  average/est.st.dv/  minimum/  maximum/    conf./
 Perc. damage     0.000    138    13.817    13.257     0.062    73.831     2.240
 cell/lower lim/    n/   freq/  cum %
                                       |----------------------------------------
    0 -infinity     0    0.00    0.00  |
    1     0.000    16    0.12   11.59  |*****************
    2     5.000    38    0.28   39.13  |****************************************
    3    10.000    31    0.22   61.59  |*********************************
    4    15.000    17    0.12   73.91  |******************
    5    20.000    13    0.09   83.33  |**************
    6    25.000     4    0.03   86.23  |****
    7    30.000     4    0.03   89.13  |****
    8    35.000     6    0.04   93.48  |******
    9    40.000     2    0.01   94.93  |**
   10    45.000     4    0.03   97.83  |****
   11    50.000     1    0.01   98.55  |*
   12    55.000     0    0.00   98.55  |
   13    60.000     0    0.00   98.55  |
   14    65.000     0    0.00   98.55  |
   15    70.000     0    0.00   98.55  |
   16    75.000     2    0.01  100.00  |**
   17    80.000     0    0.00  100.00  |
   18    85.000     0    0.00  100.00  |
   19    90.000     0    0.00  100.00  |
                                           **rest of table empty**
                                       |----------------------------------------
 

See Also:
jDisco.Tab, jDisco.Tally

Constructor Index

 o Histogram(String, double, double, int)
The constructor.

Method Index

 o confidence()
Returns the confidence interval half-width for the default level (0.95).
 o confidence(double)
Returns the confidence interval half-width for a level between 0 and 1.
 o max()
Returns the largest sample value.
 o mean()
Returns the mean.
 o min()
Returns the least sample value.
 o report()
Prints the histogram.
 o reset()
Resets the object.
 o stdDev()
Returns the standard deviation.
 o update(double)
Records a new entry.
 o variance()
Returns the variance.

Constructors

 o Histogram
 public Histogram(java.lang.String title,
                  double lower,
                  double upper,
                  int nCells)
The constructor.

Parameters:
title - the title.
lower - the lower limit.
upper - the upper limit.
nCells - the number of cells.

Methods

 o reset
 public void reset()
Resets the object.

Overrides:
reset in class jDisco.Tab
 o update
 public void update(double v)
Records a new entry.

Overrides:
update in class jDisco.Tab
 o report
 public void report()
Prints the histogram.

Overrides:
report in class jDisco.Tab
 o min
 public double min()
Returns the least sample value.

 o max
 public double max()
Returns the largest sample value.

 o mean
 public double mean()
Returns the mean.

 o variance
 public double variance()
Returns the variance.

 o stdDev
 public double stdDev()
Returns the standard deviation.

 o confidence
 public double confidence(double level)
Returns the confidence interval half-width for a level between 0 and 1.

Parameters:
level - the level, eg. 0.95.
Returns:
the confidence interval half-width.
 o confidence
 public double confidence()
Returns the confidence interval half-width for the default level (0.95).

Returns:
the confidence interval half-width.

All Packages  Class Hierarchy  This Package  Previous  Next  Index