In package fOptions, there are functions that generate
Halton sequences.
The van der Corput sequence for base 2 is a particular case
of the Halton sequence generated by:
n - 8 # anything here...
x - runif.halton(n, 1)
In fact, x - runif.halton(n, dim) will generate the van der Corput
sequences
Alberto,
I think the functions below do what you want:
vanDerCorput(12,6)
[1] 0.1667 0. 0.5000 0.6667 0.8333 0.0278
[7] 0.1944 0.3611 0.5278 0.6944 0.8611 0.0556
Regards,
Carlos
number2digits=function(n,base){
#first digit in output is
2 matches
Mail list logo