public abstract class AbstractTDigest extends TDigest
| Modifier and Type | Field and Description |
|---|---|
protected Random |
gen |
protected boolean |
recordAllData |
| Constructor and Description |
|---|
AbstractTDigest() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(double x)
Adds a sample to a histogram.
|
void |
add(TDigest other)
Add all of the centroids of another TDigest to this one.
|
protected Centroid |
createCentroid(double mean,
int id) |
static int |
decode(ByteBuffer buf) |
static void |
encode(ByteBuffer buf,
int n) |
static double |
interpolate(double x,
double x0,
double x1) |
boolean |
isRecording() |
protected static TDigest |
merge(Iterable<TDigest> subData,
Random gen,
TDigest r) |
TDigest |
recordAllData()
Sets up so that all centroids will record all data assigned to them.
|
static double |
weightedAverage(double x1,
int w1,
double x2,
int w2)
Same as
weightedAverageSorted(double, int, double, int) but flips
the order of the variables if x2 is greater than
x1. |
static double |
weightedAverageSorted(double x1,
int w1,
double x2,
int w2)
Compute the weighted average between
x1 with a weight of
w1 and x2 with a weight of w2. |
add, asBytes, asSmallBytes, byteSize, cdf, centroids, checkValue, compress, compression, createArrayDigest, createArrayDigest, createAvlTreeDigest, createDigest, createTreeDigest, quantile, size, smallByteSizeprotected Random gen
protected boolean recordAllData
public static double weightedAverage(double x1,
int w1,
double x2,
int w2)
weightedAverageSorted(double, int, double, int) but flips
the order of the variables if x2 is greater than
x1.public static double weightedAverageSorted(double x1,
int w1,
double x2,
int w2)
x1 with a weight of
w1 and x2 with a weight of w2.
This expects x1 to be less than or equal to x2
and is guaranteed to return a number between x1 and
x2.public static double interpolate(double x,
double x0,
double x1)
public static void encode(ByteBuffer buf, int n)
public static int decode(ByteBuffer buf)
public TDigest recordAllData()
recordAllData in class TDigestpublic boolean isRecording()
isRecording in class TDigestpublic void add(double x)
public void add(TDigest other)
TDigestprotected Centroid createCentroid(double mean, int id)
Copyright © 2015. All rights reserved.