Reputation:
I computed CDF of my empirical distribution using ecdf()
function in Matlab for a distribution with 10,000
values. However, the output that I get from it contains only 9967
values. How can I get total 10,000
values for my CDF? Thanks.
Upvotes: 1
Views: 1480
Reputation: 74940
From a distribution with 10'000 values you'd expect an output of length 10'001. Most likely, your distribution contains 44 NaNs, or duplicate values. The former you check with sum(isnan(data(:))
, the latter with length(unique(data(:))
.
>> out = ecdf(1:5)
out =
0
0.2000
0.4000
0.6000
0.8000
1.0000
>> length(out)
ans =
6
>> out = ecdf([1:5,NaN,NaN])
out =
0
0.2000
0.4000
0.6000
0.8000
1.0000
>> length(out)
ans =
6
>> out = ecdf([1:5,5,5])
out =
0
0.1429
0.2857
0.4286
0.5714
1.0000
>> length(out)
ans =
6
Upvotes: 4