SECTION 09 / 10

Gaussian random projections and scaling

7 min read
On this page 8 headings

Learning goal: Derive why a Gaussian projection is divided by k\sqrt{k}.

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 ∥u∥2\|u\|^{2}

  • 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 = . ✓
Histogram of random dot products matching a normal curve with variance 25
Simulation: u in 1,000 dimensions with ‖u‖² = 25, and 20,000 random rows r. The dot products have mean 0.05 and variance 25.09, matching N(0, 25).

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.
Distribution of the length ratio for k = 10, 100, 1000
Distribution of . All three are centred at 1 (unbiased), but only large k keeps it inside the ±10 % band. Chance of landing in the band: 17 % (k = 10), 52 % (k = 100), 97.5 % (k = 1,000).

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 k\sqrt{k} preserves squared length in expectation.
  • An unbiased estimate can still have a large error in one run.
YOUR STUDY PROGRESS

Finished this section? Save your progress.

Back to top ↑