@Reference(title="Randomized halton sequences", authors="Wang, X. and Hickernell, F.J.", booktitle="Mathematical and Computer Modelling Vol. 32 (7)", url="http://dx.doi.org/10.1016/S0895-7177(00)00178-3") public class HaltonUniformDistribution extends Object implements Distribution
Randomized halton sequences
Wang, X. and Hickernell, F.J.
Mathematical and Computer Modelling Vol. 32 (7)
Modifier and Type | Class and Description |
---|---|
static class |
HaltonUniformDistribution.Parameterizer
Parameterization class
TODO: allow manual parameterization of sequence parameters!
|
Modifier and Type | Field and Description |
---|---|
private static double |
ALMOST_ONE
Threshold
|
(package private) short |
base
Base value
|
(package private) int |
counter
Counter, for max iterations of fast function.
|
(package private) double |
current
Current value
|
(package private) double |
invbase
Inverse of base, for faster division by multiplication.
|
(package private) long |
inverse
Integer inverse
|
private double |
len
Len := max - min
|
(package private) double |
logbase
Logarithm of base.
|
private double |
max
Maximum
|
private static int |
MAXFAST
Maximum number of iterations of fast variant
|
(package private) int |
maxi
Maximum integer to use
|
private double |
min
Minimum
|
Constructor and Description |
---|
HaltonUniformDistribution(double min,
double max)
Constructor for a halton pseudo uniform distribution on the interval [min,
max[
|
HaltonUniformDistribution(double min,
double max,
int base,
double seed)
Constructor for a halton pseudo uniform distribution on the interval [min,
max[
|
HaltonUniformDistribution(double min,
double max,
Random rnd)
Constructor for a halton pseudo uniform distribution on the interval [min,
max[
|
HaltonUniformDistribution(double min,
double max,
RandomFactory rnd)
Constructor for a halton pseudo uniform distribution on the interval [min,
max[
|
Modifier and Type | Method and Description |
---|---|
double |
cdf(double val)
Return the cumulative density function at the given value.
|
private static int |
choosePrime(Random rnd)
Choose a random prime.
|
double |
getMax() |
double |
getMin() |
private long |
inverse(double current)
Compute the inverse with respect to the given base.
|
private double |
nextRadicalInverse()
Compute the next radical inverse.
|
double |
nextRandom()
Generate a new random value
|
double |
pdf(double val)
Return the density of an existing value
|
double |
quantile(double val)
Quantile aka probit (for normal) aka inverse CDF (invcdf, cdf^-1) function.
|
private double |
radicalInverse(long i)
Compute the radical inverse of i.
|
String |
toString()
Describe the distribution
|
private double min
private double max
private double len
private static final int MAXFAST
private static final double ALMOST_ONE
final short base
final double invbase
final double logbase
final int maxi
int counter
double current
long inverse
public HaltonUniformDistribution(double min, double max, int base, double seed)
min
- Minimum valuemax
- Maximum valuebase
- Base valueseed
- Random seed (starting value)public HaltonUniformDistribution(double min, double max)
min
- Minimum valuemax
- Maximum valuepublic HaltonUniformDistribution(double min, double max, Random rnd)
min
- Minimum valuemax
- Maximum valuernd
- Random generatorpublic HaltonUniformDistribution(double min, double max, RandomFactory rnd)
min
- Minimum valuemax
- Maximum valuernd
- Random generatorprivate static int choosePrime(Random rnd)
rnd
- Random generatorpublic double pdf(double val)
Distribution
pdf
in interface Distribution
val
- existing valuepublic double cdf(double val)
Distribution
cdf
in interface Distribution
val
- existing valuepublic double quantile(double val)
Distribution
quantile
in interface Distribution
val
- Quantile to findprivate long inverse(double current)
current
- Current valueprivate double radicalInverse(long i)
i
- Input long valueprivate double nextRadicalInverse()
public double nextRandom()
Distribution
nextRandom
in interface Distribution
public String toString()
Distribution
toString
in interface Distribution
toString
in class Object
public double getMin()
public double getMax()
Copyright © 2015 ELKI Development Team, Lehr- und Forschungseinheit für Datenbanksysteme, Ludwig-Maximilians-Universität München. License information.