SciTech-Mathematics-PAS機率統計-多學多用MATLAB就非常的好-Distribution分佈-Binomial + Poisson +

abaelhe發表於2024-05-12

https://ww2.mathworks.cn/help/stats/poisson-distribution.html
https://ww2.mathworks.cn/help/stats/binomial-distribution.html
https://ww2.mathworks.cn/help/stats/working-with-probability-distributions.html

幫助中心
文件主頁
AI、資料科學和統計
Statistics and Machine Learning Toolbox
機率分佈
離散分佈
泊松分佈
泊松分佈
本頁內容
概述
引數
機率密度函式
累積分佈函式
示例
相關分佈
參考
另請參閱
相關主題
Main Content
泊松分佈
概述
泊松分佈是單引數曲線族,它對隨機事件的發生次數進行建模。此分佈適用於涉及計算在給定的時間段、距離、面積等範圍內發生隨機事件的次數的應用情形。應用泊松分佈的例子包括蓋革計數器每秒咔嗒的次數、每小時走入商店的人數,以及網路上每分鐘的丟包數。

Statistics and Machine Learning Toolbox™ 提供了幾種處理泊松分佈的方法。

可透過對樣本資料進行機率分佈擬合或透過指定引數值來建立機率分佈物件 PoissonDistribution。然後使用物件函式來計算分佈、生成隨機數等。

使用分佈擬合器以互動方式處理泊松分佈。您可以從該 App 中匯出物件並使用物件函式。

將分佈特定的函式(poisscdf、poisspdf、poissinv、poisstat、poissfit、poissrnd)與指定的分佈引數結合使用。分佈特定的函式可以接受多個泊松分佈的引數。

將一般分佈函式(cdf、icdf、pdf、random)與指定的分佈名稱 ('Poisson') 和引數結合使用。

引數
泊松分佈使用以下引數。

引數 描述 支援
lambda (λ) 均值 λ≥0
引數 λ 也等於泊松分佈的方差。

引數為 λ1 和 λ2 的兩個泊松隨機變數之和是一個引數為 λ = λ1 + λ2 的泊松隨機變數。

機率密度函式
泊松分佈的機率密度函式 (pdf) 是

f(x∣λ)=
λ
x
x!
e
−λ
 ; x=0,1,2,…,∞ .

結果是隨機事件發生的機率正好是 x。對於離散分佈,pdf 也稱為機率質量函式 (pmf)。

有關示例,請參閱計算泊松分佈 pdf。

累積分佈函式
泊松分佈的累積分佈函式 (cdf) 為

p=F(x∣λ)=e
−λ
floor(x)

i=0
λ
i
i!
.

結果是隨機事件發生的機率最多為 x。

有關示例,請參閱計算泊松分佈 cdf。

示例
計算泊松分佈 pdf
計算引數 lambda = 4 的泊松分佈的 pdf。

x = 0:15;
y = poisspdf(x,4);
用寬度為 1 的條形繪製 pdf。

figure
bar(x,y,1)
xlabel('Observation')
ylabel('Probability')

計算泊松分佈 cdf
計算引數 lambda = 4 的泊松分佈的 cdf。

x = 0:15;
y = poisscdf(x,4);
繪製 cdf。

figure
stairs(x,y)
xlabel('Observation')
ylabel('Cumulative Probability')

比較泊松分佈和正態分佈的 pdf
當 lambda 較大時,泊松分佈可以用均值為 lambda 和方差為 lambda 的正態分佈來逼近。

計算引數 lambda = 50 的泊松分佈的 pdf。

lambda = 50;
x1 = 0:100;
y1 = poisspdf(x1,lambda);
計算對應正態分佈的 pdf。

mu = lambda;
sigma = sqrt(lambda);
x2 = 0:0.1:100;
y2 = normpdf(x2,mu,sigma);
在同一個軸上繪製這些 pdf。

figure
bar(x1,y1,1)
hold on
plot(x2,y2,'LineWidth',2)
xlabel('Observation')
ylabel('Probability')
title('Poisson and Normal pdfs')
legend('Poisson Distribution','Normal Distribution','location','northwest')
hold off

正態分佈的 pdf 高度逼近泊松分佈的 pdf。

相關分佈
Binomial Distribution - 二項分佈是雙引數離散分佈,它對 N 次獨立試驗的成功次數進行計數,成功機率為 p。泊松分佈是二項分佈的極限情況,其中 N 趨向無窮,p 趨向零,而 Np = λ。請參閱Compare Binomial and Poisson Distribution pdfs。

Exponential Distribution - 指數分佈是具有引數 μ(均值)的單引數連續分佈。泊松分佈對隨機事件在給定時間內發生的次數計數進行建模。在這種模型中,事件的時間間隔服從均值為
1
λ
的指數分佈。

正態分佈 - 正態分佈是雙引數連續分佈,具有引數 μ(均值)和 σ(標準差)。當 λ 較大時,泊松分佈可以用具有 μ = λ 和 σ2 = λ 的正態分佈來逼近。請參閱比較泊松分佈和正態分佈的 pdf。

參考
[1] Abramowitz, Milton, and Irene A. Stegun, eds. Handbook of Mathematical Functions: With Formulas, Graphs, and Mathematical Tables. 9. Dover print.; [Nachdr. der Ausg. von 1972]. Dover Books on Mathematics. New York, NY: Dover Publ, 2013.

[2] Devroye, Luc. Non-Uniform Random Variate Generation. New York, NY: Springer New York, 1986. https://doi.org/10.1007/978-1-4613-8643-8

[3] Evans, Merran, Nicholas Hastings, and Brian Peacock. Statistical Distributions. 2nd ed. New York: J. Wiley, 1993.

[4] Loader, Catherine. Fast and Accurate Computation of Binomial Probabilities. July 9, 2000.

另請參閱
PoissonDistribution | poisscdf | poisspdf | poissinv | poisstat | poissfit | poissrnd

相關主題
Working with Probability Distributions
Supported Distributions

相關文章