Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
N-sphere
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Probability distributions == === Uniformly at random on the {{math|(''n'' − 1)}}-sphere === [[File:2sphere-uniform.png|thumbnail|A set of points drawn from a uniform distribution on the surface of a unit {{math|2}}-sphere, generated using Marsaglia's algorithm.]] To generate uniformly distributed random points on the unit {{tmath|(n-1)}}-sphere (that is, the surface of the unit {{tmath|n}}-ball), {{harvtxt|Marsaglia|1972}} gives the following algorithm. Generate an {{tmath|n}}-dimensional vector of [[normal distribution|normal deviates]] (it suffices to use {{tmath|N(0, 1)}}, although in fact the choice of the variance is arbitrary), {{tmath|\mathbf x {{=}} (x_1, x_2, \ldots, x_n)}}. Now calculate the "radius" of this point: :<math>r=\sqrt{x_1^2+x_2^2+\cdots+x_n^2}.</math> The vector {{tmath|\tfrac 1r \mathbf x}} is uniformly distributed over the surface of the unit {{tmath|n}}-ball. An alternative given by Marsaglia is to uniformly randomly select a point {{tmath|\mathbf x {{=}} (x_1, x_2, \ldots, x_n)}} in the unit [[hypercube|{{mvar|n}}-cube]] by sampling each {{tmath|x_i}} independently from the [[continuous uniform distribution|uniform distribution]] over {{tmath|(-1, 1)}}, computing {{tmath|r}} as above, and rejecting the point and resampling if {{tmath|r \geq 1}} (i.e., if the point is not in the {{tmath|n}}-ball), and when a point in the ball is obtained scaling it up to the spherical surface by the factor {{tmath|\tfrac 1r }}; then again {{tmath|\tfrac 1r \mathbf x}} is uniformly distributed over the surface of the unit {{tmath|n}}-ball. This method becomes very inefficient for higher dimensions, as a vanishingly small fraction of the [[unit cube]] is contained in the sphere. In ten dimensions, less than 2% of the cube is filled by the sphere, so that typically more than 50 attempts will be needed. In seventy dimensions, less than <math>10^{-24}</math> of the cube is filled, meaning typically a trillion quadrillion trials will be needed, far more than a computer could ever carry out. === Uniformly at random within the ''n''-ball === With a point selected uniformly at random from the surface of the unit {{tmath|(n-1)}}-sphere (e.g., by using Marsaglia's algorithm), one needs only a radius to obtain a point uniformly at random from within the unit {{tmath|n}}-ball. If {{tmath|u}} is a number generated uniformly at random from the interval {{tmath|[0, 1]}} and {{tmath|\mathbf x}} is a point selected uniformly at random from the unit {{tmath|(n-1)}}-sphere, then {{tmath|u^{1/n} \mathbf x}} is uniformly distributed within the unit {{tmath|n}}-ball. Alternatively, points may be sampled uniformly from within the unit {{tmath|n}}-ball by a reduction from the unit {{tmath|(n+1)}}-sphere. In particular, if {{tmath|(x_1, x_2, \ldots, x_{n+2})}} is a point selected uniformly from the unit {{tmath|(n+1)}}-sphere, then {{tmath|(x_1, x_2, \ldots, x_n)}} is uniformly distributed within the unit {{tmath|n}}-ball (i.e., by simply discarding two coordinates).<ref>{{cite report|first1=Aaron R. | last1=Voelker | first2=Jan | last2=Gosmann | first3=Terrence C. | last3=Stewart | title=Efficiently sampling vectors and coordinates from the n-sphere and n-ball | year=2017 | publisher=Centre for Theoretical Neuroscience | url=http://compneuro.uwaterloo.ca/publications/voelker2017.html | doi=10.13140/RG.2.2.15829.01767/1}}</ref> If {{tmath|n}} is sufficiently large, most of the volume of the {{tmath|n}}-ball will be contained in the region very close to its surface, so a point selected from that volume will also probably be close to the surface. This is one of the phenomena leading to the so-called [[curse of dimensionality]] that arises in some numerical and other applications. === Distribution of the first coordinate === Let {{tmath|y {{=}} x_1^2 }} be the square of the first coordinate of a point sampled uniformly at random from the {{tmath|(n-1)}}-sphere, then its probability density function, for <math>y\in [0, 1]</math>, is <math display="block"> \rho(y) = \frac{\Gamma\bigl(\frac{n}{2} \bigr)}{\sqrt\pi \; \Gamma\bigl(\frac{n-1}{2}\bigr)} (1-y)^{(n-3)/2}y^{-1/2}. </math> Let <math>z = y/N</math> be the appropriately scaled version, then at the <math>N\to \infty</math> limit, the probability density function of <math>z</math> converges to <math> (2\pi ze^z)^{-1/2}</math>. This is sometimes called the Porter–Thomas distribution.<ref>{{Citation |last=Livan |first=Giacomo |title=One Pager on Eigenvectors |date=2018 |url=https://doi.org/10.1007/978-3-319-70885-0_9 |work=Introduction to Random Matrices: Theory and Practice |pages=65–66 |editor-last=Livan |editor-first=Giacomo |access-date=2023-05-19 |series=SpringerBriefs in Mathematical Physics |place=Cham |publisher=Springer International Publishing |language=en |doi=10.1007/978-3-319-70885-0_9 |isbn=978-3-319-70885-0 |last2=Novaes |first2=Marcel |last3=Vivo |first3=Pierpaolo |editor2-last=Novaes |editor2-first=Marcel |editor3-last=Vivo |editor3-first=Pierpaolo}}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
N-sphere
(section)
Add topic