2

I have a set of data that has following histogram:

enter image description here

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.

data.dat

Nick X Tsui
  • 160
  • 4
  • 1
    Try `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:16
  • @MatthewGunn I seem not to have histogram() function built in my MATLAB. Mine is 2014. – Nick X Tsui Mar 07 '17 at 18:44
  • use `hist` then. Some other ideas: (1) `x = sort(dct)` and then inspect `x` by hand. (2) A tool for comparing distributions you should be aware of is [qqplot](http://stats.stackexchange.com/questions/101274/how-to-interpret-a-qq-plot). – Matthew Gunn Mar 07 '17 at 19:07

0 Answers0