Given the equation and subspace $x_1 + x_2 + \cdots + x_n =C$ in $\mathbb{R}^n$ and a vector $v \in \mathbb{R}^n$. How would you find the projection of this vector $v$ on the subspace $x_1 + x_2 + \cdots + x_n =C$?
Asked
Active
Viewed 141 times
0
2 Answers
1
Note that the normal to the plane is $n=(1,...,1)^T$. The plane is defined by the set of points $p$ satisfying $n^T p = C$.
Compute $t$ such that $v+tn$ lies in the plane, that is $n^T (v+tn) = C$, or $t= {C-n^Tv \over \|n\|^2}$. Let $p = v+tn$.
Suppose $p'$ is any other point in the plane, then $\|v-p'\|^2 = \|v-p\|^2 + \|p-p'\|^2$ since $n^T (p-p') = 0$.
Hence $p$ is the closest point on the plane to $v$.
copper.hat
- 178,207
-
I think I'm doing something wrong. Say we have the plane $x +y + z = 3$. Then the normal is $(1, 1, 1)^T$. We then calculate $t = \frac{9}{3}$. Plugging in $t = 3$ into the equation does not give the correct result and I can't figure out why. I do see that the solution is $t = -2$, which gets us the the correct answer when plugged in. – wednesdaymiko Jan 15 '22 at 00:30
-
Thanks for the help so far. Been tackling this all day, lmk if you know what I'm doing wrong if you could provide an example. Otherwise, have a good day/night. – wednesdaymiko Jan 15 '22 at 01:11
-
What do you mean setting $t$ as above does not give the right result? What point are you trying to project? – copper.hat Jan 15 '22 at 01:27
-
-
-
My formula for $t$ was missing a $C$, see above. For your numbers I get $t=-2$ and the projection is $(0,1,2)^T$. – copper.hat Jan 15 '22 at 01:53
0
- Rewrite this subspace into the form $\lbrace Ax+y: x \in \mathbb{R}^{n-1} \rbrace$ for appropriate matrix $A \in \mathbb{R}^{n \times (n-1)}$ and vector $y \in \mathbb{R}^n$. You do this by observing that all of the subspaces elements are of the form $$ \begin{pmatrix} -x_2-x_3-\dots -x_n + c \\ x_2 \\ x_3 \\ \vdots \\ x_n \end{pmatrix} = x_2\begin{pmatrix} -1 \\ 1\\ 0 \\ \vdots\\ \\0 \end{pmatrix} + x_3 \begin{pmatrix} -1 \\ 0\\ 1 \\ \vdots\\ \\0 \end{pmatrix} + \dots + x_n \begin{pmatrix} -1 \\ 0\\ 0 \\ \vdots\\ \\1 \end{pmatrix} + \begin{pmatrix} c \\ 0\\ 0 \\ \vdots\\ \\0 \end{pmatrix}. $$ I am sure that you can see the pattern.
- The projection is an optimization problem $$ \min_{x \in \mathbb{R}^{n-1}}\lVert v-Ax-y \rVert^2_2. $$ You can check the optimality conditions but the solution is $$ x=\left(A^\top A\right)^{-1} (A^\top v - A^\top b). $$
- The vector $x=(x_2, ..., x_n)$ gives you the values for every coefficient but $x_1$. That you can find out by substituting those into the equation $$ x_1 + x_2 + \dots + x_n = C. $$
Yes, you can just check at which point the perpendicular vector $(1, 1, \dots, 1)$ enters the plane. But I chose the above reasoning because it can also be applied when the perpendicular vector is not known.
Hyperbolic PDE friend
- 6,919
If that's the case, when you then subtract the normal vector from the vector we want to project, do you then get the correct projection?
– wednesdaymiko Jan 14 '22 at 22:35