MATLAB Answers

How to obtain CDF from large dataset?

2 ビュー (過去 30 日間)
Tania Islam
Tania Islam 2019 年 11 月 7 日
Commented: Bjorn Gustavsson 2019 年 11 月 7 日
I have a dataset of containing 10000 values.
I want to generate their CDF and want to plot them figure.
How can I do that?
This is the sample image.
untitled.jpg

  0 件のコメント

サインイン to comment.

件の回答 (1)

Bjorn Gustavsson
Bjorn Gustavsson 2019 年 11 月 7 日
Have a look at the help and documentation of the function ksdensity - that is one way to do this with the least amount of assumptions on the CDF.
HTH

  2 件のコメント

Tania Islam
Tania Islam 2019 年 11 月 7 日
By using ksdensity , I got the sample figure in the questions. But when I am testing it with the small data. its looks like, its not working perfectly.
Moreover, figure legend is not working when I am using ksdensity.
Currently I am using the following command. But I am not sure, is it the right way or not?
figure(3)
ksdensitydataset,'Support','positive','Function','cdf','NumPoints',50)
Bjorn Gustavsson
Bjorn Gustavsson 2019 年 11 月 7 日
The problem with the "legend not working" you solve by calling ksdensity with output-parameters and plot yourself - that way you get the normal handles to the lines and legend will work fine.
The reason that "it is not working perfectly" sounds like you have too few points for ksdensity to estimate a smooth CDF - if you have too few points then you will not get as good an estimate...

サインイン to comment.

サインイン してこの質問に回答します。

タグ


Translated by