Prior odd:

The idea is to take the odds for something happening (against it not happening), which we´ll write as prior odds.

For example:

The chances of rain are 206 in 365. Then the Prior odd = 206:159

Likelihood ratio:

However, after opening your eyes and taking a look outside, you notice it’s cloudy. Suppose the chances of having a cloudy morning on a rainy day are 9 out of 10 — that means that only one out of 10 rainy days start out with blue skies. But sometimes there are also clouds without rain: the chances of having clouds on a rainless day are 1 in 10. Now how much higher are the chances of clouds on a rainy day compared to a rainless day?

The answer is that the chances of clouds are nine times higher on a rainy day than on a rainless day: on a rainy day the chances are 9 out of 10, whereas on a rainless day the chances of clouds are 1 out of 10, and that makes nine times higher.

So we concluded that on a cloudy morning, we have: likelihood ratio = (9/10) / (1/10) = 9

Posterior odds:

posterior odds = likelihood ratio × prior odds

For example:

Apply the Bayes rule to calculate the posterior odds for rain having observed clouds in the morning in Helsinki.

As we calculated above, the prior odds for rain is 206:159 and the likelihood ratio for observing clouds is 9

posterior odds = 9 * 206 / 159


Consider mammographic screening for breast cancer. Using made up percentages for the sake of simplifying the numbers, let’s assume that five in 100 women have breast cancer. Suppose that if a person has breast cancer, then the mammograph test will find it 80 times out of 100. When the test comes out suggesting that breast cancer is present, we say that the result is positive, although of course there is nothing positive about this for the person being tested. (A technical way of saying this is that the sensitivity of the test is 80%.)

The test may also fail in the other direction, namely to indicate breast cancer when none exists. This is called a false positive finding. Suppose that if the person being tested actually doesn’t have breast cancer, the chances that the test nevertheless comes out positive are 10 in 100.

Based on the above probabilities, you are be able to calculate the likelihood ratio. You'll find use for it in the next exercise. If you forgot how the likelihood ratio is calculated, you may wish to check the terminology box earlier in this section and revisit the rain example.

Consider the above breast cancer scenario. An average woman takes the mammograph test and gets a positive test result suggesting breast cancer. What do you think are the odds that she has breast cancer given the observation that the test is positive?

Hints:

  1. Start by calculating the prior odds.
  2. Determine the probability of the observation in case of the event (cancer).
  3. Determine the probability of the observation in case of no event (no cancer).
  4. Obtain the likelihood ratio as the ratio of the above two probabilities.
  5. Finally, multiply the prior odds by the likelihood ratio.

Enter the posterior odds as your solution below. Give the answer in the form xx:yy where xx and yy are numbers, without simplifying the expression even if both sides have a common factor.


40:95

Prior: 5:95

Likelihood Ratio: (0.05 * 0.8) / (0.05 * 0.1) = 8

Posterior = 8 * 5 : 95 = 40: 95

First, let's express the probabilities in terms of odds. The prior odds describe the situation before getting the test result. Since five out of 100 women have breast cancer, there is on the average five women with breast cancer for every 95 women without breast cancer, and therefore, the prior odds are 5:95. The likelihood ratio is the probability of a positive result in case of cancer divided by the probability of a positive result in case of no cancer. With the above numbers, this is given by 80/100 divided by 10/100, which is 8. The Bayes rule now gives the posterior odds of breast cancer given the positive test result: posterior odds = 8 × 5:95 = 40:95, which is the correct answer. So despite the positive test result, the odds are actually against the person having breast cancer: among the women who are tested positive, there are on the average 40 women with breast cancer for every 95 women without breast cancer. Note: If we would like to express the chances of breast cancer given the positive test result as a probability (even though this is not what the exercise asked for), we would consider the 40 cases with cancer and the 95 cases without cancer together, and calculate what portion of the total 40 + 95 = 135 individuals have cancer. This gives the result 40 out of 135, or about 30%. This is much higher than the prevalence of breast cancer, 5 in 100, or 5%, but still the chances are that the person has no cancer. If you compare the solution to your intuitive answer, they tend to be quite different for most people. This demonstrates how poorly suited out intuition is for handling uncertain and conflicting information.

Resource:

https://www.youtube.com/watch?v=tRE6mKAIkno

https://course.elementsofai.com/3/2

