SciTech-Mathematics-Probability+Statistics-CDF vs. PDF: What’s the Difference? PDF:概率密度函数+CDF:累积分布函数-
https://www.statology.org/cdf-vs-pdf/
CDF vs. PDF: What’s the Difference?
This tutorial provides a simple explanation of the difference between:
- a PDF (probability density function)
- a CDF (cumulative distribution function)
in statistics.
Random Variables
Before we can define a PDF or a CDF, we first need to understand random variables.
A random variable, usually denoted as X,
is a variable whose values are numerical outcomes of some random process.
There are two types of random variables: discrete and continuous.
"Discrete" Random Variables
A "discrete" random variable is one which can take on only a countable number of distinct values like 0, 1, 2, 3, 4, 5…100, 1 million, etc.
Some examples of discrete random variables include:
- The number of times a coin lands on heads after being flipped 20 times.
- The number of times a dice lands on the number 4 after being rolled 100 times.
"Continuous" Random Variables
A "continuous" random variable is one which can take on an infinite number of possible values.
Some examples of continuous random variables include:
- Height of a person
There are an infinite amount of possible values for height.
For example, the height of a person could be 60.2 inches, 65.234 inches, 70.4312 inches, etc. - Weight of an animal
- Time required to run a mile
Rule of Thumb:
- If you can count the number of outcomes,
then you are working with a discrete random variable.
e.g. counting the number of times a coin lands on heads. - But if you can measure the outcome,
you are working with a continuous random variable.
e.g. measuring, height, weight, time, etc.
PDF(Probability Density Functions)
- A pdf(probability density function) tells us the probability that a random variable takes on a certain value.
- For example, suppose we roll a dice one time.
If we let x denote the number that the dice lands on,
then the pdf(probability density function) for the outcome can be described as follows:- P(x < 1) : 0
- P(x = 1) : 1/6
- P(x = 2) : 1/6
- P(x = 3) : 1/6
- P(x = 4) : 1/6
- P(x = 5) : 1/6
- P(x = 6) : 1/6
- P(x > 6) : 0
- Note that:
this is an example of a discrete random variable, since x can only take on integer values.
For a continuous random variable, we cannot use a PDF directly, since the probability that x takes on any exact value is zero.
- the total Probability of x MUST be 1, and there are infinite number of possible outcomes.
so the Probability of each exact value MUST be 0. - For example, suppose we want to know the probability that a burger from a particular restaurant weighs a quarter-pound (0.25 lbs). Since weight is a continuous variable, it can take on an infinite number of values.
- For example, a given burger might actually weight 0.250001 pounds, or 0.24 pounds, or 0.2488 pounds. The probability that a given burger weights exactly .25 pounds is essentially zero.
CDF(Cumulative Distribution Functions)
A cdf(cumulative distribution function) tells us the probability that a random variable takes on a value that less than or equal to x.
For example, suppose we roll a dice one time.
If we let x denote the number that the dice lands on,
then the cdf(cumulative distribution function) for the outcome,
can be described as follows:
- P(x ≤ 0) : 0
- P(x ≤ 1) : 1/6
- P(x ≤ 2) : 2/6
- P(x ≤ 3) : 3/6
- P(x ≤ 4) : 4/6
- P(x ≤ 5) : 5/6
- P(x ≤ 6) : 6/6
- P(x > 6) : 0
- Notice that:
the probability that x is less than or equal to 6 is 6/6, which is equal to 1.
This is because the dice will land on either 1, 2, 3, 4, 5, or 6 with 100% probability.
This example uses a discrete random variable,
but a continuous density function can also be used for a continuous random variable.
cdf(Cumulative distribution functions) have the following properties:
- The probability that a random variable takes on a value less than the smallest possible value is zero. For example, the probability that a dice lands on a value less than 1 is zero.
- The probability that a random variable takes on a value less than or equal to the largest possible value is one. For example, the probability that a dice lands on a value of 1, 2, 3, 4, 5, or 6 is one. It must land on one of those numbers.
- The cdf is always non-decreasing. That is, the probability that a dice lands on a number less than or equal to 1 is 1/6, the probability that it lands on a number less than or equal to 2 is 2/6, the probability that it lands on a number less than or equal to 3 is 3/6, etc. The cumulative probabilities are always non-decreasing.
- Related: You can use an ogive graph to visualize a cdf(cumulative distribution function).
The Relationship Between a CDF and a PDF
- In technical terms, a pdf(probability density function) is the derivative of a cdf(cumulative distribution function).
- Furthermore, the AUC(Area Under the Curve) of a pdf between negative infinity and x is equal to the value of x on the cdf.
- For an in-depth explanation of the relationship between a pdf and a cdf, along with the proof for why the pdf is the derivative of the cdf, refer to a statistical textbook.
Zach Bobbitt
Hey there. My name is Zach Bobbitt. I have a Masters of Science degree in Applied Statistics and I've worked on machine learning algorithms for professional businesses in both healthcare and retail.
I’m passionate about statistics, machine learning, and data visualization and I created Statology to be a resource for both students and teachers alike.
My goal with this site is to help you learn statistics through using simple terms, plenty of real-world examples, and helpful illustrations.
SciTech-Mathematics-Probability+Statistics-CDF vs. PDF: What’s the Difference? PDF:概率密度函数+CDF:累积分布函数-的更多相关文章
- rvs产生服从指定分布的随机数 pdf概率密度函数 cdf累计分布函数 ppf 分位点函数
统计工作中几个常用用法在python统计函数库scipy.stats的使用范例. 正态分布以正态分布的常见需求为例了解scipy.stats的基本使用方法. 1.生成服从指定分布的随机数 norm.r ...
- C# 复制PDF页面到另一个PDF文档
C# 复制PDF页面到另一个PDF文档 有时候我们可能有这样一个需求,那就是把PDF页面从一个PDF文档复制到另一个PDF文档中.由于PDF文档并不像word文档那样好编辑,因此复制也相对没有那么容易 ...
- PDF解决方案(3)--PDF转SWF
相关专题链接 PDF解决方案(1)--文件上传 PDF解决方案(2)--文件转PDF PDF解决方案(3)--PDF转SWF PDF解决方案(4)--在线浏览 前言:上一篇中介绍了上传的文件转PDF, ...
- 【使用Itext处理PDF文档(新建PDF文件、修改PDF文件、PDF中插入图片、将PDF文件转换为图片)】
iText简介 iText是著名的开放源码的站点sourceforge一个项目,是用于生成PDF文档的一个java类库.通过iText不仅可以生成PDF或rtf的文档,而且可以将XML.Html文件转 ...
- fis3+vue+pdf.js制作预览PDF文件或其他
人生第一篇博客,的确有点紧张,但有些许兴奋,因为这对于我来说应该是一个好的开始,以此励志在技术的道路上越走越远. 看过了多多少少的技术博客,给自己带来了很多技术上的收获,也因此在想什么时候自己也可以赠 ...
- PDF怎样添加注释,PDF文件添加注释的方法
Word文件跟纸质文件想要添加注释相信大家都知道该怎么添加,那么现在也使用频率挺高的PDF格式的文件要怎么添加注释呢?添加注释的方法有什么呢?有许多的小伙伴们都想知道吧,今天小编就来跟大家分享一下,想 ...
- 如何新建PDF文档,新建PDF文档的方法
新建PDF文件的话,有两种方式,一种是直接通过使用PDF编辑器http://bianji.xjpdf.com/来新建PDF文件,,还有一种就是将PDF文件转换成Word文件,然后在Word文件中添加, ...
- PDF如何去除背景,PDF去除背景颜色
PDF文件在使用的时候大多都是单调的白色背景,但是也有小伙伴再制作PDF文件的时候会给PDF文件添加背景颜色,会有影响文字阅读的情况,这个时候就需要把背景颜色去除了,那么该怎么做呢,不会的小伙们就跟小 ...
- PDF文件怎么修改,PDF文件编辑方法
PDF文件是一种独特的文件,在日常办公中已经成为我们使用最广泛的电子文档格式.在使用PDF文件中会遇到PDF文件有错区的时候,再从新制作一个PDF文件会比较麻烦,只能通过工具来对PDF文件进行修改,这 ...
- PDF文件编辑技巧之PDF书签怎么设置
纸质的文件想要添加书签就直接拿笔书写就可以,Word文件怎么添加书签相信大家也都知道,那么PDF文件的书签要怎么设置的呢,是不是有很多小伙伴不知道该怎么做呢,不要担心,今天小编就来跟大家分享一下在PD ...
随机推荐
- Nacos简介—2.Nacos的原理简介
大纲 1.Nacos集群模式的数据写入存储与读取问题 2.基于Distro协议在启动后的运行规则 3.基于Distro协议在处理服务实例注册时的写路由 4.由于写路由造成的数据分片以及随机读问题 5. ...
- SpringBoot中的拦截器江湖
前言 很多小伙伴在工作中遇到拦截需求就无脑写HandlerInterceptor,结果被复杂场景搞得鼻青脸肿. 作为一名有多年开发经验的程序员,今天领大家到SpringBoot的山头认认6把交椅: 这 ...
- SQL 强化练习 (十三)
这几天都在整帆软报表, 还要弄 RPA ... 咱说呢, 这些破玩意, 是提升了业务人员的工作效率, 但, 极大降低了我的工作效率, 明明写代码就能解决, 非要各种 点点点... 文档也不全, 就很难 ...
- DP 动态规划初识
前面的 HMM 中参数求解, 都会用到动态规划, 全是各种概率公式, 是有一些抽象, 今天决定举个一波简单的栗子, 帮助理解DP 把一个大问题,不断划分为更小的子问题来求解的这种方式, 就是动态规划. ...
- Java应用出现 Public Key Retrieval is not allowed 报错的常见原因和解决方法
问题现象 Java 应用在运行过程中突然报java.sql.SQLNonTransientConnectionException: Public Key Retrieval is not allowe ...
- CAP 关键细节点与ACID、BASE的比较
极客时间:<从 0 开始学架构>:想成为架构师,你必须掌握的CAP细节 1.CAP 关键细节点 埃里克·布鲁尔(Eric Brewer)在<CAP 理论十二年回顾:"规则& ...
- C#之字符串和正则表达式
在C#中string关键字的映射实际上是指向.NET基类System.String.System.String是一个功能非常强大且用途非常广泛的基类,但它不是.NET库中唯一与字符串相关的类. Sys ...
- B1009 说反话
给定一句英语,要求你编写程序,将句中所有单词的顺序颠倒输出. 输入格式: 测试输入包含一个测试用例,在一行内给出总长度不超过 80 的字符串.字符串由若干单词和若干空格组成,其中单词是由英文字母(大小 ...
- 记录一次maven依赖冲突的解决
现象 项目依赖selenium-java的4.32版本,但是未发现org.openqa.selenium.devtools.DevTools类.如下所示: 问题排查 定位问题 第一反应肯定是依赖冲突了 ...
- Java进阶知识点:接口幂等性
幂等概念 在计算机中,表示对同一个过程应用相同的参数多次和应用一次产生的效果是一样,这样的过程即被称为满足幂等性. 也可以进行如下表述:一个HTTP请求方法,如果被请求多次和被请求一次效果 ...