Class pmr.stat.Univariate
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class pmr.stat.Univariate

java.lang.Object
   |
   +----pmr.stat.Stat
           |
           +----pmr.stat.DrawableStat
                   |
                   +----pmr.stat.Univariate

public class Univariate
extends DrawableStat
Univariate - Univariate class

Univariate statistics on a 1-dimensional array. Most of the usual stuff can be found in the member functions. the drawing routines (e.g. for Histogram) are not yet developed. (Note, if you want to display a RealArray as a graph, use Bivariate.)

Default has zero elements and default values of RealRange, etc; Some routines producing Gaussian variates are better done using Java

For zero or one elements, some routines throw ArrayTooSmallException

Author:
(C) P. Murray-Rust, 1996

Variable Index

 o CUMULATIVE
 o GRAPH
 o HISTOGRAM
display switches
 o LOG
 o ORIGINAL
 o ZSCORE

Constructor Index

 o Univariate()
default Univariate has zero elements and default components
 o Univariate(RealArray)
create from RealArray BY VALUE

Method Index

 o addElement(double)
 o debug()
 o display()
Kicks off a ScrollableTopLevel which contains the object.
 o display(Graphics)
used by the ScrollableTopLevel to paint the object, or can be used to draw the object to somewhere else.
 o display(Graphics, Component)
this may encapsulate the above routine, as we often need the component, e.g.
 o elementAt(int)
 o getGaussianVariate()
a random Gaussian variate normalised to mean = 0.0, sdev = 1.0
 o getGaussianVariate(double, double)
a random Gaussian variate from distribution with given mean and sdev
 o getMean()
 o getMedian()
 o getRandom(double, double)
random variate in range low-high
 o getRange()
 o getRealArray()
get the original data as RealArray
 o getStandardDeviation()
 o getTitle()
 o getTransformedArray(String)
get transformed data; unknown type returns null.
 o getVariance()
 o main(String[])
 o process()
the calculation routine;
 o setVariateType(String)
create transformation of values (e.g.
 o size()
 o toString()

Variables

 o HISTOGRAM
  public final static int HISTOGRAM
display switches
 o GRAPH
  public final static int GRAPH
 o ORIGINAL
  public final static String ORIGINAL
 o LOG
  public final static String LOG
 o CUMULATIVE
  public final static String CUMULATIVE
 o ZSCORE
  public final static String ZSCORE

Constructors

 o Univariate
  public Univariate()
default Univariate has zero elements and default components
 o Univariate
  public Univariate(RealArray f)
create from RealArray BY VALUE

Methods

 o process
  public void process() throws ArrayTooSmallException
the calculation routine;
Throws: ArrayTooSmallException
several routines require a minimum number of points
Overrides:
process in class Stat
 o getTitle
  public String getTitle()
Overrides:
getTitle in class Stat
 o addElement
  public void addElement(double x)
 o size
  public int size()
 o elementAt
  public double elementAt(int i)
 o getMean
  public double getMean() throws ArrayTooSmallException
Throws: ArrayTooSmallException
no data points
 o getVariance
  public double getVariance() throws ArrayTooSmallException
Throws: ArrayTooSmallException
less than 2 data points
 o getStandardDeviation
  public double getStandardDeviation() throws ArrayTooSmallException
Throws: ArrayTooSmallException
less than 2 data points
 o getRange
  public RealRange getRange() throws ArrayTooSmallException
Throws: ArrayTooSmallException
less than 2 data points
 o getMedian
  public double getMedian() throws ArrayTooSmallException
Throws: ArrayTooSmallException
less than 2 data points
 o getRealArray
  public RealArray getRealArray() throws ArrayTooSmallException
get the original data as RealArray
Throws: ArrayTooSmallException
shouldn't happen, but might with less than 2 data points
 o getTransformedArray
  public RealArray getTransformedArray(String key) throws ArrayTooSmallException
get transformed data; unknown type returns null. Keys are:
Throws: ArrayTooSmallException
shouldn't happen, but might with less than 2 data points
 o getRandom
  public static double getRandom(double low,
                                 double high)
random variate in range low-high
 o getGaussianVariate
  public static double getGaussianVariate()
a random Gaussian variate normalised to mean = 0.0, sdev = 1.0
 o getGaussianVariate
  public static double getGaussianVariate(double mean,
                                          double stdev)
a random Gaussian variate from distribution with given mean and sdev
 o toString
  public String toString()
Overrides:
toString in class Object
 o setVariateType
  public void setVariateType(String key) throws ArrayTooSmallException
create transformation of values (e.g. log, cumulative)
Throws: ArrayTooSmallException
several routines require a minimum number of points
 o display
  public void display()
Kicks off a ScrollableTopLevel which contains the object.
Overrides:
display in class DrawableStat
 o display
  public void display(Graphics g)
used by the ScrollableTopLevel to paint the object, or can be used to draw the object to somewhere else.
Overrides:
display in class DrawableStat
 o display
  public void display(Graphics g,
                      Component comp)
this may encapsulate the above routine, as we often need the component, e.g.
Overrides:
display in class DrawableStat
 o debug
  public void debug()
Overrides:
debug in class DrawableStat
 o main
  public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index