SECTION 09 / 10
Gaussian random projections and scaling
On this page 8 headings
Learning goal: Derive why a Gaussian projection is divided by .
Conditions to check
- Unbiasedness means that the expected squared projected length is correct.
- It does not guarantee that one random projection is accurate.
- The input vector has dimension d; the projection has dimension k.
- The ideaFill a matrix with random numbers from the bell curve and multiply your vector by it.
- Each output number is a random "measurement" of your vector.
- Individually they look like noise, but their spread is exactly the vector's squared length.
- So by measuring how spread out the k outputs are, you can estimate the length.
- More outputs give a better estimate.
- Key statementGoal: approximate isometry for pairwise distances of any n points in .
- Write R by rows:
- So we generate R by drawing all k × d entries independently from the standard normal.
- Then we fix R and apply it to the data.
- Because R is random, where u lands in is random too.
Step 1: the average of one output is 0
- Look at the first output, .
- Here u is fixed and the are random.
- The tool is linearity of expectation, with pulled out as a fixed number.
- Intuition: a random direction is equally likely to point "with" u as "against" it, so the dot products cancel on average.
Step 2: the variance of one output is
- Since the mean is 0, .
- Square the sum.
- As in , you get squares plus cross terms:
Take expectations term by term:
- Cross terms vanish: and are independent, so .
- Square terms: .
Since a weighted sum of independent normals is normal (Toolkit 0.5), we get more than mean and variance; we get the whole distribution:
and these k numbers are independent of each other, since they use different rows of R.
Worked example: 2-D check
- u = (3, 4), so ‖u‖² = 25.
- Then with independent N(0,1).
- Variance = . ✓
Step 3: turn it into an estimation problem
- Now forget it's a vector.
- We have k independent observations from , where the unknown variance is .
- The best guess (MLE with known mean 0, Toolkit 0.9) is
- The right-hand side is exactly the squared length of the vector whose entries are .
- So define the transformation
The squared length after projection estimates the original squared length. That is the whole trick: the √k scaling turns "estimate the variance" into "measure the length".
Worked example: a tiny projection by hand
- d = 4, k = 2, u = (1, 2, 2, 4), so ‖u‖² = 25.
- Suppose the random draws gave
- , so .
- That is far from 25.
- This motivates the accuracy analysis: with only k = 2 observations the estimate is very noisy.
- Repeating with fresh random R (one simulated run for each k) gave estimates of 1.3 (k = 2), 15.7 (k = 10), 33.5 (k = 100), 25.8 (k = 1,000) and 24.7 (k = 10,000).
- Small k can be wildly off, even k = 100 missed by about a third in this run, and large k settles near 25.
Check yourself
Why do we divide R by √k and not by k?
- The estimate is .
- Putting inside each term and squaring gives .
- So dividing the matrix by √k makes the squared length equal the average.
u = (1, 1, 1, 1). What distribution does have?
N(0, 4), since ‖u‖² = 4.
Key points to remember
- Each Gaussian row output has mean zero and variance equal to the input’s squared length.
- Dividing the matrix by preserves squared length in expectation.
- An unbiased estimate can still have a large error in one run.
