public enum ScaleFunction extends Enum<ScaleFunction>
The base forms (K_0, K_1, K_2 and K_3) all result in t-digests limited to a number of clusters equal to the compression factor. The K_2_NO_NORM and K_3_NO_NORM versions result in the cluster count increasing roughly with log(n).
| Enum Constant and Description |
|---|
K_0
Generates uniform cluster sizes.
|
K_1
Generates cluster sizes proportional to sqrt(q*(1-q)).
|
K_1_FAST
Generates cluster sizes proportional to sqrt(q*(1-q)) but avoids computation of asin in the critical path by
using an approximate version.
|
K_2
Generates cluster sizes proportional to q*(1-q).
|
K_2_NO_NORM
Generates cluster sizes proportional to q*(1-q).
|
K_3
Generates cluster sizes proportional to min(q, 1-q).
|
K_3_NO_NORM
Generates cluster sizes proportional to min(q, 1-q).
|
| Modifier and Type | Method and Description |
|---|---|
abstract double |
k(double q,
double normalizer)
Converts a quantile to the k-scale.
|
abstract double |
k(double q,
double compression,
double n)
Converts a quantile to the k-scale.
|
abstract double |
max(double q,
double normalizer)
Computes the maximum relative size a cluster can have at quantile q.
|
abstract double |
max(double q,
double compression,
double n)
Computes the maximum relative size a cluster can have at quantile q.
|
abstract double |
normalizer(double compression,
double n)
Computes the normalizer given compression and number of points.
|
abstract double |
q(double k,
double normalizer)
Computes q as a function of k.
|
abstract double |
q(double k,
double compression,
double n)
Computes q as a function of k.
|
static ScaleFunction |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ScaleFunction[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ScaleFunction K_0
public static final ScaleFunction K_1
public static final ScaleFunction K_1_FAST
public static final ScaleFunction K_2
public static final ScaleFunction K_3
public static final ScaleFunction K_2_NO_NORM
public static final ScaleFunction K_3_NO_NORM
public static ScaleFunction[] values()
for (ScaleFunction c : ScaleFunction.values()) System.out.println(c);
public static ScaleFunction valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract double k(double q,
double compression,
double n)
q - The quantilecompression - Also known as delta in literature on the t-digestn - The total number of samplespublic abstract double k(double q,
double normalizer)
q - The quantilenormalizer - The normalizer value which depends on compression and (possibly) number of points in the
digest.public abstract double q(double k,
double compression,
double n)
k - The index value to convert into q scale.compression - The compression factor (often written as δ)n - The number of samples already in the digest.public abstract double q(double k,
double normalizer)
k - The index value to convert into q scale.normalizer - The normalizer value which depends on compression and (possibly) number of points in the
digest.public abstract double max(double q,
double compression,
double n)
Note that this is the relative size of a cluster. To get the max number of samples in the cluster, multiply this value times the total number of samples in the digest.
q - The quantilecompression - The compression factor, typically delta in the literaturen - The number of samples seen so far in the digestpublic abstract double max(double q,
double normalizer)
Note that this is the relative size of a cluster. To get the max number of samples in the cluster, multiply this value times the total number of samples in the digest.
q - The quantilenormalizer - The normalizer value which depends on compression and (possibly) number of points in the
digest.public abstract double normalizer(double compression,
double n)
compression - The compression parameter for the digestn - The number of samples seen so farCopyright © 2021. All rights reserved.