Uncertain< T > A First-Order Type for Uncertain Data James - - PowerPoint PPT Presentation

uncertain t
SMART_READER_LITE
LIVE PREVIEW

Uncertain< T > A First-Order Type for Uncertain Data James - - PowerPoint PPT Presentation

Uncertain< T > A First-Order Type for Uncertain Data James Bornholt Australian National University Todd Mytkowicz Microsoft Research Kathryn S. McKinley Microsoft Research Uncertain< T >: A First-Order Type for Uncertain Data 1 Location


slide-1
SLIDE 1

Uncertain<T>: A First-Order Type for Uncertain Data

Uncertain<T>

A First-Order Type for Uncertain Data

James Bornholt Todd Mytkowicz Kathryn S. McKinley

Australian National University Microsoft Research Microsoft Research

1

slide-2
SLIDE 2

Uncertain<T>: A First-Order Type for Uncertain Data

estimated data

Location ¡Loc ¡ ¡ ¡ ¡ ¡= ¡GetGPSLocation(); ¡

discrete type

2

slide-3
SLIDE 3

Uncertain<T>: A First-Order Type for Uncertain Data

estimated data

Location ¡Loc ¡ ¡ ¡ ¡ ¡ ¡= ¡GetGPSLocation(); ¡

discrete type

Uncertainty bug

applications use estimated data, but languages use discrete types

3

slide-4
SLIDE 4

Uncertain<T>: A First-Order Type for Uncertain Data

Using estimates as facts

public ¡class ¡GeoCoordinate ¡{ ¡ ¡ ¡ ¡ ¡public ¡double ¡Latitude; ¡ ¡ ¡ ¡ ¡public ¡double ¡Longitude; ¡ ¡ ¡ ¡ ¡ ¡public ¡double ¡HorizontalAccuracy; ¡ } ¡

4

slide-5
SLIDE 5

Uncertain<T>: A First-Order Type for Uncertain Data

Using estimates as facts

public ¡class ¡GeoCoordinate ¡{ ¡ ¡ ¡ ¡ ¡public ¡double ¡Latitude; ¡ ¡ ¡ ¡ ¡public ¡double ¡Longitude; ¡ ¡ ¡ ¡ ¡ ¡public ¡double ¡HorizontalAccuracy; ¡ } ¡

5

slide-6
SLIDE 6

Uncertain<T>: A First-Order Type for Uncertain Data

Using estimates as facts

public ¡class ¡GeoCoordinate ¡{ ¡ ¡ ¡ ¡ ¡public ¡double ¡Latitude; ¡ ¡ ¡ ¡ ¡public ¡double ¡Longitude; ¡ ¡ ¡ ¡ ¡ ¡public ¡double ¡HorizontalAccuracy; ¡ } ¡

OS #1

95% confidence interval σ = 33 m

OS #2

68% confidence interval σ = 39 m

6

slide-7
SLIDE 7

Uncertain<T>: A First-Order Type for Uncertain Data

10 20 30 40 50 60

Time Speed (mph)

Using estimates as facts Computation compounds error

7

A B A+B Usain Bolt Normal walking

slide-8
SLIDE 8

Uncertain<T>: A First-Order Type for Uncertain Data

Using estimates as facts Computation compounds error Inference asks wrong questions

200 m

100 200 300

Distance (m)

if ¡(Distance ¡< ¡200) ¡... ¡

8

slide-9
SLIDE 9

Uncertain<T>: A First-Order Type for Uncertain Data

How do application writers handle estimated data without a PhD in statistics?

9

slide-10
SLIDE 10

Uncertain<T>: A First-Order Type for Uncertain Data

How do application writers handle estimated data without a PhD in statistics? Uncertain<T> is an uncertain type abstraction.

10

slide-11
SLIDE 11

Uncertain<T>: A First-Order Type for Uncertain Data

Probabilistic data

Sensors, measurements, probabilistic models

11

Related work

Developer computations

slide-12
SLIDE 12

Uncertain<T>: A First-Order Type for Uncertain Data

No abstraction

Domain PhD

Probabilistic data

Sensors, measurements, probabilistic models

12

Related work

Developer computations

slide-13
SLIDE 13

Uncertain<T>: A First-Order Type for Uncertain Data

No abstraction

Domain PhD

Probabilistic programming

Statistics PhD

Probabilistic data

Sensors, measurements, probabilistic models

13

Related work

Developer computations

slide-14
SLIDE 14

Uncertain<T>: A First-Order Type for Uncertain Data

No abstraction

Domain PhD

Probabilistic programming

Statistics PhD

Current abstractions

App developers

Probabilistic data

Sensors, measurements, probabilistic models

14

Related work

Developer computations

slide-15
SLIDE 15

Uncertain<T>: A First-Order Type for Uncertain Data

No abstraction

Domain PhD

Probabilistic programming

Statistics PhD

Uncertain<T>

App developers

Current abstractions

App developers

Probabilistic data

Sensors, measurements, probabilistic models

15

Related work

Developer computations

slide-16
SLIDE 16

Uncertain<T>: A First-Order Type for Uncertain Data

No abstraction

Domain PhD

Probabilistic programming

Statistics PhD

Uncertain<T>

App developers

Current abstractions

App developers

Probabilistic data

Sensors, measurements, probabilistic models

16

Related work

Flexible Simple

Developer computations

slide-17
SLIDE 17

Uncertain<T>: A First-Order Type for Uncertain Data

2 3 4 1

Identifying distributions Asking the right questions Computing with estimates Improving estimates

Source

type T

Measurement model Distribution

Uncertain<T>

Experts provide measurement models (they probably already have them!) Uncertain<T> approximates distributions by random sampling

17

slide-18
SLIDE 18

Uncertain<T>: A First-Order Type for Uncertain Data

2 3 4 1

Identifying distributions Asking the right questions Computing with estimates Improving estimates

A B A+B

Uncertain<T> lifts arithmetic operators (like +) to work over distributions

10−4 10−3 10−2 10−1 101 102 103 104 105 106 107

N Time (secs)

10−4 10−3 10−2 10−1 100 101 102 103 104 105 106 107

N Relative error (%)

Sampling trades speed for accuracy

18

slide-19
SLIDE 19

Uncertain<T>: A First-Order Type for Uncertain Data

2 3 4 1

Identifying distributions Asking the right questions Computing with estimates Improving estimates

200 m Pr[Distance < 200]

100 200 300

Distance (m)

“Is distance less than 200m?” The answer is a probability. Uncertain<T> accounts for sampling error using hypothesis testing on expected values.

19

slide-20
SLIDE 20

Uncertain<T>: A First-Order Type for Uncertain Data

2 3 4 1

Identifying distributions Asking the right questions Computing with estimates Improving estimates

Pr[H|E] = Pr[E|H] Pr[H] Pr[E]

Bayes’ Theorem uses distributions to form better estimates

10 20 30 40

Time Speed (mph) Raw speed Improved speed

20

slide-21
SLIDE 21

Uncertain<T>: A First-Order Type for Uncertain Data

Uncertainty bugs: applications use estimated data, but languages use discrete types.

Uncertain<T> makes programs more expressive and more correct.

Uncertain<T> is an uncertain type abstraction.

21