TITLE: How to make two vectors orthogonal?
QUESTION [5 upvotes]: 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?
EDIT:
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?

REPLY [2 votes]: 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.