Take the 2-minute tour ×

I have two vectors $a$, $b$ each containing $10$ random numbers from the standard normal distributions. I want to generate another vector $C$ of $10$ numbers from the standard distribution where $\mathbb{E}(a\cdot C)=\mathbb{E}(b\cdot C)=0$ (orthogonal), where $\mathbb{E}$ is the expectation.

share|improve this question
For two vectors to be orthogonal you require their inner product <x, y> to be zero. Is that what you want? So you want their Covariance rather than their Expectation to be 0? (I am just trying to undestand your question here). –  usεr11852 Jan 20 '13 at 0:18
Yes, you are right. I have read in a paper I can regress C based on A,B and normalize the residuals. But I could not do it myself (specially when A,B are matrices rather than vectors.) –  remo Jan 20 '13 at 4:25
Welcome to our site, Remo! I have used $\TeX$ markup to make your notation a little more readable. While doing that I noticed what appeared to be a typographical error and changed $\mathbb{E}(a\cdot b)$ to $\mathbb{E}(a\cdot C)$, understanding your question to be about generating a random vector $C$ whose expectation is orthogonal to two given vectors $a$ and $b$. If that is incorrect, please make any necessary changes to the question. –  whuber Jan 20 '13 at 11:05
@whuber I also think this is $E(\langle a, C\rangle)$. But $E(\langle a, C\rangle) = \langle a, E(C)\rangle$; this nothing but a linear constraint on the $E(C_i)$'s, hence the question is strange because it seemes to require a standard normal distribution for $C$. –  Stéphane Laurent Jan 20 '13 at 11:24
@whuber Finally the question which makes more sense is $\langle a, C\rangle = 0$ a.s. –  Stéphane Laurent Jan 20 '13 at 13:19

1 Answer 1

First we must generate C from standard normal dist, then compute the residuals from regress (C, [1_n A B]). Finally we must normalize the residuals * multiply it to sqrt(1-corr(A,B)^2/std(A)). You can see the paper by Krishnamurty Muralidhar in TDP 2008.

share|improve this answer
If you do this then you get $\sum c_i =0$. No ? –  Stéphane Laurent Jan 20 '13 at 9:49
In addition to what @Stéphane wrote, it seems to me that this answer is too strong: it generates a $C$ that is surely orthogonal to both $a$ and $b$ (not just orthogonal in expectation). –  whuber Jan 20 '13 at 11:07
Yes, the mean is zero and std is 1. It is orthogonal to both A and B. Thank you for your help. –  remo Jan 20 '13 at 13:51

Your Answer


