## Bayes’ Ruler – A Bayesian Slide Rule

I’m a big fan of Bayesian statistics, and also old analog computers. It occured to me one day that I hadn’t ever seen a slide rule for calculating Bayes’ theorem…

Behold a fine posterior

Here’s how to use it. Let’s say you’re a doctor, and treating a patient with a 80% chance of having gallstones. You order a new test done, and it comes back positive. What’s the probability they have gallstones?

After looking in the medical texts, you find the test is 5:1 more likely to be positive if the person has gallstones than if they don’t.

So, we align the arrow with our ‘prior’ on the left at 80% (4:1 odds), and look for the 5:1 diagnostic odds, which gives us a result of 20:1, or 95.2% probable the patient has gallstones.

There’s far better explanations out there than this, please check out Wikipedia for what’s almost certainly better worded than mine.

I didn’t have the heart to design something like this by hand in inkscape. Instead I used Python and the DXFwrite library  to generate the files, and then lasercut it from acrylic.

I also made a wooden version with a clear acrylic top, which should be less fragile in a bag:

Files are here for anyone that wants to make their own:

https://www.thingiverse.com/thing:2347920

This entry was posted in Uncategorized. Bookmark the permalink.