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.
Using this sampling-based approach you get correct covariance modeling for free. You have to only sample leaf values that are used in multiple places once per evaluation, but it looks like they do just that: https://github.com/mattt/Uncertain/blob/962d4cc802a2b179685d...
I've been wondering for a while if a program could "learn" covariance somehow. Through real-world usage.
Otherwise, it feels to me that it'd be consistently wrong to model the variables as independent. And any program of notable size is gonna be far too big to consider correlations between all the variables.
As for how one might do the learning, I don't know yet!
If you need to track covariance you might want to play with gvar https://gvar.readthedocs.io/en/latest/ in python.
To properly model quantum mechanics, you’d have to associate a complex-valued wave function with any set of entangled variables you might have.