public class ArrayDigest extends AbstractTDigest
| Modifier and Type | Field and Description |
|---|---|
static int |
SMALL_ARRAY_DIGEST |
static int |
SMALL_ENCODING |
static int |
VERBOSE_ARRAY_DIGEST |
static int |
VERBOSE_ENCODING |
gen, recordAllData| Constructor and Description |
|---|
ArrayDigest(int pageSize,
double compression) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x,
int w)
Adds a sample to a histogram.
|
Iterator<com.tdunning.math.stats.ArrayDigest.Index> |
allAfter(double x) |
Iterator<com.tdunning.math.stats.ArrayDigest.Index> |
allBefore(double x)
Returns an iterator which will give each element <= to x in non-increasing order.
|
void |
asBytes(ByteBuffer buf)
Outputs a histogram as bytes using a particularly cheesy encoding.
|
void |
asSmallBytes(ByteBuffer buf)
Serialize this TDigest into a byte buffer.
|
int |
byteSize()
Returns an upper bound on the number bytes that will be required to represent this histogram.
|
double |
cdf(double x)
Returns the fraction of all points added which are <= x.
|
com.tdunning.math.stats.ArrayDigest.Index |
ceiling(double x) |
int |
centroidCount()
The number of centroids currently in the TDigest.
|
Iterable<? extends Centroid> |
centroids()
An iterable that lets you go through the centroids in ascending order by mean.
|
void |
compress()
Re-examines a t-digest to determine whether some centroids are redundant.
|
void |
compress(GroupTree other) |
double |
compression()
Returns the current compression factor.
|
int |
count(com.tdunning.math.stats.ArrayDigest.Index index) |
com.tdunning.math.stats.ArrayDigest.Index |
floor(double x)
Returns a cursor pointing to the first element <= x.
|
static ArrayDigest |
fromBytes(ByteBuffer buf)
Reads a histogram from a byte buffer
|
long |
headSum(com.tdunning.math.stats.ArrayDigest.Index limit) |
com.tdunning.math.stats.ArrayDigest.Index |
increment(com.tdunning.math.stats.ArrayDigest.Index x,
int delta) |
double |
mean(com.tdunning.math.stats.ArrayDigest.Index index) |
double |
quantile(double q)
Returns an estimate of the cutoff such that a specified fraction of the data
added to this TDigest would be less than or equal to the cutoff.
|
long |
size()
Returns the number of points that have been added to this TDigest.
|
int |
smallByteSize()
Returns an upper bound on the number of bytes that will be required to represent this histogram in
the tighter representation.
|
add, add, createCentroid, decode, encode, interpolate, isRecording, merge, recordAllDatacheckValue, createArrayDigest, createArrayDigest, createTreeDigestpublic static final int VERBOSE_ENCODING
public static final int SMALL_ENCODING
public static final int VERBOSE_ARRAY_DIGEST
public static final int SMALL_ARRAY_DIGEST
public void add(double x,
int w)
TDigestpublic long headSum(com.tdunning.math.stats.ArrayDigest.Index limit)
public double mean(com.tdunning.math.stats.ArrayDigest.Index index)
public int count(com.tdunning.math.stats.ArrayDigest.Index index)
public void compress()
TDigestpublic void compress(GroupTree other)
compress in class AbstractTDigestpublic long size()
TDigestpublic double cdf(double x)
TDigestpublic double quantile(double q)
TDigestpublic int centroidCount()
TDigestcentroidCount in class TDigestpublic Iterable<? extends Centroid> centroids()
TDigestpublic Iterator<com.tdunning.math.stats.ArrayDigest.Index> allAfter(double x)
public com.tdunning.math.stats.ArrayDigest.Index floor(double x)
x - The value used to find the cursor.public com.tdunning.math.stats.ArrayDigest.Index ceiling(double x)
public Iterator<com.tdunning.math.stats.ArrayDigest.Index> allBefore(double x)
x - The upper bound of all returned elementspublic com.tdunning.math.stats.ArrayDigest.Index increment(com.tdunning.math.stats.ArrayDigest.Index x,
int delta)
public double compression()
TDigestcompression in class TDigestpublic int byteSize()
public int smallByteSize()
smallByteSize in class TDigestpublic void asBytes(ByteBuffer buf)
public void asSmallBytes(ByteBuffer buf)
TDigestasSmallBytes in class TDigestbuf - The byte buffer into which the TDigest should be serialized.public static ArrayDigest fromBytes(ByteBuffer buf)
Copyright © 2014. All rights reserved.