Histogram to a CDF/PDF
조회 수: 37(최근 30일)
Hello, This is a screenshot of a table I have constructed for work.
Just to play it safe, I blacked out the column names, though it would be hard to assume anything with just 7 rows of the table to go off of. We will call the 5 fields "column1, column2, etc."
So I am able to create the hisogram of any of the columns, besides 3, but that isn't needed because it is all '94'.
and the histogram works perfectly.
How would I do a CDF or PDF of this data?
I have tried:
but nothing changes from the original histogram.
Alan Stevens 2020년 8월 24일
You can get a CDF as follows:
% Modified Kaplan-Meier CDF
% assumes each point is representative of 1/N of the population.
a = sort(a(:,1)); % so all the data for a are sorted in ascending order
N = length(a);
for k = 1:N
CDF(k) = (k - 0.5)/N;
Because you have a large number of points you could simply numerically differentiate the CDF to get a PDF.