SciTech-Mathematics-Probability+Statistics-Discrete Binomial Distribution: 离散二项式分布
AI, Data Science, and Statistics
Statistics and Machine Learning Toolbox
Probability Distributions -> Discrete Distributions -> Binomial Distribution
Bernoulli Distribution
The Bernoulli distribution is a discrete probability distribution with only two possible values for the random variable.
Binomial Distribution
The binomial distribution models the total number of successes in repeated trials from an infinite population under certain conditions.
ON THIS PAGE
Overview
Parameters
Probability Density Function
Cumulative Distribution Function
Descriptive Statistics
Example
Related Distributions
References
See Also
Related Topics
Main Content
Binomial Distribution
Overview
The binomial distribution is a two-parameter family of curves.
The binomial distribution is used to model the total number of successes in a fixed number of independent trials that have the same probability of success,
such as modeling the probability of a given number of heads in ten flips of a fair coin.
Statistics and Machine Learning Toolbox offers several ways to work with the binomial distribution.
Create a probability distribution object BinomialDistribution by fitting a probability distribution to sample data (fitdist) or by specifying parameter values (makedist). Then, use object functions to evaluate the distribution, generate random numbers, and so on.
Work with the binomial distribution interactively by using the Distribution Fitter app. You can export an object from the app and use the object functions.
Use distribution-specific functions (binocdf, binopdf, binoinv, binostat, binofit, binornd) with specified distribution parameters. The distribution-specific functions can accept parameters of multiple binomial distributions.
Use generic distribution functions (cdf, icdf, pdf, random) with a specified distribution name ('Binomial') and parameters.
Parameters
The binomial distribution uses the following parameters.
Parameter Description Support
N Number of trials Positive integer
p Probability of success in a single trial 0≤p≤1
The sum of two binomial random variables that both have the same parameter p is also a binomial random variable with N equal to the sum of the number of trials.
Probability Density Function
The probability density function (pdf) of the binomial distribution is
f(x∣N,p)=(
N
x
)p
x
(1−p)
N−x
; x=0,1,2,...,N ,
where x is the number of successes in N trials of a Bernoulli process with the probability of success p. The result is the probability of exactly x successes in N trials. For discrete distributions, the pdf is also known as the probability mass function (pmf).
For an example, see Compute Binomial Distribution pdf.
Cumulative Distribution Function
The cumulative distribution function (cdf) of the binomial distribution is
F(x∣N,p)=
x
∑
i=0
(
N
i
)p
i
(1−p)
N−i
; x=0,1,2,...,N ,
where x is the number of successes in N trials of a Bernoulli process with the probability of success p. The result is the probability of at most x successes in N trials.
For an example, see Compute Binomial Distribution cdf.
Descriptive Statistics
The mean of the binomial distribution is Np.
The variance of the binomial distribution is Np(1 – p).
Example
Fit Binomial Distribution to Data
Generate a binomial random number that counts the number of successes in 100 trials with the probability of success 0.9 in each trial.
x = binornd(100,0.9)
x = 85
Fit a binomial distribution to data using fitdist.
pd = fitdist(x,'Binomial','NTrials',100)
pd =
BinomialDistribution
Binomial distribution
N = 100
p = 0.85 [0.764692, 0.913546]
fitdist returns a BinomialDistribution object. The interval next to p is the 95% confidence interval estimating p.
Estimate the parameter p using the distribution functions.
[phat,pci] = binofit(x,100) % Distribution-specific function
phat = 0.8500
pci = 1×2
0.7647 0.9135
[phat2,pci2] = mle(x,'distribution','Binomial',"NTrials",100) % Generic distribution function
phat2 = 0.8500
pci2 = 2×1
0.7647
0.9135
Compute Binomial Distribution pdf
Compute the pdf of the binomial distribution with 10 trials and the probability of success 0.5.
x = 0:10;
y = binopdf(x,10,0.5);
Plot the pdf with bars of width 1.
figure
bar(x,y,1)
xlabel('Observation')
ylabel('Probability')
Compute Binomial Distribution cdf
Compute the cdf of the binomial distribution with 10 trials and the probability of success 0.5.
x = 0:10;
y = binocdf(x,10,0.5);
Plot the cdf.
figure
stairs(x,y)
xlabel('Observation')
ylabel('Cumulative Probability')
Compare Binomial and Normal Distribution pdfs
When N is large, the binomial distribution with parameters N and p can be approximated by the normal distribution with mean Np and variance Np*(1–p) provided that p is not too large or too small.
Compute the pdf of the binomial distribution counting the number of successes in 50 trials with the probability 0.6 in a single trial .
N = 50;
p = 0.6;
x1 = 0:N;
y1 = binopdf(x1,N,p);
Compute the pdf of the corresponding normal distribution.
mu = Np;
sigma = sqrt(Np*(1-p));
x2 = 0:0.1:N;
y2 = normpdf(x2,mu,sigma
SciTech-Mathematics-Probability+Statistics-Discrete Binomial Distribution: 离散二项式分布的更多相关文章
- 基本概率分布Basic Concept of Probability Distributions 1: Binomial Distribution
PDF下载链接 PMF If the random variable $X$ follows the binomial distribution with parameters $n$ and $p$ ...
- negative binomial(Pascal) distribution —— 负二项式分布(帕斯卡分布)
1. 定义 假设一串独立的伯努利实验(0-1,成功失败,伯努利实验),每次实验(trial)成功和失败的概率分别是 p 和 1−p.实验将会一直重复下去,直到实验失败了 r 次.定义全部实验中成功的次 ...
- Statistics : Data Distribution
1.Normal distribution In probability theory, the normal (or Gaussian or Gauss or Laplace–Gauss) dist ...
- 基本概率分布Basic Concept of Probability Distributions 5: Hypergemometric Distribution
PDF version PMF Suppose that a sample of size $n$ is to be chosen randomly (without replacement) fro ...
- Fuzzy Probability Theory---(3)Discrete Random Variables
We start with the fuzzy binomial. Then we discuss the fuzzy Poisson probability mass function. Fuzzy ...
- 【概率论】5-5:负二项分布(The Negative Binomial Distribution)
title: [概率论]5-5:负二项分布(The Negative Binomial Distribution) categories: - Mathematic - Probability key ...
- The zero inflated negative binomial distribution
The zero-inflated negative binomial – Crack distribution: some properties and parameter estimation Z ...
- 基本概率分布Basic Concept of Probability Distributions 4: Negative Binomial Distribution
PDF version PMF Suppose there is a sequence of independent Bernoulli trials, each trial having two p ...
- 基本概率分布Basic Concept of Probability Distributions 2: Poisson Distribution
PDF version PMF A discrete random variable $X$ is said to have a Poisson distribution with parameter ...
- 基本概率分布Basic Concept of Probability Distributions 8: Normal Distribution
PDF version PDF & CDF The probability density function is $$f(x; \mu, \sigma) = {1\over\sqrt{2\p ...
随机推荐
- <HarmonyOS第一课07>从网络获取数据
视频链接: https://developer.huawei.com/consumer/cn/training/course/slightMooc/C101717497918284399?ha_sou ...
- 【翻译】Processing系列|(一)简介及使用方法
下一篇:[翻译]Processing系列|(二)安卓模式的安装使用及打包发布 下下篇:[翻译] Processing系列|(三)安卓项目构建 考虑到,学习啥都肯定要先读人家的官方文档,笔者把这个系列的 ...
- 【记录】BASE64|解决JS和C++中文传输乱码,内含两种语言的Base64编码解码的代码
JS 解决方法来源于知乎新码笔记的文章 function b64Encode(str) { return btoa(unescape(encodeURIComponent(str))); } func ...
- 构建现代交互式平台:CodeBuddy如何简化复杂系统开发
我正在参加CodeBuddy「首席试玩官」内容创作大赛,本文所使用的 CodeBuddy 免费下载链接:腾讯云代码助手 CodeBuddy - AI 时代的智能编程伙伴 交互式平台的架构挑战 构建现代 ...
- Nuxt的SEO实践
第9章:Nuxt的SEO实践 1. 引言 Nuxt框架在SEO方面的优势主要体现在以下几个方面: 服务器端渲染(SSR): Nuxt默认支持SSR,这意味着搜索引擎爬虫可以直接看到完整的页面内容,而不 ...
- ComfyUI+通义万相 Wan2.1系列生成视频教程
一.Wan2.1系列 Wan2.1 系列是阿里巴巴通义实验室推出的开源视频生成模型套件,共有 4 个模型,包括文生视频的 Wan2.1-T2V-1.3B 和 Wan2.1-T2V-14B,以及图生视频 ...
- python解析xml字符串与xml转json
一.python解析xml字符串from xml.dom.minidom import parseString xml_str=""" <root> < ...
- Java遍历Map对象的常见方法
在Java中遍历Map有不少的方法,我们看一下最常用的方法及其优缺点. 既然Java中的所有map都实现了Map接口,以下方法适用于任何map实现(HashMap, TreeMap, LinkedHa ...
- 转-Linux mpstat命令入门-CPU实时监控详解
简介 mpstat 来自Multiprocessor Statistics的英文缩写,是实时系统监控工具,主要用来查看多CPU系统中每个CPU的负载是否均衡,相关统计信息存放在/proc/stat ...
- 【中英】【吴恩达课后测验】Course 4 -卷积神经网络 - 第四周测验
[中英][吴恩达课后测验]Course 4 -卷积神经网络 - 第四周测验 - 特殊应用:人脸识别和神经风格转换 上一篇:[课程4 - 第三周编程作业]※※※※※ [回到目录]※※※※※下一篇:[待撰 ...