Normalising histogram with certain pdf
9 次查看(过去 30 天)
显示 更早的评论
Hello,
At the moment I'm stuck with this problem.
I have done maximum likelihood estimation on my data sets and I have acquired the best alpha and beta parameters for Beta distribution.
I the end, I need to compare how well my Beta distribution compares with histogram of data.
[data_counts_1, bin_edges_1] = histcounts(x(:,2),bin_number);
x(:,2) is the column I need. I change bin_edges to bin_center in order to plot the curve of histogram.
beta_distribution = (1/B)*(t.^(alpha-1)).*((1-t).^(beta-1)); Is my beta distribution (I know I could have used matlab built-in function).
But in order to compare these two graphs, I need to normalize the histogram and it's quite a problem for me. If I try to normalize it as uniform distribution:
prob = data_counts_1/sum(data_counts_1);
plot(bin_centers, prob);
I get the result which does not make sense (it's the attached jpg).
My question is, how can I normalize the histogram as beta distribution?
I tried to find how to fit the histogram with my own distribution function (for example fitting histogram with beta function, where I send my own parameters for it) but I failed to find it.
0 个评论
回答(1 个)
the cyclist
2015-11-26
Which curve is which? The blue line seems like it might sum to 1, and therefore be properly normalized.
If the brown line is your beta distribution, then you could normalized it in similar fashion as you did with the histogram.
3 个评论
Image Analyst
2015-11-27
I'm not buying the assertion that dividing an arbitrary distribution by a scalar is valid only for Normal distributions. Where are you getting that from???
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!