Least-squares regression and differential geometry For $k, n \in \mathbb{N}$, let $\mathcal{C}_n \mathbb{R}^k$ denote the configuration space of $n$ distinct points in $\mathbb{R}^k$.  


*

*(1) Is there a description of the tangent space $T_C \mathcal{C}_n \mathbb{R}^k$ in terms of the configuration $C$?


Equipping $\mathbb{R}^k$ with the usual metric, a regression line $l_C$ of a collection $C \in \mathcal{C}_n \mathbb{R}^k$ is a line minimizing the quantity $E_C = \sum\limits_{p \in C} d(p, l_C)^2.$  We can see this as variational problem $E_C: M^k \rightarrow \mathbb{R}$ where $M^k$ is the parameter space of all lines in $\mathbb{R}^k$.  


*

*(2) Is there an explicit parametrization of $M^k$? 


Without this knowledge, I'm not sure how to proceed to check whether $E_C$ is a Morse function.
[Note for $k=2$: given $C \in \mathcal{C}_n \mathbb{R}^k$, since $n<\infty$ we can always find an angle $\theta$ such that a rotation of our axes by $\theta$ yields coordinates $(x,y)$ on $\mathbb{R}^2$ for which the $x$-values of the $p \in C$ are all distinct, bringing us back to function-fitting and the usual least-squares regression which minimizes only the distances in the $y$ direction.]
 A: By calculus, the line $l_C$ is 'the' major axis of the ellipse of inertia of the finite point set $C$.  (The reason for the quotes around 'the' in the previous sentence is that, if the ellipse of inertia is a circle, then $l_C$ is not well-defined; any line through the center of mass will minimize $E_C$.)  I'm not sure what more 'intuitive' description you want, especially given that the map is not well-defined everywhere.  (It is easy to see that you couldn't get a unique line in every case.  For example, take the 3 vertices of an equilateral triangle.)
What you are asking for in the second part is just finding a direction so that orthogonal projection onto a line in that direction won't send any two of the points to the same point.  To do this, it suffices to note that the vectors joining pairs are a finite set of directions, so you just choose a direction that is not orthogonal to any of those directions and you are done.
Finally, I don't see that going to the 1-point compactification of the plane is going to be useful in this problem, so asking about describing the lines as circles on the 2-sphere doesn't seem to be germane.  
Added later:  After this response, Alexander changed the question from one about lines in the plane ($k=2$) to lines in $\mathbb{R}^k$.  The question about whether $E_C$ is a Morse function on $M^k$ in general has the answer 'no' when the ellipsoid of inertia of $C$ does not have $k$ distinct eigen-axes and 'yes' when it does.  (The critical points are on the $(k{-}1)$-sphere of lines through the center of mass of $C$.)
Since $\mathcal{C}_n\mathbb{R}^k$ is an isometric $S_n$-quotient of an open subset of the product of $\mathbb{R}^k$ with itself $n$ times, the usual description of the tangent space applies, so there's nothing more to say about that, I guess.
As for $M_k$, the space of lines in $\mathbb{R^k}$ this can be described by starting with the double cover $\tilde M_k$ consisting of the oriented lines in $\mathbb{R}^k$.  This latter space is essentially the tangent bundle of $S^{k-1}$, which consists of pairs $(u,v)$ with $u\in S^{k-1}$ and $v\in\mathbb{R}^k$ satisfying $u\cdot v = 0$.  The idea is that $u$ is the direction of the line and $v$ is its point of closest approach to the origin.  Thus, the line is parametrized in the form $v + t u$.  Now, to get $M_k$, you divide by the relation $(u,v)\simeq (-u,v)$.
