I have a set of data that has following histogram:
I would like to guess it follows an exponential distribution. So I did some goodness of fit using KS test with MATLAB like following:
%% first load the data
fileID = fopen('data.dat','r')
dct= fread(fileID,'float');
fclose(fileID);
%% do distribution fitting
pd = fitdist(dct(:),'Exponential');
%% do ks test
test_cdf = makedist('exp', 'mu', pd.mu);
[h, p] = kstest(dct(:), 'CDF', test_cdf);
However, I got
h =
1
p =
0
which means the hypothesis that my data follows an exponential is rejected.
I am wondering where I got wrong? Or how can I confirm the data I have follows an exponential distribution? Thanks a lot. I am attaching the original data here.

histogram(log10(dct),100). There are a whole bunch of values around 4e-11, 6e-10, 2.5e-9 etc... It doesn't look exponential. – Matthew Gunn Mar 07 '17 at 16:16histthen. Some other ideas: (1)x = sort(dct)and then inspectxby hand. (2) A tool for comparing distributions you should be aware of is qqplot. – Matthew Gunn Mar 07 '17 at 19:07