How to derive probabilities from density function?
3 次查看(过去 30 天)
显示 更早的评论
Hello,
I want to use the density function to find probabilities of unit intervals. In the distribution fitting app of Matlab, I draw two distributions I would like to compare. The Nakagami(blue) and the normal distribution (red).
Matlab documentation says that there is a pdf argument that should be added. I tried some combinations, now I have a code that does not give me any error, but the code is not good. It gives me the probabilities based on the counts. So the last line of my code does not work as it should. It should give me probabilities for the unit intervals: [<-5,-4>, [-4,-3>,...., [98,99>, [99,100>, [100,inf>. And that would differ for both distributions. How should I include a specific distribution in the arguments? Or should it be derived from the app? Does anyone have a suggestion for me?
Thank you in advance.
The code is:
Given:
U=[0:9];
lamda=0.42;
Y = poisspdf(U,lamda);%computes the Poisson pdf at each of the values in U using mean parameters in lambda.
W=[-5:100];
a=rand(10,1)+U'.^2;%A range of 10 values that I would like to analyse
pdfCounts=hist(a,W);%derive the pdf based on the histogram
pdfDensity=hist(a,W,'Normalization','pdf');%derive the pdf based on the densityplot
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!