Package com.tdunning.math.stats
Class Centroid
java.lang.Object
com.tdunning.math.stats.Centroid
- All Implemented Interfaces:
Comparable<Centroid>
A single centroid which represents a number of data points.
-
Constructor Details
-
Centroid
public Centroid(double x) -
Centroid
public Centroid(double x, int w) -
Centroid
public Centroid(double x, int w, int id) -
Centroid
public Centroid(double x, int id, boolean record)
-
-
Method Details
-
add
public void add(double x, int w) -
mean
public double mean() -
count
public int count() -
id
public int id() -
toString
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareTo
in interfaceComparable<Centroid>
-
data
-
insertData
public void insertData(double x) -
createWeighted
-
add
-