1

我有一組數據。我繪製了這些數據的直方圖,以瞭解它們的分佈情況,這給了我一個泊松分佈。我想把我的數據擬合成高斯。在Matlab下,是否有可能將泊松分佈擬合成高斯分佈?適合泊松分佈到正態分佈

enter image description here enter image description here

+0

可以使用正態分佈得到的泊松分佈的良好近似,但只有當泊松的平均值是足夠大的。你可能想看看這個http://en.wikipedia.org/wiki/Poisson_distribution#Related_distributions – mathematician1975 2014-09-28 09:53:59

+0

謝謝,但在我的情況下,我有一個非常低的值作爲我的輸入,通常給一個非常低的意思! -2.1643 <數據<6.5198 – Ahmed 2014-09-28 11:32:00

+1

嗯,但如果你有負值,那麼你不能真正形容它作爲泊松... – mathematician1975 2014-09-28 11:40:29

回答

0

使用normfit獲得平均並安裝到您的數據Gassian分佈的標準偏差,然後normpdf生成PDF格式。

下面是一個發明數據的例子。這種情況下的數據具有三角形分佈(不是泊松分佈),但是這個想法是相同的:高斯函數適合於它。

請參閱上述鏈接normfit選項。

%// Random data 
data = sum(rand(2,1e4)); %// sum of two uniform RV's gives a triangular pdf 

%// Plot normalized histogram (empirical pdf) of data 
edges = 0:.1:2; 
[yh xh] = hist(data, edges); 
bar(xh, yh/numel(data)/(edges(2)-edges(1))) 

%// Compute and plot Gaussian fit 
[mu, sigma] = normfit(data); 
hold on 
xf = -1:.01:3; 
plot(xf, normpdf(xf, mu, sigma), 'r'); 

enter image description here

+0

我已經對我的數據應用了相同的代碼,並且我在我的問題中獲得了附加的直方圖,我無法解釋零和兩個值 – Ahmed 2014-09-29 10:23:31

+0

那麼,您的直方圖似乎有兩個尖峯。如果您使用不同的數據並且尖峯仍然存在,那意味着數據不是泊松 – 2014-09-29 11:10:49