[Algorithms] The Bayes Rule的更多相关文章

  1. 用贝叶斯定理解决三门问题并用Python进行模拟(Bayes' Rule Monty Hall Problem Simulation Python)

    三门问题(Monty Hall problem)也称为蒙提霍尔问题或蒙提霍尔悖论,出自美国的电视游戏节目<Let’s Make a Deal>.问题名字来自该节目的主持人蒙提·霍尔(Mon ...

  2. Generative Learning algorithms

    "generative algorithm models how the data was generated in order to categorize a signal. It ask ...

  3. [Bayesian] “我是bayesian我怕谁”系列 - Naive Bayes+prior

    先明确一些潜规则: 机器学习是个collection or set of models,一切实践性强的模型都会被归纳到这个领域,没有严格的定义,’有用‘可能就是唯一的共性. 机器学习大概分为三个领域: ...

  4. [Bayesian] “我是bayesian我怕谁”系列 - Naive Bayes with Prior

    先明确一些潜规则: 机器学习是个collection or set of models,一切实践性强的模型都会被归纳到这个领域,没有严格的定义,’有用‘可能就是唯一的共性. 机器学习大概分为三个领域: ...

  5. an introduction to conditional random fields

    1.Structured prediction methods are essentially a combination of classification and graphical modeli ...

  6. The Joys of Conjugate Priors

    The Joys of Conjugate Priors (Warning: this post is a bit technical.) Suppose you are a Bayesian rea ...

  7. Introduction to Machine Learning

    Chapter 1 Introduction 1.1 What Is Machine Learning? To solve a problem on a computer, we need an al ...

  8. How do I learn machine learning?

    https://www.quora.com/How-do-I-learn-machine-learning-1?redirected_qid=6578644   How Can I Learn X? ...

  9. How do I learn mathematics for machine learning?

    https://www.quora.com/How-do-I-learn-mathematics-for-machine-learning   How do I learn mathematics f ...

随机推荐

  1. 347 Top K Frequent Elements 前K个高频元素

    给定一个非空的整数数组,返回其中出现频率前 k 高的元素.例如,给定数组 [1,1,1,2,2,3] , 和 k = 2,返回 [1,2].注意:    你可以假设给定的 k 总是合理的,1 ≤ k ...

  2. sql 循环分割字符

    DECLARE @Items VARCHAR(1000)='148' --待处理拼接字符串 --开始处理SET @Items=@Items+',' --必须追加“,”否则最后一个无法输出DECLARE ...

  3. jvm gc日志解读

    参考 https://blog.csdn.net/yxc135/article/details/12137663 认识gc日志每个位置的含义 java 8 full gc [Full GC (Meta ...

  4. Java 中 父类变量访问子类方法 需要使用 类型转换 (instenceof)关键字 /类型判断/

    通过数组元素访问方法的时候只能访问在 Animal中定义的方法,对 于 Tiger类和  Fish中定义的方法时却不能调用,例如语句  animal[2].swim();就是不正确的.当 需要访问这些 ...

  5. 10.Nodes and Bindings

    节点数据绑定 节点是构成Ventuz场景的基本元素.每个节点既属于图层.也属于层级或内容.既可以在图层编辑器,也可以在层级编辑器或内容编辑器中编辑. 内容节点包括资产描述(如材质.xml文件等).数字 ...

  6. 如何卸载系统自带的Microsoft Office

    (1)首先.在C盘删除office文件夹. (2)删除注册表 1)开始菜单-->运行-->regedit进入注册表 (window+r  -->) 2)在注册表里找到HKEY_CUR ...

  7. [Windows Server 2012] IIS自带FTP配置方法

    ★ 欢迎来到[护卫神·V课堂],网站地址:http://v.huweishen.com★ 护卫神·V课堂 是护卫神旗下专业提供服务器教学视频的网站,每周更新视频.★ 本节我们将带领大家:IIS自带FT ...

  8. Detectron-MaskRCnn: 用于抠图的FCNN

    市面上暂时还没有找到可以在消费机显卡上实时运行的MaskRCnn,TensorFlow即使是C++版本训练在coco数据集上的模型也是慢的要死,最后不堪忍受,只能放弃. 经历了一些列fuckingDo ...

  9. 关于 实体类中 时间字段 为string 类型和 datatime类型 比较

    经发现, 数据库中保存时间格式数据  可以正常 排序, 数据中保存时间格式字符串 排序出现问题 /// <summary> /// 修改时间 /// </summary> pu ...

  10. 8.2.3 覆写 Equals

    经过对四种不同类型判等方法的讨论,我们不难发现不管是 Equals 静态方法.Equals 虚方法 抑或==操作符的执行结果,都可能受到覆写 Equals 方法的影响.因此研究对象判等就必须将注意 力 ...