Package com.tdunning.math.stats
Class Centroid
java.lang.Object
com.tdunning.math.stats.Centroid
- All Implemented Interfaces:
Serializable
,Comparable<Centroid>
A single centroid which represents a number of data points.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
private int
private int
private static final AtomicInteger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(double x, int w) void
int
int
count()
static Centroid
createWeighted
(double x, int w, Iterable<? extends Double> data) data()
int
hashCode()
int
id()
void
insertData
(double x) double
mean()
private void
private void
start
(double x, int w, int id) toString()
-
Field Details
-
uniqueCount
-
centroid
private double centroid -
count
private int count -
id
private transient int id -
actualData
-
-
Constructor Details
-
Centroid
private Centroid(boolean record) -
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) -
Centroid
-
-
Method Details
-
start
private void start(double x, int w, int id) -
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
-
readObject
- Throws:
ClassNotFoundException
IOException
-