public class BivariateSimpleStatsTally
extends java.lang.Object
implements java.beans.PropertyChangeListener
Modifier and Type | Field and Description |
---|---|
protected double |
covariance |
protected double[] |
diff |
protected SimpleStatsTally[] |
marginals |
Constructor and Description |
---|
BivariateSimpleStatsTally()
Instantiate a BivariateSimpleStatsTally with the default name
(from
AbstractSimpleStats ). |
BivariateSimpleStatsTally(java.lang.String name)
Instantiate the marginals and diff arrays.
|
Modifier and Type | Method and Description |
---|---|
double |
getCorrelation() |
int |
getCount(int index) |
double |
getCovariance() |
double |
getMaxObs(int index) |
double |
getMean(int index) |
double |
getMinObs(int index) |
double |
getStandardDeviation(int index) |
double |
getVariance(int index) |
void |
newObservation(double[] x)
Adds a new observation with the contents of the given array
|
void |
newObservation(double x,
double y) |
void |
propertyChange(java.beans.PropertyChangeEvent evt)
If property name matches this object's name and new value is
a double[], then add a new observation with the new value.
|
void |
reset()
reset marginals, diff array and covariance to 0.0
|
java.lang.String |
toString() |
protected SimpleStatsTally[] marginals
protected double[] diff
protected double covariance
public BivariateSimpleStatsTally(java.lang.String name)
name
- Name of BivariateSimpleStatsTally. If used as a
PropertyChangeListener, this must correspond to the name of the property
being fired.public BivariateSimpleStatsTally()
AbstractSimpleStats
).public void reset()
public void newObservation(double x, double y)
x
- New value of index 0y
- New value of index 1public void newObservation(double[] x)
x
- Given array of length 2java.lang.IllegalArgumentException
- if length of given array is not 2public void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange
in interface java.beans.PropertyChangeListener
evt
- Heard PropertyChnageEventpublic double getCovariance()
public double getCorrelation()
public int getCount(int index)
index
- index of count to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public double getMinObs(int index)
index
- index of min observation to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public double getMaxObs(int index)
index
- index of max observation to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public double getMean(int index)
index
- index of mean to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public double getStandardDeviation(int index)
index
- index of standard deviation to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public double getVariance(int index)
index
- index of variance to getjava.lang.ArrayIndexOutOfBoundsException
- if index is not 0 or 1public java.lang.String toString()
toString
in class java.lang.Object