# Distance between two random vectors

I have two random vectors, $A$ and $B$ with each consisting of $n$ geographical co-ordinates $(x_1,y_1),(x_2,y_2)\dots (x_n,y_n)$ and $(\tilde{x}_1,\tilde{y}_1),(\tilde{x}_2,\tilde{y}_2)\dots (\tilde{x}_n,\tilde{y}_n)$, respectively. Suppose we have a given distribution; let $p_1,p_2,\dots,p_n$ be the probabilities associated with points in $A$ and $\tilde{p}_1,\tilde{p}_2,\dots,\tilde{p}_n$ be the respective probabilities for points in $B$.

My question is: What is the best way to find the distance between $A$ and $B$? I am looking for a distance measure which would give me zero value if co-ordinates in $A$ and $B$ are the same (appearing in any order) and it returns a large value when the co-ordinates in $A$ and $B$ are far apart. I considered using a covariance matrix but I don't get the intuition behind using that. In wikipedia, http://en.wikipedia.org/wiki/Statistical_distance, there are a lot of statistical measures listed. Can anybody help me with insights on how to choose a proper distance measure to suit the specifics of my problem?

• I do not see how the probabilities play a role in your question. Could you edit your question to explain where they come from and what you plan to do with it? – gui11aume Jul 27 '14 at 19:18
• Agreed with @gui11aume. Why don't you just consider the geodesic distance between the geodesic means? – Emre Jul 28 '14 at 7:27
• Hey Emre! Geodesic distance is fine but I have no idea how do you go about calculating the geodesic means? Any help is appreciated. – Samantha Hawking Jul 29 '14 at 19:01
• I don't know if there's closed form expression, but it's easy to find the distance between two points on a sphere, so you could use numerical optimization to find the answer in the worst case. For an initial value you could use the projection of the center of mass onto the surface. – Emre Jul 30 '14 at 8:20

The usual measure of distance is the euclidean distance, which in two dimensions gives:

$d(x_1, y_1, \tilde x_1, \tilde x_2) = \sqrt{(x_1 - \tilde x_1)^2 + (y_1 - \tilde y_1)^2}$

There are an infinity of other possible distance measures, but this one is the most "natural" one, in which the shortest path is the straight line, etc.

• Normally, geographic coordinates are given in latitude and longitude for which applying this Pythagorean formula is erroneous. In many, if not most, applications the most natural distance for geographic coordinates is the geodetic distance on a spheroidal or ellipsoidal model of the earth. Cartesian distances (based on the points as projected onto planar maps) are used primarily as convenient proxies for the geodetic distances. – whuber Jul 27 '14 at 20:10