(This is related to this question)
$Q \in \mathbb{R}^{n\times k}$ is a random matrix where $k
[Q R] = qr(randn(n,k),0);
In other words, I just sampled a $\mathbb{R}^{n\times k}$ matrix from a standard gaussian, then did QR decomposition on it and assumed $Q$ is uniformly distributed in the space where $Q^TQ=I$. Joriki's answer and my simulations aligned so I assume there's nothing majorly wrong with how I obtained samples.
I have two questions (in order of importance)
- How does one prove that the $Q$ sampled as above is uniformly distributed in the space where $Q^TQ=I$?
- Are there more efficient methods of sampling orthogonal $Q$?