|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.imsl.stat.FaureSequence
public class FaureSequence
Generates the low-discrepancy Faure sequence.
Discrepancy measures the deviation from uniformity of a point set.
The discrepancy of the point set , is
where the supremum is over all subsets of of the form is the Lebesque measure, and A(E;n) is the number of the contained in E.The sequence of points in is a low-discrepancy sequence if there exists a constant c(d), depending only on d, such that
for all .Generalized Faure sequences can be defined for any prime base . The lowest bound for the discrepancy is obtained for the smallest prime , so the base defaults to the smallest prime greater than or equal to the dimension.
The generalized Faure sequence , is computed as follows:
Write the positive integer n in its b-ary expansion,
where are integers, .The j-th coordinate of is
The generator matrix for the series, , is defined to be
and is an element of the Pascal matrix,It is faster to compute a shuffled Faure sequence than to compute the Faure sequence itself. It can be shown that this shuffling preserves the low-discrepancy property.
The shuffling used is the b-ary Gray code. The function G(n) maps the positive integer n into the integer given by its b-ary expansion. The sequence computed by this function is , where is the generalized Faure sequence.
Constructor Summary | |
---|---|
FaureSequence(int dim)
Creates a Faure sequence with the default base. |
|
FaureSequence(int dim,
int base,
int nSkip)
Creates a Faure sequence. |
Method Summary | |
---|---|
Object |
clone()
Returns a copy of this object. |
int |
getBase()
Returns the base. |
long |
getCount()
|
int |
getDimension()
Returns the dimension of the sequence. |
int |
getSkip()
Returns the number of points skipped at the beginning of the sequence. |
double |
nextDouble()
Returns the first value of the next point in the sequence. |
double[] |
nextPoint()
Returns the next point in the sequence. |
static int |
nextPrime(int n)
Returns the smallest prime greater than or equal to n. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FaureSequence(int dim)
dim
- is the dimension of the sequence.public FaureSequence(int dim, int base, int nSkip)
dim
- is the dimension of the sequence.base
- is the base of the sequence, as described above.
It must be at least as large as dim.nSkip
- is the number of initial points to skip.
If negative then ,
where m is the number of digits needed to represent
the Integer.MAX_VALUE
in the base,
points are skipped.Method Detail |
---|
public Object clone()
clone
in class Object
public int getBase()
public long getCount()
public int getDimension()
getDimension
in interface RandomSequence
public int getSkip()
public double nextDouble()
double
array, the next sequence value.public double[] nextPoint()
nextPoint
in interface RandomSequence
double
array, the next point in the sequence.public static int nextPrime(int n)
n
- is the first number to try as a prime.
|
JMSLTM Numerical Library 6.1 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |