JMSLTM Numerical Library 4.0

com.imsl.stat
Class TableOneWay

java.lang.Object
  extended bycom.imsl.stat.TableOneWay
All Implemented Interfaces:
Cloneable, Serializable

public class TableOneWay
extends Object
implements Serializable, Cloneable

Tallies observations into a one-way frequency table.

See Also:
Example, Serialized Form

Constructor Summary
TableOneWay(double[] x, int nIntervals)
          Constructor for TableOneWay.
 
Method Summary
 double[] getFrequencyTable()
          Returns the one-way frequency table.
 double[] getFrequencyTable(double lower_bound, double upper_bound)
          Returns a one-way frequency table using known bounds.
 double[] getFrequencyTableUsingClassmarks(double[] classmarks)
          Returns the one-way frequency table using class marks.
 double[] getFrequencyTableUsingCutpoints(double[] cutpoints)
          Returns the one-way frequency table using cutpoints.
 double getMaximum()
          Returns maximum value of x.
 double getMinimum()
          Returns the minimum value of x.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableOneWay

public TableOneWay(double[] x,
                   int nIntervals)
Constructor for TableOneWay.

Parameters:
x - A double array containing the observations.
nIntervals - An int scalar containing the number of intervals (bins).
Method Detail

getFrequencyTable

public double[] getFrequencyTable()
Returns the one-way frequency table. nIntervals intervals of equal length are used with the initial interval starting with the minimum value in x and the last interval ending with the maximum value in x. The initial interval is closed on the left and the right. The remaining intervals are open on the left and the closed on the right. Each interval is of length (max-min)/nIntervals, where max is the maximum value of x and min is the minimum value of x.

Returns:
double array containing the one-way frequency table.

getFrequencyTable

public double[] getFrequencyTable(double lower_bound,
                                  double upper_bound)
Returns a one-way frequency table using known bounds. The one-way frequency table is computed using two semi-infinite intervals as the initial and last intervals. The initial interval is closed on the right and includes lower_bound as its right endpoint. The last interval is open on the left and includes all values greater than upper_bound. The remaining nIntervals - 2 intervals are each of length (upper_bound - lower_bound)/ (nIntervals - 2) and are open on the left and closed on the right. nIntervals must be greater than or equal to 3.

Parameters:
lower_bound - double specifies the right endpoint.
upper_bound - double specifies the left endpoint.
Returns:
double array containing the one-way frequency table.

getFrequencyTableUsingClassmarks

public double[] getFrequencyTableUsingClassmarks(double[] classmarks)
Returns the one-way frequency table using class marks. Equally spaced class marks in ascending order must be provided in the array classmarks of length nIntervals. The class marks are the midpoints of each of the nIntervals. Each interval is assumed to have length classmarks[1] - classmarks[0]. nIntervals must be greater than or equal to 2.

Parameters:
classmarks - double array containing either the cutpoints or the class marks.
Returns:
double array containing the one-way frequency table.

getFrequencyTableUsingCutpoints

public double[] getFrequencyTableUsingCutpoints(double[] cutpoints)
Returns the one-way frequency table using cutpoints. The cutpoints are boundaries that must be provided in the array cutpoints of length nIntervals-1. This option allows unequal interval lengths. The initial interval is closed on the right and includes the initial cutpoint as its right endpoint. The last interval is open on the left and includes all values greater than the last cutpoint. The remaining nIntervals-2 intervals are open on the left and closed on the right. Argument nIntervals must be greater than or equal to 3 for this option.

Parameters:
cutpoints - double array containing the cutpoints.
Returns:
double array containing the one-way frequency table.

getMaximum

public double getMaximum()
Returns maximum value of x.

Returns:
a double containing the maximum data bound.

getMinimum

public double getMinimum()
Returns the minimum value of x.

Returns:
a double containing the minimum data bound.

JMSLTM Numerical Library 4.0

Copyright 1970-2006 Visual Numerics, Inc.
Built June 1 2006.