Showing posts with label the secret. Show all posts
Showing posts with label the secret. Show all posts

28 June 2009

Bayesian Analysis: To probably be, or probably not be, depending on something else's probability

That man of science, Urikalish, loves to torment us superstitious, intuitive mortals who adore the Secret and the Law of Attraction with logic. This is his latest riddle:

Urikalish's Riddle


Let’s assume there’s a deadly disease that affects 1 in every 10 people.

Let's say there’s a pretty good test for this disease which is 90% accurate (that means that if a person is sick – the test will say he’s sick in 90% of the cases, and if a person is healthy – the test will say he’s healthy in 90% of the cases).

Now, assuming you took this 90% accurate test, and got a positive result that implies that you are sick - what are the odds that you are really sick?


Bayes's Theorem


The key to solving this riddle is Bayes's Theorem. Don't ask me why. I'm an elitist and I don't need to explain myself to the likes of you. Especially when I have no idea what I'm talking about.

Bayes's Theorem from Wikipedia

  • P(A|B): This is the probability of A, given B. This is what you are looking for. This is the posterior or revised probability that you have the disease, given the fact that you test positive.

  • P(B|A): This is the conditional probability, or the probability of B given A. In other words, the probability that you test positive, given that you have the disease.

  • P(A): This is the prior probability of A, or the prior probability that you have the disease, regardless of whether your test is positive or not.

  • P(B): This is the prior probability of B, or the prior probability that you test positive, whether you have the disease or not.


Smart people can fill in the data directly from Urikalish's riddle into Bayes's Theorem and get a result. Unfortunately, I played more with the glue and crayons than with the abacus and the clay when I was a kid, so I need something simpler.

An Intuitive Explanation of Bayes's Theorem


Eliezer S. Yudkowsky, that boy genius who tells us about his AI (that is, Almost Implemented) research, has the remarkable ability to make some really, really smart stuff seem really, really simple. This is Yudkowsky's explanation of Bayes's Theorem, which still went over my head (must've been toxic glue), so I tried something that is even more simple and more familiar to me, namely decision trees.

Using Decision Trees in Bayesian Analysis


Start at the beginning and make a split for those who have the disease, and those who are healthy. Branching of each node of the tree has to add up to 1, otherwise you're cooking Dutch books. Proceed up the tree, splitting each node into all the possible scenarios, and you'll eventually cover your entire sample space and thus have a visual representation of your full joint distribution.

decision tree Bayesian Analysis

Explanation


The probability of having the disease is equal to the amount of people who have the disease and test positive, divided by the total number of people who test positive.

If you said 90%, you are stating the probability that the test is right. This is a different probability than having the disease. If you said 10%, you are stating the probability that anybody has the disease, regardless of taking the test or not. The probability of having the disease is affected by both the probability that the test is right and the rarity of the disease.

The total number of people who have the disease here is 0,1, which is 10 %, or 10 out of the 100. The total number of people who test positive is 0,1 x 0,9 for those who have the disease (or 9 out of the original 100), and 0,9 x 0,1 of those who do not have the disease (also 9 out of the original 100). This means the total amount of people who test positive in the original population is 18 out of 100.

Finally, your answer 0,5 ie 50%. You get this from the 9 who test positive and do have the disease divided by 18 who test positive in the total population. The decision tree makes it visible who tested positive, so you are less likely to get confused. How likely? I don't know, draw your own damn tree.

15 December 2008

Law of Attraction

The Law of Attraction is the kind of snake oil that sells to those who somehow feel absolved when they share ineptitude with others. The most recent phenomenon of this rudder in the calm waters of clear thought resulted from what must be the first instance of a movie that turned into a best-selling book instead of the other way around.

Claudia Schiffer. She wants me, I can tell by the Law of Attraction
Claudia Schiffer. Come to daddy!

The Law of Attraction


In four easy steps, you can be right back where you started.
  1. Know what you want. Women, are you reading this? OK, let's put this theory to the test. I want Claudia Schiffer.

  2. Ask the universe for it. Suggest then that the waves of my thought patterns and the sound waves of my spoken voice are likely to be heard over the cosmic microwave background radation. Suggest also that these waves can travel through the theoretically empty vacuum that they would meet in space. Suggest also that Uranus won't block my signals. Suggest also that the Universe does understand English because I sure as hell am not going to Lisp the bitch. Suggest also that Hawking radiation, the music of the spheres and the noise transmitted from the earth's magnetic field (which swallows my brainwaves as soon as they leave my skull) do not prevent something as abstract as the Universe to hear about my inconsequential but by no means whimsical, unrequited affections for Claudia Schiffer. Suggest also that the Universe has the mother of all Beowulf clusters running, because surely there are hungry kids in Ethiopia, war victims in Iraq, cholera sufferers in Zimbabwe and Madonna who Universe knows needs help more than I do but because of the Law of Attraction all of us need to be served and soon. Especially Madge, she doesn't have that much time left. Suggest also that conflicting requests do not cancel each other out but somehow manage to materialise in tandem by means of a Mary Poppins kind of magic. Then, Dear Universe, may I please have me some Claudia Schiffer?

  3. Behave as if the object of your desire is on its way. Yes, Claudia Schiffer is going to knock on my door at any minute. Any minute now. I'm wearing a tuxedo. I look more stylish than Vincent Price and because Claudia hasn't pitched up yet, I'll have to sleep in my tux. I've chained myself to my bed with an elaborate pulley system so that I would not risk creasing my tux while lying down or getting up. Must look my best for Claudia, because she's going to knock on my door any minute now. My friends invited me out for drinks and dayglo paint filled condom fights, but I can't go in case Claudia shows up. Not even the shenanigans of viking mead or meatshank the bunny to the revolving bed by lava lamp light are going to cause me to defer from behaving as if Claudia is going to knock on my door at any minute. Even if I were invited to live on my own in the Playboy Mansion, with delicately hand picked Playmates who tickle my fancy and fancy my tickle, will I even consider behaving in any other way. Right.

  4. Be open to receiving it. I'm very open. If Claudia walked through my door right now, I'd give her my wallet and my keys and all the sweet petty mutterings I can muster in my broken German and a hushed tone. Law of Attraction or not.

In case you haven't noticed, I'm not entirely convinced that the Law of Attraction is a very practical problem solving approach. Let's demonstrate why by means of a simple thought experiment.

A simple thought experiment to break the Law of Attraction


Imagine that you get to choose the captain for an exhilarating new passenger liner called the RMS Titanic. You have a choice between captain Jack Sparrow and captain Wallace D Wattles. Jack Sparrow has had excruciating and extensive navy training under the Royal Navy. He's a sea dog, through and through. Wallace D Wattles sat in his room all day asking the universe to be a captain, believing that he'd be a captain and being open to receiving the position of captain on your ship. Wallace has never set his foot on a ship and gets seasick on a skateboard. Who would you choose to command the Titanic? Well, obviously you chose Wallace because your ship sank.

Google sucks piles I'm moving to Steemit

Short and sweet, Google isn't allowing me to post ads on my blogs here on blogspot any longer. Not that I provide my angry nerd rants fo...