[R] quasi-random sequences

Hans W. Borchers hwborchers at gmail.com
Sat Apr 26 17:25:40 CEST 2008

baptiste Auguié <ba208 <at> exeter.ac.uk> writes:
> Dear list useRs,

You might be interested to apply the Hammersley or Halton point sets that 
are often used in numerical integration or Differential Evolution. These 
pseudo-random distributions are both uniform and irregular, but have a 
kind of minimum resolution

There is an implementation of Halton Sequences in the often overlooked 
'sfsmisc' package, see the 'QUnif()' function there.  The help includes a 
visualization example dispaying the behavior I think you were looking for.

Hans Werner

> I have to generate a random set of coordinates (x,y) in [-1 ; 1]^2  
> for say, N points. At each of these points is drawn a circle (later  
> on, an ellipse) of random size, [...]
> My problem is to avoid collisions (overlap, really) between the  
> points. I would like some random pattern, but with a minimum  
> exclusion distance. In looking up "Numerical recipes in C", I found  
> out about some Sobol quasi-random sequences, which one can call from  
> the gsl package,
> [...]
> but this does not look very random: I clearly see some pattern  
> (diagonals, etc...), and even the non-overlapping condition is not  
> impressive.
> One (painful) way I can foresee is to check the distance between each  
> symbol and the others, and move the overlapping ones in a recursive  
> manner. Before delving into this, I wanted to check I'm not  
> overlooking something in the rgl quasi-random sequences, or missing a  
> more obvious way to generate such patterns. Perhaps solving an  
> electrostatic problem with a potential both attractive at long  
> distances and repulsive at short distances is a better way? I have a  
> vague recollection of hearing that somewhere to position points  
> evenly on a sphere.
> Thanks for any comment / suggestion,
> Baptiste

More information about the R-help mailing list