Distance between two uncertain points using haversine?

  • Context: Graduate 
  • Thread starter Thread starter Frank Einstein
  • Start date Start date
  • Tags Tags
    Points Variance
Click For Summary

Discussion Overview

The discussion revolves around calculating the uncertainty in the distance between two points on the Earth's surface, represented in spherical coordinates, using the haversine formula. Participants explore how to incorporate the standard deviations of the latitude and longitude of these points into the distance calculation.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant presents the haversine formula for calculating distance and seeks guidance on how to determine the uncertainty of that distance given the standard deviations of the coordinates.
  • Another participant suggests that if there is a circle of uncertainty around each point, the uncertainty in distance could be approximated as twice the radius of the circle.
  • A different viewpoint emphasizes the complexity of deriving a closed form for the uncertainty due to the nonlinear nature of the distance function and suggests using Taylor series or variance approximation methods.
  • Some participants argue that standard error propagation methods could be applied using partial derivatives, while others express uncertainty about how to implement this with numerical values.
  • There is a discussion about the need to manually differentiate the distance function with respect to the coordinates and substitute the standard deviations and mean values to find the uncertainty.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the best method to calculate the uncertainty in distance. Some advocate for standard error propagation techniques, while others express skepticism about the feasibility of finding a closed form solution.

Contextual Notes

Participants mention the use of numerical values for standard deviations and mean positions, but the discussion highlights the challenges in applying theoretical methods to these specific values.

Who May Find This Useful

This discussion may be useful for individuals interested in error propagation in geospatial calculations, particularly those working with spherical coordinates and the haversine formula.

Frank Einstein
Messages
166
Reaction score
1
TL;DR
I have two points which represent geographical positions whose coordinates are given in spherical coordinates and also have an associated uncertainty. I can calculate the distance between said points in cartesian coordinates, but I don't know how to translate the uncertainty.
Hello everyone.

I have two points in space (on the surface of the earth) represented using spherical coordinates (in this case there is no z axis since both are assumed to be at the same height). These points have an associated standard deviation in lambda and in phi, which are longitude and latitude respectively. I can calculate the distance between the mean position of both points using the haversine asζ=sin^2[(φ1-φ2)/2]+cos(φ1)cos(φ2)sin^2[(λ1-λ2)/2] and thend=2*R*atan2(√ζ, √1-ζ) where R is the Earth radius and d is the distance in meters between the points defined by (λi,φi) where i=1,2.

However, I have no idea on how to find out the uncertainty of d. I have a standard deviation for the values of (λi,φi), I was wondering if someone can tell me how to incorporate this data to the haversine to be able to calculate the standard deviation of the distance d.

Can someone please tell me of a way to do this?

Any help is appreciated.
Regards.
Frank.
 
Physics news on Phys.org
What do you mean by uncertainty? If e.g. you have a circle of uncertainty around each point, then uncertainty of distance is plus, minus twice the radius of said circle.
 
fresh_42 said:
What do you mean by uncertainty? If e.g. you have a circle of uncertainty around each point, then uncertainty of distance is plus, minus twice the radius of said circle.
Thanks for the answer. I want to calculate the standard deviation of the variable d knowing the standard deviations of φ1, φ2, λ1 and λ2
 
So you have the random variable ##X=d(\varphi_1,\varphi_2,\lambda_1,\lambda_2 )## where the variables themselves are random variables, and the function is composed of many trigonometric functions. I don't think there is a reasonable closed form for this problem. So you can try to use the Taylor series for the trigonometric functions, which still will leave you with a complicated integral, or you abbreviate this step by the formula given in
https://en.wikipedia.org/wiki/Variance#Approximating_the_variance_of_a_function
or you use one of the formulas in here:
https://en.wikipedia.org/wiki/Distance_correlation

I think it is already difficult to calculate the mean value for the normal distribution function, which I assume is relevant here.
 
  • Like
Likes   Reactions: DaveE and Frank Einstein
fresh_42 said:
I think it is already difficult to calculate the mean value for the normal distribution function, which I assume is relevant here.

