5 ms·
> We shouldn't round off internally because we might use it in as an intermediate result in a calculation. Only if the precision is meaningful. The author's p
by vonmoltke 7y ago
> We shouldn't round off internally because we might use it in as an intermediate result in a calculation.
Only if the precision is meaningful. The author's point is that it isn't for geographical coordinates.
- whatshisface 7y agoError tends to grow as the calculation proceeds. 6th-decimal "insignificant rounding" done over and over as the calculation proceeds can grow to become arbitrarily large.
- Luc 7y agoWhich calculation on lat/lon coordinates would make an atom-scale error grow, say, a million times to millimeter-size?
- Majromax 7y agoWhat numerically unstable algorithms are ever performed with geolocations? Moreover, given the author's point that real measurement errors exceed the false precision of published data, if such a calculation were performed and did provide "arbitrarily large" error, it would indicate that the result should in fact be nonsense.
- whatshisface 7y agoI'm thinking about the case where a calculation extends across many roundings.
- Majromax 7y agoThat doesn't necessarily make the algorithm unstable. See for example: >>> import numpy as np >>> x0 = np.random.rand(1) >>> x_rnd = np.round(100*x)/100.0 >>> for i in range(1000): ... x = np.mod(x+np.pi,1) ... x_rnd = np.mod(x_rnd + np.pi,1) ... x_rnd = np.round(100*x)/100 ... >>> x_real = np.mod(x0+1000*np.pi,1) >>> print(x_real,x,x_rnd) (array([0.51013166]), array([0.51013166]), array([0.51])) Note no loss of accuracy for all of the intermediate roundings. The accuracy is preserved because there's no mechanism here to amplify the error. That's why I ask about the kind of algorithms typically applied to geolocated data. Off the top of my head, I can't think of anything that would be both useful and error-amplifying.
- jhayward 7y agoVincenty's formula has some instabilities/failure to converge at certain areas of the globe. [1] https://en.wikipedia.org/wiki/Vincenty%27s_formulae https://en.wikipedia.org/wiki/Vincenty%27s_formulae
- caf 7y agoIf you're doing calculations with geographical co-ordinates that are so unstable that a nanometre position difference in the original makes an arbitrarily large difference in the result, your results aren't sensible anyway.