How to get probability of new data point from probability object (fitdist)?

你离开我真会死。 提交于 2019-12-12 02:49:22

问题


I have fitted several probability distribution to my dataset by using the Matlab fitdist function in the following way:

pd = fitdist(myDataset,distname)

From this function I got a probability distribution object pd. I now that I can calculate mean(pd), std(pd), median(pd) etc.

But how can I calculate the probability of a new data point according to the fitted distribution?


回答1:


You can evaluate the probability value thanks to the pdf() function.
First of all you can create your probability distribution object thanks to the fitdist() function, as you already did actually.

pd = fitdist(myDataset,distname);

Now, to gather the probability value for a point myPoint you can use pdf() as follows:

myProb=pdf(pd,myPoint);

where pd is the output from fitdist() and myPoint can either be a single point or a vector of points. Consequently, myProb will be a single point or a vector or points (respectively) since each value in myProb corresponds to a value in myPoint.



来源:https://stackoverflow.com/questions/35923750/how-to-get-probability-of-new-data-point-from-probability-object-fitdist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!