I don't see the difficulty here . This is standard propagation of error for nonlinear system. You just use the partial derivative.

https://en.wikipedia.org/wiki/Propagation_of_uncertainty

Am I missing something?
 
  • Like
Likes   Reactions: DaveE and fresh_42
fresh_42 said:
So you have the random variable ##X=d(\varphi_1,\varphi_2,\lambda_1,\lambda_2 )## where the variables themselves are random variables, and the function is composed of many trigonometric functions. I don't think there is a reasonable closed form for this problem. So you can try to use the Taylor series for the trigonometric functions, which still will leave you with a complicated integral, or you abbreviate this step by the formula given in
https://en.wikipedia.org/wiki/Variance#Approximating_the_variance_of_a_function
or you use one of the formulas in here:
https://en.wikipedia.org/wiki/Distance_correlation

I think it is already difficult to calculate the mean value for the normal distribution function, which I assume is relevant here.
Thanks again for the answer. That's what I feared, no closed loop form. I don't know if this is relevant, but I am working in Matlab, where I have calculated the aforementioned quantities as

[CODE lang="matlab" title="Distance calculation"]haversine_angle=(sin((phiMeanA-phiMeanB)/2)).^2+cos(lammdaMeanA).*cos(lammdaMeanB).*(sin((lammdaMeanA-lammdaMeanB)/2)).^2;
haversine_sqrt=(haversine_angle).^0.5;
haversine_sqrt2=1.-haversine_sqrt;haversine_mean_distance =RT.*atan2(haversine_sqrt, haversine_sqrt2);
[/CODE]
and the standard deviations are in different variables. The values of the standard deviations are

phiStdA=6.608673643811970e-08

phiStdB=7.548195779015499e-08

lambdaStdA= 7.757704741906700e-09

lambdaStdB=9.494186140546169e-09

and the values of the position of the mean of both points is

phiMeanA=0.879103498447014

phiMeanB=0.856643114991405

lammdaMeanA=0.007900824598177

lammdaMeanB=0.007461768949733

haversine_mean_distance=7.244901394376239e+04

RT=6378000
 
hutchphd said:
I don't see the difficulty here . This is standard propagation of error for nonlinear system. You just use the partial derivative.

https://en.wikipedia.org/wiki/Propagation_of_uncertainty

Am I missing something?
Probably I am the one missing something here. I don't know how to implement what you are providing since I only have numerical values as you can see in my previous message
 
hutchphd said:
Yes, but there is nothing in said page which explains how to find the standard deviation ong the distance d having the uncertainty of both points expressed in spherical coordiantes.
 
  • #10
Did you read the other page about errors propagation?
1612036873018.png
 
  • Like
Likes   Reactions: Frank Einstein
  • #11
hutchphd said:
Did you read the other page about errors propagation?View attachment 277152
So, if I understand you correctly, I have to manually derivate atan2(√ζ, √1-ζ) respect to φ and then respect to λ and then substitute the values in the point as
phiStdA=6.608673643811970e-08

phiStdB=7.548195779015499e-08

lambdaStdA= 7.757704741906700e-09

lambdaStdB=9.494186140546169e-09

and the values of the position of the mean of both points is

phiMeanA=0.879103498447014

phiMeanB=0.856643114991405

lammdaMeanA=0.007900824598177

lammdaMeanB=0.007461768949733

Is this it? I thought that I could not calculate that with at least two points to have a value of the derivative. I don't know what I was thinking.

Thanks.
Regards.
Frank.

Please, confirm me that I have the right idea.
 
  • #12
Yes you have to take the relevant derivatives and put in the numbers. I will leave the details to you for now. Give it a try.
 
  • Like
Likes   Reactions: Frank Einstein
  • #13
hutchphd said:
Yes you have to take the relevant derivatives and put in the numbers. I will leave the details to you for now. Give it a try.
Thanks.
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
4K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
8
Views
3K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K