Skip to content

Instantly share code, notes, and snippets.

@jsmorph
Last active May 13, 2018 18:47
Show Gist options
  • Save jsmorph/6ae71e41ec3b5f3909226a1d3b02b57b to your computer and use it in GitHub Desktop.
Save jsmorph/6ae71e41ec3b5f3909226a1d3b02b57b to your computer and use it in GitHub Desktop.
Uncertainty

Notes on representing and computing uncertainty

Approach

A simple approach that uses sampling from either probability distributions or approximations of distributions as input and output from deterministic functions.

Terminology

As examples, we'll consider observations and predictions. A prediction is computed from a set of observations. We'll work with observations and predictions of probability distributions of tuples .

A prediction function is a function from a set of observations to a prediction . This function doesn't take distributions as input, nor does it produce a distribution as output. This function for now is just a naive function from a set of tuples to a tuple.

An uncertain observation is a probability distribution . Same definition for an uncertain prediction.

Now generalize our prediction function to a function with an uncertain prediction as output (while still taking plain tuples as input): .

Representation and computation

To represent distributions, we can perhaps use some probability distributions from ProbOnto. In addition, we might want to use approximations. For example:

(This specific representation assumes numeric tuple components. Variations for categorical components are easy.)

We need to be able to sample from all distributions.

We now compute a prediction based on uncertain observations by sampling from those distributions, applying the prediction function, and then sampling from the output distribution (if the prediction function outputs a non-trivial distribution).

Our knowledge representation can look like

or

Of course, you could reorganize this representations in several plausible ways. For example, you could reify and annotate the observations

o isA Observation
o createdAt 2018-05-01T12:34:56.789Z
o subject a
o observation Gaussian(mean=<x,y,z>,stddev=<x',y',z'>)

Comments

  1. Good: The prediction function is arbitrary. In particular, it does not have to be distribution-aware. It can output a (non-trivial) distribution.
  2. Bad: Your prediction function could -- by its nature -- introduce or amplify sampling-related trouble.
  3. Bad: To get acceptable accuracy, the size of the representation of the distribution approximation could be very large. In some cases, the required accuracy might not be feasible to represent (or at least not without fancy gear).
  4. Good: You can use proper distributions when you have them.
  5. Good: You can control the cost/accuracy of the approximations of the output distribution.\
  6. Bad: Sampling can be tricky -- and much harder than it sounds.
  7. Good: The algorithm is simple, and its semantics are relatively clear. We are sampling. Other than potentially fancy sampling techniques, you don't need high-powered math.
  8. Bad: You'd get much better results with much, much less computation if you were working with distributions all the way through (including, of course, in the prediction function).
  9. Good: If you have GPUs, you might be able to very fast.
  10. Good: You have access to those counts (when they are really counts and not probabilities) in the approximate distributions.

References

  1. ProbOnto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment