Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

From my question on CV, I need to find a way to make my two vectors orthogonal. They are:

$${\bf{v}} = \pmatrix{1 \\ 1 \\ 1 \\ 1 \\ 1 } \hspace{1.5cm} {\bf{w}} = \pmatrix{0.25 \\ 0.0625 \\ 0 \\ 0.0625 \\ 0.25}$$

What I (think) I need is the step that makes these two vectors orthogonal and I think that will give me my orthogonal regression model.

But how do I do this? It's not Gram-Schmidt is it?


1) Fixed spelling of Gram-Schmidt thanks to the comment.

2) Basically, for my regression model to be orthogonal, I need all the sum of all the linear terms to be 0 and the sum of all the quadratic terms to be 0. The vector ${\bf{w}}$ is all the $x_i^2$ terms in matrix form. What I need is effectively the dot product of ${\bf{v \cdot w' }} = 0$, where ${\bf{w'}}$ is basically ${\bf{w}}$ transformed in some way such that the sum of all these new terms equal $0$. Does that make sense?

share|cite|improve this question
Do you want two orthogonal vectors which form a basis of the subspace generated by the two you have given? – Mark Bennet Jan 11 '13 at 22:36
@Mark Bennet No, I want the step that makes these two vectors orthogonal, if that either a) makes sense, or b) is possible. – Kaish Jan 11 '13 at 22:38

I'm pretty sure you are looking for Gram-Schmidt.

Let ${\bf v_1 } \equiv {\bf v }$ and ${\bf v_2 } \equiv {\bf w } - (\frac{{\bf v } \cdot {\bf w}}{\bf v \cdot v}) {\bf v}$ if you only want them to be orthogonal to each other.

Note evaluating ${\bf v_1} \cdot {\bf v_2} = {\bf v} \cdot {\bf w} - \frac{{\bf v} \cdot {\bf w}}{{\bf v} \cdot {\bf v}} ({\bf v} \cdot {\bf v}) = 0$. Any vector you could get with $a {\bf v} + b {\bf w}$ for some scalars $a$ and $b$, you can reach with $\alpha {\bf v_1} + \beta {\bf v_2}$ for some scalar $\alpha$ and $\beta$.

Again if two vectors aren't initially orthogonal, you can't do any rotation or change of basis to make them not orthogonal (as orthogonality is independent of choice of basis). You have to fundamentally change the vectors.

share|cite|improve this answer
Oh wait, I don't think my question will work then will it? Because it will give me the vector that is orthogonal to ${\bf{v}}$ but not in the form that I need it to put it in my regression model. My model basically has to have some $\sum (x_i^2 + Ax_i + B) = 0$ and I want to work out this $A, B$. – Kaish Jan 11 '13 at 22:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.