ヒストグラムからノイズの算出方法
Afficher commentaires plus anciens
matlabで以下の様なヒストグラムを作成し、近似曲線を引きました。そこからノイズを算出したいのですが方法ありました教えてください。

以下作成したプログラムになります。
nbins = 18;
total_counts = zeros(1,nbins);
for i = 1:31
if i<10
daystr = ['0', num2str(i)];
else
daystr = num2str(i);
end
for k = 0:7
j = 3*k;
if j<10
hour = ['0', num2str(j)];
else
hour = num2str(j);
end
filename = ['TS2004.07.',daystr,'.',hour,'00.txt'];
y = load(filename);
x = y(y<330 & y>260);
[counts,edges] = histcounts(x,nbins, 'Normalization', 'pdf');
total_counts = total_counts + counts;
end
end
center = (edges(1:end-1)+edges(2:end))/2;
bar(center,total_counts,1);
アドバイスいただければ幸いです。
1 commentaire
Geoff Hayes
le 20 Sep 2016
Google translation:
Title: The method of calculating the noise from the histogram
In a histogram such as the following , it drew the approximate curve . Please tell me I want to calculate the noise from there there was method .
histogram image
It will be on the program that was created following
code
If it is possible advice we hope
Réponses (1)
michio
le 21 Sep 2016
3 votes
ここでの「ノイズ」はどう定義されますでしょうか。 ビン数に依存する指標ではありますが、ヒストグラムの近似曲線(確率密度関数?)からのずれということであれば、近似曲線のビンの中央での値との差で計算できます。
2 commentaires
Naoki Ishibashi
le 21 Sep 2016
michio
le 21 Sep 2016
fitdist 関数で正規分布近似し、ビンの中央 center での分布確率の差を計算した例を記載しますが、、いかがでしょうか。複数回分のカウント数を足し合わせた total_counts の場合は、ファイル数で割るなどの処理が追加で必要かもしれませんので、注意してください。
x = randn(10000,1);
[total_counts,edges] = histcounts(x,'normalization','pdf');
center = (edges(1:end-1)+edges(2:end))/2;
bar(center,total_counts,1);
distribution = fitdist(x,'normal');
y_dist = pdf(pd,center);
difference = y_dist - total_counts
plot(total_counts)
hold on
plot(y_dist)
hold off
Catégories
En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!