home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.theory:2351 sci.math:14497
- Path: sparky!uunet!olivea!decwrl!sdd.hp.com!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!bnrgate!bnr.co.uk!pipex!pavo.csi.cam.ac.uk!emu.pmms.cam.ac.uk!rgep
- From: rgep@emu.pmms.cam.ac.uk (Richard Pinch)
- Newsgroups: comp.theory,sci.math
- Subject: Re: Uniform noise in a d-sphere
- Keywords: Random vector in the hypersphere
- Message-ID: <1992Nov6.103034.4045@infodev.cam.ac.uk>
- Date: 6 Nov 92 10:30:34 GMT
- References: <1992Nov5.211723.26238@bnlux1.bnl.gov>
- Sender: news@infodev.cam.ac.uk (USENET news)
- Organization: Department of Pure Mathematics, University of Cambridge
- Lines: 36
- Nntp-Posting-Host: emu.pmms.cam.ac.uk
-
- In article <1992Nov5.211723.26238@bnlux1.bnl.gov> murphy@sscdaq.phy.bnl.gov (Michael Murphy) writes:
- >
- >I am trying to compute uniformly random noise inside a d-dimensional
- >sphere. I have identified two ways of doing so:
- >
- [...]
- >
- >(2) A faster, although perhaps wrong approach is:
- > 1. Choose an arbitrary d-vector
- > 2. Normalize it so it is a point on the d-dimensional sphere
- > 3. Multiply this normalized vector by a random number in [0,1]
- > raised to the 1/dth power.
- >
- >I believe that method two works. However, when I project a large number of
- >points in a high dimensional space (e.g. 25) onto the plane (by ignoring all
- >but two coordinates), I get something that resembles a square. My advisor
- >is not so sure that this is correct and I can only give an intuitive
- >argument as to why it may be true.
-
- What do you mean by "an arbitrary d-vector"? If you are choosing it
- so that the components are, say, uniform on [-1,+1]; i.e. uniformly
- in the hypercube, then you are not choosing the random direction
- uniformly, i.e. point on the curface of the hypersphere uniformly:
- there will be more vectors pointing towards a corner of the hypercube.
-
- Try this.
- Let V(r,d) be the volume of the d-dimensional hypersphere of radius r.
-
- Procedure to pick a random vector (x_1,...x_d) in the d-dimensional
- hypersphere of radius r.
- 1. Pick x_d in [-r,+r] by choosing an element from the distribution
- with density V(x,d-1)/V(r,d) dx at x.
- 2. Recursively generate (x_1,...,x_d-1) in the (d-1)-dimensional
- hypersphere of radius sqrt(r^2 - x^d^2).
-
- Richard Pinch
-