Let
For $k, n \in \mathbb{N}$, let $\mathcal{C}_n \mathbb{R}^2$ mathbb{R}^k$ denote the configuration space of $n$ distinct points in $\mathbb{R}^k$.
Equipping $\mathbb{R}^2$ \mathbb{R}^k$ with the usual metric, define the a regression line $l_C$ of a collection $C \in \mathcal{C}_n \mathbb{R}^2$ to be the 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^2 M^k \rightarrow \mathbb{R}$ where $M^2$ M^k$ is the parameter space of all lines in $\mathbb{R}^2$.
What can we say about the map $\mathcal{C}_n \mathbb{R}^2 \rightarrow M^2$ given by $C \mapsto l_C$? \mathbb{R}^k$.
Given $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}^2$, 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). Is there some top-down way to see the existence of this $\theta$? (sorry, my Morse theory gland is firing.)
Using the one-point compactification $\mathbb{R}^2 \hookrightarrow S^2$, we can identify $M^2$ with the set of all loops based at $\infty \in S^2$ that are isometric to circles of some radius. Is there some more satisfying way to characterize this class of loops in $S^2$?direction.]

