how to plot probability density of a given data
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I tried to get something like this
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/162264/image.png)
i want to know if ksdensity is the best solution
Thanks in advance
0 个评论
回答(1 个)
the cyclist
2016-4-23
I would say that there is a very good chance that ksdensity is the function you want to use. If you want a smooth curve that estimates the probability density function of your data, then it's a good choice.
The main question, which you do not provide any information about, is "What is your input data?" Do you have a sample of actual data that you want the density of? That's what you'll need to use ksdensity.
4 个评论
Image Analyst
2016-4-23
fitdist() can take as an input quite a number of distributions to fit your data to, not only Normal. If you believe you have one on its list, then put that in.
Do you have any theory as to what your distribution might be? Otherwise, can you show us a screenshot of the histogram of your actual data - the actual observations instead of the smooth theoretical curve you showed so far?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!