Configure a field of the object and returns the modified object.
this = lowdisc_configure (this,key,value)
the current object
a string. The name of the option to get. All options which can be set with lowdisc_configure can be get with lowdisc_cget.
the value associated with the key. Its type depends on the value of the key.
This command allows to configure the state of the current object. It requires to take the current object both as an input and output argument.
To get a global overview of the supported options, please use
help lowdisc_options
The following keys are available: "-dimension"
,
"-skip"
, "-leap"
, "-verbose"
.
"-dimension"
: a positive floating point integer,
the dimension of the space, i.e.
the size of the vector returned by the command lowdisc_next (default = 1).
"-skip"
: a positive floating point integer,
the number of terms to skip at startup.
When the sequence is started up with the lowdisc_startup method,
then skip elements are ignored in the sequence, so that the
next point will be generated at index skip+1
.
For example, Fox recommends to skip the qs^4 - 2
first terms in the
Faure sequence, where qs is the prime number associated with the
sequence. This number can be retrieved with
qs=lowdisc_get(lds,"-faureprime")
.
"-leap"
: a positive floating point integer,
the number of elements to ignore from element to element (default = 0).
Each time the lowdisc_next function is called, the immediate element
is retrieved. Then, in order to prepare for the next call,
there are leap elements which are generated and immediately
discarded. This option allows to generate alternative
sequences based on the same basic generator.
"-verbose"
: a boolean, the verbose mode (default : %f).
Some sequences can be configured in order to increase their maximum
dimension.
These sequences accept the "-primeslist"
option.
The sequences which are sensitive to this option are : "halton",
"faure".
"-primeslist"
: a 1-by-n array of positive
floating point integers, where n is greater than 2,
a matrix of prime numbers used in several low discrepancy sequences.
The default value is made of the 100 first prime numbers, from 2
to 541, which enables the user to generate sequences up to 100
dimensions.
If a larger dimension problem is to manage, the -primeslist option
enables users to customize the list to meet the required dimension.
The user should be warned that the Halton sequence may produce
poor convergence rate if the dimension is larger than 15.
For the "niederreiter" sequence (Fast Niederreiter sequence in arbitrary base), we can configure the base as following.
"-base"
: a floating point number, greater than 2.
The base can be an odd or even integer.
The default value is 2.
It may be the smallest prime larger than the dimension as in the
Faure sequence, although it does not guarantee that this
leads to a lower discrepancy.
See the lowdisc_niedersuggest
function for a suggestion of the optimal
base, depending on the dimension.
For the "halton" sequence, we can configure the scrambling as following.
"-scrambling"
: a 1-by-1 matrix of strings, the
empty string "" (no scrambling),
"RR2" for the scrambling of Kocis-Whiten [1]
or "Reverse" for the scrambling of Vandewoestyne and Cools [2].
The default is "" (no scrambling).
The scrambling can improve the correlation in high dimensions,
leading to better low-dimensionnal projections.
For the "sobol" sequence, we can configure the scrambling as following.
"-scrambling"
: a 1-by-1 matrix of strings,
the empty string "" (no scrambling),
"Owen"
for the scrambling (digit permutation) of Owen,
"Faure-Tezuka"
or
"Owen-Faure-Tezuka"
.
The default is "" (no scrambling).
The scrambling can improve the correlation in high dimensions,
leading to better low-dimensionnal projections.
"-seeds"
: a 1-by-24 or 24-by-1 matrix of doubles,
the seeds used in the random number generator used in the
scrambling (if scrambling is enabled).
The default is
seeds= [.8804418,.2694365,.0367681,.4068699,.. .4554052,.2880635,.1463408,.2390333,.6407298,.1755283,.713294,.. .4913043,.2979918,.1396858,.3589528,.5254809,.9857749,.4612127,.. .2196441,.7848351,.40961,.9807353,.2689915,.5140357]
seeds=distfun_unifrnd(0,1,1,24)
Some expertise is required to configure the skip
and leap
options.
The skip
option can improve the Faure, Sobol and
Niederreiter sequences.
The leap
option can improve the Halton sequence, although
Kocis and Whiten also tried to leap the Faure and Sobol sequences.
This can lead to some trouble for non-experts.
For that purpose, we designed the following functions.
lowdisc_haltonsuggest
: provides
settings for the (unscrambled) Halton sequence,
lowdisc_fauresuggest
: provides
settings for the Faure sequence,
lowdisc_sobolsuggest
: provides
settings for the (unscrambled) Sobol sequence,
lowdisc_niedersuggest
: provides
settings for the Niederreiter sequence.
These functions have been designed to include suggestions by various authors to improve the sequences. In the situation where we have no knowledge of the settings to use, these functions may be used. Still, these have not been included as defaults, which authorizes a more aware choice of the parameters.
Some sequences are limited in the maximum number of dimensions,
because they use internally fixed tables of parameters (e.g. the Sobol
sequence).
Some other sequences can be extended with the "-primeslist"
option.
The "-primeslist"
option can be configure with a table of
primes computed with the number_primes100()
, number_primes1000()
or number_primes10000()
functions. The maximum dimension
which can be attained with these tables depends on the sequence.
See the specific settings of each sequence below for detail.
lds = lowdisc_new("faure"); lds = lowdisc_configure(lds,"-dimension",3); method = lowdisc_cget(lds,"-method") nbdim = lowdisc_cget(lds,"-dimension") i = lowdisc_get(lds,"-index") verbose = lowdisc_cget(lds,"-verbose") lds lds = lowdisc_destroy(lds); // See a Scrambled Halton sequence. lds = lowdisc_new("halton"); lds = lowdisc_configure(lds,"-dimension",44); lds = lowdisc_configure(lds,"-scrambling","RR2"); lds = lowdisc_startup (lds); [lds,u] = lowdisc_next (lds,500); lds = lowdisc_destroy(lds); scf(); plot(u(:,43),u(:,44),"b."); | ![]() | ![]() |
[1] Kocis, L., and W. J. Whiten. "Computational Investigations of Low-Discrepancy Sequences." ACM Transactions on Mathematical Software. Vol. 23, No. 2, 1997, pp. 266–294.
[2] B. Vandewoestyne and R. Cools, "Good permutations for deterministic scrambled Halton sequences in terms of L2-discrepancy", Computational and Applied Mathematics 189, 2006.