wow! This notebook entry is now 10 years old. I have cared about this for ages.
Random variables with radial symmetry; It would be appropriate to define these circularly, so I will, which is to say, (centred) isotropic random vectors are those whose distribution is unchanged under fixed rotations, or random rotations. Generating such variables. Distributions thereof.
In particular, I consider fun tricks with isotropic Gaussians, RVs uniform on the
To begin, consider
1 Simulating isotropic vectors
Let’s say you wish to simulate a random variable,
The simplest way I know of generating such vectors is to take
That is,
By the rotational invariance of multivariate Gaussian distributions, we know that this must be isotropic.
Update: Martin Roberts collects a bumper list, How to generate uniformly random points on n-spheres and in n-balls. There are some surprising ones.
1.1 On the -sphere
Now, to get unit vectors we can simply normalize
(And if you use the “hit-and-run” Monte Carlo sampler, this is your daily bread.)
1.2 On the -ball
David K observes the obvious way to generate Lebesgue-uniform vectors on the
Bonus time: In fact, we can do more than just
2 Marginal distributions
Question: what is the marginal distribution of the axial component
Let us consider, w.l.o.g.,
Define
Now, the R.H.S. has an
Now we can construct the pdf of
Then we splice two symmetric copies of the function about the axis —
Here’s a plot of the behaviour of our distribution:
Notice that axial components tend to be long in
And here’s the R code to generate the graph, most of which is plotting logic.
half.quantile <- function(x,d=3) {
g <- qf(x,d-1,1)
return(1/sqrt(g*(d-1)+1))
}
full_quantile <- function (x, d=3) {
x.scaled <- 2*x -1
res <- sign(x.scaled)*half.quantile(1-abs(x.scaled), d)
return(res)
}
pts <- seq(0,1,1/512)
dims <- seq(2,10)
ndims <- length(dims)
vals <- data.frame(outer(pts, dims, full.quantile))
dimnames <- paste(dims)
xrange <- c(0,1)
yrange <- c(-1,1)
library(RColorBrewer)
colors <- brewer.pal(ndims,"Spectral")
# set up the plot
plot(xrange, yrange, type="l", xlab="x",
ylab="quantile")
# add lines
for (i in seq(ndims)) {
dim <- vals[,i]
lines(pts, dim, type="l", lwd=2,
col=colors[i],
lty=1
)
}
# add a legend
legend(xrange[1], yrange[2], dims, cex=0.8, col=colors,
lty=1, title="Dimension")
There are many interesting approximate distributions for these quantities, which are explored in the low-d projections notebook.
3 Inner products
There is an exact distribution for inner products of normalized vectors. Suppose that
4 Moments
Kimchi lover derives the variance of
See also Covariance matrix of uniform spherical distribution wherein a very simple symmetry argument gives
5 Archimedes Principles
First mention: The first
Djalil Chafaï mentions the Archimedes principle which
… states that the projection of the uniform law of the unit sphere of
on a diameter is the uniform law on the diameter. It is the case of the Funk-Hecke formula…. More generally, if is a random vector of uniformly distributed on the unit sphere then is uniformly distributed on the unit ball of . It does not work if we replace by .
6 Funk-Hecke
Djalil Chafaï introduces the The Funk-Hecke formula:
In its basic form, the Funk-Hecke formula states that for all bounded measurable
and all , The formula does not depend on , an invariance due to spherical symmetry.…
If this is an inner product with a sphere RV then we get the density for a univariate random projection.