Thursday, August 27, 2015

Bayes theorem in real life

I had a chance to practice Bayesian inference in real life today: at 1pm my wife called to tell me that the carbon monoxide (CO) alarm at the house was going off.  Immediately two hypotheses came to mind: (1) there is a dangerous amount of CO in my house, (2) it's a false alarm.

It's summer and all the windows are open in the house.  The furnace is not running and we don't have a gas stove.  And the detector is about 10 years old.  This background information makes a false alarm more plausible, so I started with a low prior for (1).  Since my wife was on her way out anyway, I suggested she disconnect the detector, turn on a fan, and leave.

After we hung up, I searched for information on CO detectors and false alarms.  Apparently, the rate of false alarms is low, at least in once sense: CO detectors are very specific, that is, unlikely to go off because of anything other than CO.  Of course the other possibility is that the detector is broken.  On balance, this information made me less confident of a false alarm.

I tried to think of other possibilities:
  • A major street nearby is being paved.  Does fresh pavement off-gas anything that would set off a CO detector?
  • At a construction site down the street, they just poured a concrete foundation, and my neighbor is having some masonry done.  Does fresh concrete off-gas CO?  I vaguely remember that it sequesters oxygen, which turned out to be a problem for one of the Biosphere projects.
  • What about a smoldering fire inside a wall?  Could it produce enough CO to set off the detector, but not enough smoke to set off the smoke alarms?
The first two seemed unlikely, but the third seemed plausible.  In fact, it seemed plausible enough that I decided to go home and check it out.  When I got there, the windows were open and fans were running, so I figured the air had exchanged at least once, and the detector had a chance to reset.

I put on over-the-head 30dB earmuffs and plugged the detector back in.  It went off immediately.  I plugged it into an outlet in another room, and it went off immediately.  At this point it seemed unlikely that every room in my wide-open, highly ventilated house was full of CO.

I still couldn't rule out a smoldering fire, but it sure seemed unlikely.  Nevertheless, I called the fire department, using their non-emergency number to preserve some dignity, and told them the story.  They sent a truck, walked through the house with a gas detector, and reported no CO anywhere.

One of the fireman told me that CO detectors are good for about 7 years, so it's time for a new one.  And while I'm at it, he suggested, I should get one more for the first floor (currently I have one in the basement and one on the second floor).  And that's what I did.

So what have we learned?

1) Make sure you have a CO detector on each floor of your house.  CO poisoning is no joke.  Want proof?  Run this search query any time.  Chances are you'll find several serious accidents within the last week or so.

2)  Replace detectors after 5-7 years.  Apparently newer ones have an end-of-life alert, so you don't have to keep track.  If you have an older one, figure out the replacement day and put it on your calendar.

3) Think like a Bayesian.  As you get more information, update your probabilities, and change your decisions accordingly.  My initial estimate for the probability of false alarm was so high, I decided not to check it out.  As I thought of more possible explanations, the probability of a real problem crept higher.  It was still very low, but high enough that I decided to go home.

4) On the other hand, a strictly Bayesian framework doesn't always fit real-world thinking.  In this case, my decision flipped when I thought of a new hypothesis (a smoldering fire).  Should I consider that a new piece of information and update my prior?  Or is it a new piece of background information that caused me to go back, revise my prior, and start over?  In practice, it makes no difference.  But from a Bayesian point of view, it's not quite as neat as it might be.


  1. Some fine Bayesian reasoning. Experimental design, not so great. Since you have a second detector in the basement, why not immediately tell your wife to go and fetch it? Two independent detectors going off upstairs (but not in the basement) updates your probabilities to close to 1 and 0 immediately.

    1. Not possible in this case because the detector in the basement is wired (not plug in). But your idea is excellent.