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 ...
随机推荐
- EF core番外——EF core 输出生成的SQL 到控制台
----------------版权声明:本文为CSDN博主「爱睡觉的程序员」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明.原文链接:https://blog.cs ...
- 成语答题小程序v3.0
自从开源成语答题小程序以来不断完善功能,并且不断修复bug,成语答题小程序v3版本完善了很多功能 1.增加了原生模板广告,设置原生模板广告后可以设置首页或答题页是否显示原生模板广告 2.增加了背景设置 ...
- C# 14 新增功能一览,你觉得实用吗?
前言 今天咱们一起来看看在 C# 14 中新增的几个功能特性,是否给我们日常编码带了来便利. 前提准备 要体验 C# 14 中的新增功能,你需要安装最新的 Visual Studio 2022 版本或 ...
- 天翼云出席DCIC2025,“翼立方”创新力拉满!
近日,由中国通信企业协会主办的DCIC2025(第14届)数据中心产业发展大会在北京召开.大会以"共筑算力基石,护航产业生态"为主题,邀请众多知名算力企业代表以及生态合作伙伴代表, ...
- 掌握Node.js原理,开启异步编程之旅
@charset "UTF-8"; .markdown-body { line-height: 1.75; font-weight: 400; font-size: 15px; o ...
- js操作session
// 保存数据到sessionStorage sessionStorage.setItem('key', 'value'); // 从sessionStorage获取数据 sessionStorage ...
- Seata源码—2.seata-samples项目介绍
大纲 1.seata-samples的配置文件和启动类 2.seata-samples业务服务启动时的核心工作 3.seata-samples库存服务的连接池配置 4.Seata对数据库连接池代理配置 ...
- L3-1、掌控多轮对话的节奏 -Prompt 结构与上下文管理全攻略
一.多轮对话中的上下文挑战与常见问题 在与大语言模型(LLM)进行多轮对话时,我们常常面临以下挑战: 上下文丢失:模型"遗忘"之前提到的信息 指代不明:难以理解代词指向的内容 话题 ...
- Spring Boot注解之@ComponentScan用法和实现原理
注解@ComponentScan的作用 @Component注解及其衍生注解@RestController.@Controller.@Service和@Repository都是组件注册注解.@Co ...
- 【pr】眨眼特效
来源 这个后半段 步骤 新建一段黑场视频 效果->网格化->边角的两个数值调整很大(4000,4000),现在黑场只剩下一个白色十字架. 效果控件->网格->锚点->第一 ...