public abstract class TDigest
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
TDigest() |
Modifier and Type | Method and Description |
---|---|
void |
add(double x)
Add a point to the estimator
|
abstract void |
add(double x,
int w)
Add a point to the estimator
|
abstract void |
asBytes(java.nio.ByteBuffer buff)
Encode the estimator into a byte buffer
|
abstract void |
asSmallBytes(java.nio.ByteBuffer buff)
More compact encoding
|
abstract int |
byteSize()
Number of bytes required for the standard encoding
|
abstract double |
cdf(double x)
CDF
|
abstract double |
compression()
Get the current compression level
|
static TDigest |
createTDigest(double compression)
Factory method.
|
static TDigest |
fromBytes(java.nio.ByteBuffer buff)
Decode a TDigest estimator from a byte buffer
|
static TDigest |
merge(double compression,
java.lang.Iterable<TDigest> subData)
Merge a collection of TDigest estimators into one
|
abstract double |
quantile(double x)
Quantile estimate
|
abstract int |
smallByteSize()
Number of bytes required for the compact encoding
|
public static TDigest createTDigest(double compression)
compression
- the compression level to usepublic void add(double x)
x
- the point to addpublic abstract void add(double x, int w)
x
- the point to addw
- the weight of the pointpublic abstract double cdf(double x)
x
- point at which the CDF should be evaluatedpublic abstract double quantile(double x)
x
- which quantile to returnpublic abstract void asBytes(java.nio.ByteBuffer buff)
buff
- the buffer to hold the encoded estimatorpublic abstract void asSmallBytes(java.nio.ByteBuffer buff)
buff
- the buffer to hold the encoded estiamtorpublic abstract int byteSize()
public abstract int smallByteSize()
public abstract double compression()
public static TDigest fromBytes(java.nio.ByteBuffer buff)
buff
- the buffer