edu.ucla.stat.SOCR.distributions
Class IntervalData

java.lang.Object
  extended by edu.ucla.stat.SOCR.distributions.IntervalData

public class IntervalData
extends java.lang.Object

This class defines a simple implementation of an interval data distribution. The data distribution is based on a specified domain (that is, a partition of an interval). When values are added, frequency counts for the subintervals are computed and various statistic updated.


Constructor Summary
IntervalData()
          This default constructor creates a new data distribution on the interval [0, 1] with subintervals of length 0.1, and the default name "X".
IntervalData(Domain d)
          This special constructor creates a new data distribution with a specified domain and the default name "X".
IntervalData(Domain d, java.lang.String n)
          This general constructor creates a new data distribution with a specified domain and a specified name
IntervalData(double a, double b, double w)
          This spcial constructor creates a new data distribution with a specified domain and the name "X"
IntervalData(double a, double b, double w, java.lang.String n)
          This general constructor creates a new data distribution with a specified domain and a specified name.
 
Method Summary
 double getDensity(double x)
          This method returns the getDensity for a given value
 Domain getDomain()
          This method returns the domain.
 double getDomainValue(double x)
          This method returns the domain value (midpoint) closest to given value of x
 int getFreq(double x)
          This method returns the frequency of the class containing a given value of x.
 double getIntervalMean()
          This method returns the mean of the frequency distribution.
 double getIntervalSD()
          This method returns the interval standard deviation.
 double getIntervalVariance()
          This method returns the interval variance.
 double getMAD()
          This method computes the mean absoulte deviation
 double getMaxDensity()
          This method returns the maximum getDensity.
 int getMaxFreq()
          This method returns the maximum frequency
 double getMaxRelFreq()
          This method returns the maximum relative frequency.
 double getMaxValue()
          This method returns the maximum value of the data set
 double getMean()
          This method returns the mean of the data set.
 double getMedian()
          This method computes the median of the entire data set
 double getMedian(double a, double b)
          This method computes the median of the values in the data set between two specified values
 double getMinValue()
          This method returns the minimum value of the data set
 double getMode()
          This method returns the mode of the distribution.
 java.lang.String getName()
          This method gets the name of the data set.
 double getQuartile(int i)
          This method returns the quartiles of the data set.
 double getRelFreq(double x)
          This method returns the relative frequency of the class containing a given value.
 double getSD()
          This method returns the sample standard deviation.
 double getSDP()
          This method returns the population standard deviation.
 int getSize()
          This method returns the number of pointCount in the data set
 double getValue()
          This method returns the current value of the data set
 double getVariance()
          This method returns the sample variance.
 double getVarianceP()
          This method returns the population variance
 void reset()
          This method resets the data set
 void setDomain(Domain d)
          This method sets the domain of the data set.
 void setName(java.lang.String n)
          This method sets the name of the data set.
 void setValue(double x)
          This method adds a new number to the data set and re-compute the mean, mean square, minimum and maximum values, the frequency distribution, and the mode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntervalData

public IntervalData(Domain d,
                    java.lang.String n)
This general constructor creates a new data distribution with a specified domain and a specified name


IntervalData

public IntervalData(double a,
                    double b,
                    double w,
                    java.lang.String n)
This general constructor creates a new data distribution with a specified domain and a specified name.


IntervalData

public IntervalData(Domain d)
This special constructor creates a new data distribution with a specified domain and the default name "X".


IntervalData

public IntervalData(double a,
                    double b,
                    double w)
This spcial constructor creates a new data distribution with a specified domain and the name "X"


IntervalData

public IntervalData()
This default constructor creates a new data distribution on the interval [0, 1] with subintervals of length 0.1, and the default name "X".

Method Detail

setDomain

public void setDomain(Domain d)
This method sets the domain of the data set.


getDomain

public Domain getDomain()
This method returns the domain.


setName

public void setName(java.lang.String n)
This method sets the name of the data set.


getName

public java.lang.String getName()
This method gets the name of the data set.


reset

public void reset()
This method resets the data set


setValue

public void setValue(double x)
This method adds a new number to the data set and re-compute the mean, mean square, minimum and maximum values, the frequency distribution, and the mode


getValue

public double getValue()
This method returns the current value of the data set


getDomainValue

public double getDomainValue(double x)
This method returns the domain value (midpoint) closest to given value of x


getFreq

public int getFreq(double x)
This method returns the frequency of the class containing a given value of x.


getRelFreq

public double getRelFreq(double x)
This method returns the relative frequency of the class containing a given value.


getDensity

public double getDensity(double x)
This method returns the getDensity for a given value


getMean

public double getMean()
This method returns the mean of the data set.


getIntervalMean

public double getIntervalMean()
This method returns the mean of the frequency distribution. The interval mean is an approximation to the true mean of the data set.


getVarianceP

public double getVarianceP()
This method returns the population variance


getSDP

public double getSDP()
This method returns the population standard deviation.


getVariance

public double getVariance()
This method returns the sample variance.


getSD

public double getSD()
This method returns the sample standard deviation.


getIntervalVariance

public double getIntervalVariance()
This method returns the interval variance.


getIntervalSD

public double getIntervalSD()
This method returns the interval standard deviation.


getMinValue

public double getMinValue()
This method returns the minimum value of the data set


getMaxValue

public double getMaxValue()
This method returns the maximum value of the data set


getMedian

public double getMedian(double a,
                        double b)
This method computes the median of the values in the data set between two specified values


getMedian

public double getMedian()
This method computes the median of the entire data set


getQuartile

public double getQuartile(int i)
This method returns the quartiles of the data set.


getMAD

public double getMAD()
This method computes the mean absoulte deviation


getSize

public int getSize()
This method returns the number of pointCount in the data set


getMaxFreq

public int getMaxFreq()
This method returns the maximum frequency


getMaxRelFreq

public double getMaxRelFreq()
This method returns the maximum relative frequency.


getMaxDensity

public double getMaxDensity()
This method returns the maximum getDensity.


getMode

public double getMode()
This method returns the mode of the distribution. The mode may not exist