Line of best fit on the surface of a sphere How would you calculate the line of best fit on the surface of a sphere for a set of points on the surface of that sphere? Specifically I'm looking to find the ideal location for an orbital ring around earth based on the distribution of the population. Thanks :)
 A: Ooh that is an interesting question! I like that one...A interesting application of differential geometry and statistics together.
Well I suppose before you move anywhere the whole concept of the Line of "Best Fit" is $\textbf{entirely}$ dependent on minimizing some definition of 'distance' between the points and the line of best fit. This will be difficult to do without understanding "Distance" on surfaces such as a sphere.
On surfaces in general, distance is measured by a "Metric Tensor". This...in its most basic definition, is a Matrix which allows you to measure distances on a surface. It is also the special object which allows you to extend the idea of "distances" and measure a "2-dimensional distance" which we refer to simply as "Area" :) This matrix is entirely unique and determined by the definition of the surface. In the case of the Sphere, its metric tensor is represented in matrix form as:
$$S_{\alpha\beta}=\left[\begin{matrix}R^2 & 0 \\ 0 & R^2\sin^2\theta\end{matrix}\right]$$
Now how does this come into importance? Well in describing lines on a surface, we use a vector function defined as $\vec{r}(t)$. Now this vector function will depend on components as ever vector usually does. Which means it will need a BASIS. We usually use the surface's basis to accomplish this:
$$\vec{r}(t)=r^\alpha(t)\textbf{S}_\alpha=r^\theta(t)\hat{\theta}+r^\phi(t)\hat{\phi}$$
Now using the metric when we know the distance is measured in the following method:
$$D=R\int\sqrt{\left(\frac{dr^\theta}{dt}\right)^2+\left(\frac{dr^\phi}{dt}\right)^2\sin^2(r^\theta(t))}dt$$
So using this, we can measure several types of distance on the sphere. But we need to determine which kind of distance we want to adapt to our line of best fit. This is totally up to you. When usually determining this on a cartesian graph of a line, we choose to use the y-height difference of the points to the line and minimize accordingly. Consider the fact that we could also define the distance to be minimized along the x-distance difference or some combination of the two! This is totally up to you and may produce different lines slightly! However To keep things simple, I think we will choose to minimize the distance between your points and the line along one of the angles used to defined the sphere...maybe the $\phi$ angle. Once you determine the points on the sphere and determine its $\phi$ distance from the line, you minimize the function and the result will be your line of best fit!
Kinda tricky but its not a simple issue! And fascinating when you consider other more general surfaces than a sphere! And the cool thing is the approach of determining the metric of the surface is the same for the general surface! :) Good luck
