Normalising histogram with certain pdf
9 views (last 30 days)
Show older comments
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 Comments
Answers (1)
the cyclist
on 26 Nov 2015
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 Comments
Image Analyst
on 27 Nov 2015
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???
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!