Package com.tdunning.math.stats
Class AbstractTDigest
- java.lang.Object
-
- com.tdunning.math.stats.TDigest
-
- com.tdunning.math.stats.AbstractTDigest
-
- Direct Known Subclasses:
ArrayDigest,AVLTreeDigest,TreeDigest
public abstract class AbstractTDigest extends TDigest
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Randomgenprotected booleanrecordAllData
-
Constructor Summary
Constructors Constructor Description AbstractTDigest()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(double x)Adds a sample to a histogram.voidadd(TDigest other)Add all of the centroids of another TDigest to this one.abstract voidcompress(GroupTree other)protected CentroidcreateCentroid(double mean, int id)static intdecode(java.nio.ByteBuffer buf)static voidencode(java.nio.ByteBuffer buf, int n)static doubleinterpolate(double x, double x0, double x1)booleanisRecording()protected static TDigestmerge(java.lang.Iterable<TDigest> subData, java.util.Random gen, TDigest r)TDigestrecordAllData()Sets up so that all centroids will record all data assigned to them.-
Methods inherited from class com.tdunning.math.stats.TDigest
add, asBytes, asSmallBytes, byteSize, cdf, centroidCount, centroids, checkValue, compress, compression, createArrayDigest, createArrayDigest, createTreeDigest, quantile, size, smallByteSize
-
-
-
-
Method Detail
-
interpolate
public static double interpolate(double x, double x0, double x1)
-
encode
public static void encode(java.nio.ByteBuffer buf, int n)
-
decode
public static int decode(java.nio.ByteBuffer buf)
-
merge
protected static TDigest merge(java.lang.Iterable<TDigest> subData, java.util.Random gen, TDigest r)
-
compress
public abstract void compress(GroupTree other)
-
recordAllData
public TDigest recordAllData()
Sets up so that all centroids will record all data assigned to them. For testing only, really.- Specified by:
recordAllDatain classTDigest- Returns:
- This TDigest so that configurations can be done in fluent style.
-
isRecording
public boolean isRecording()
- Specified by:
isRecordingin classTDigest
-
add
public void add(double x)
Adds a sample to a histogram.
-
add
public void add(TDigest other)
Description copied from class:TDigestAdd all of the centroids of another TDigest to this one.
-
createCentroid
protected Centroid createCentroid(double mean, int id)
-
-