A small note, but GPS is only well-approximated by a circular uncertainty in specific conditions, usually open sky and long-time fixes. The full uncertainty model is much more complicated, hence the profusion of ways to measure error. This becomes important in many of the same situations that would lead you to stop treating the fix as a point location in the first place. To give a concrete example, autonomous vehicles will encounter situations where localization uncertainty is dominated by non-circular multipath effects.
If you go down this road far enough you eventually end up reinventing particle filters and similar.
mikepurvis · 26m ago
Vehicle GPS is usually augmented by a lot of additional sensors and assumptions, notably the speedometer, compass, and knowledge the you'll be on one of the roads marked on its map. Not to mention a fast fix because you can assume you haven't changed position since you last powered on.
8note · 15m ago
for mechanical engineering drawings to communicate with machinists and the like, we use tolerances
eg. 10cm +8mm/-3mm
for what the acceptable range is, both bigger and smaller.
id expect something like "are we there yet" referencing GPS should understand the direction of the error and what directions of uncertainty are better or worse
layer8 · 1h ago
Arguably Uncertain should be the default, and you should have to annotate a type as certain T when you are really certain. ;)
nine_k · 5m ago
Only for physical measurements. For things like money, you should be pretty certain, often down to exact fractional cents.
It appears that a similar approach is implemented in some modern Fortran libraries.
esafak · 36m ago
A complement to Optional.
boscillator · 1h ago
Does this handle covariance between different variables? For example, the location of the object your measuring your distance to presumably also has some error in it's position, which may be correlated with your position (if, for example, if it comes from another GPS operating at a similar time).
Certainly a univarient model in the type system could be useful, but it would be extra powerful (and more correct) if it could handle covariance.
Always enjoy mattt’s work. Looks like a great library.
krukah · 44m ago
Monads are really undefeated. This particular application feels to me akin to wavefunction evolution? Density matrices as probability monads over Hilbert space, with unitary evolution as bind, measurement/collapse as pure/return. I guess everything just seems to rhyme under a category theory lens.
It was chosen to be implemented as a generic type in this design because the way that uncertainty "pollutes" underlying values maps well onto monads which were expressed through generics in this case.
frizlab · 1h ago
> And why does it need to be part of the type system?
As presented in the article, it is indeed just a library.
geocar · 1h ago
> What if I want Bayesian?
Bayes is mentioned on page 46.
> And why does it need to be part of the type system? It could be just a library.
It is a library that defines a type.
It is not a new type system, or an extension to any particularly complicated type system.
If you go down this road far enough you eventually end up reinventing particle filters and similar.
eg. 10cm +8mm/-3mm
for what the acceptable range is, both bigger and smaller.
id expect something like "are we there yet" referencing GPS should understand the direction of the error and what directions of uncertainty are better or worse
It appears that a similar approach is implemented in some modern Fortran libraries.
Certainly a univarient model in the type system could be useful, but it would be extra powerful (and more correct) if it could handle covariance.
https://en.wikipedia.org/wiki/Fuzzy_logic
As presented in the article, it is indeed just a library.
Bayes is mentioned on page 46.
> And why does it need to be part of the type system? It could be just a library.
It is a library that defines a type.
It is not a new type system, or an extension to any particularly complicated type system.
> Am I missing something?
Did you read it?
https://www.microsoft.com/en-us/research/wp-content/uploads/...
https://github.com/klipto/Uncertainty/
Bayes isn't mentioned in the linked article. But thanks for the links.
It's not part of the type system, it's just the giry monad as a library.