Two-sample Anderson-Darling tests
Show older comments
Is there a function in Matlab which can perform a 2-sample Anderson-Darling test, as described/shown on Cross Validated or on R?
Indeed, to me, it looks like that the Matlab function called adtest, is not distribution-free (i.e. it is not non-parametric), and it is limited to some known distributions (i.e. 'norm', 'exp', 'ev', 'logn' and 'weibull'). However, the Anderson-Darling test should be distribution-free, which means that I can take, in the two-sample test, any empirical distributions as inputs for the two-sample Anderson-Darling test. In my case, I have two empirical distributions (coming from two datasets) that I would like to use as inputs for the two-sample Anderson-Darling test.
Answers (1)
Star Strider
on 4 Aug 2024
1 vote
I am not certain what you want, however the two-sample Kolmogorov-Smirnov test (kstest2) appears to be distribution-free, at least as I read the documentation for it. It may do what you want.
From the documentation: it ‘returns a test decision for the null hypothesis that the data in vectors x1 and x2 are from the same continuous distribution’.
5 Comments
Star Strider
on 4 Aug 2024
My pleasure!
I also did a search for the two-sample Anderson-Darling test in the File Exchange and in a general interweb search, however no function for it has been written in MATLAB that I can find.
The only reference that I can find is in the Wikipedia article on the Anderson-Darling test Non-parametric k-sample tests however that would require coding it. (I am not averse to doing that, however that would first require my understanding the assumptions behind it and writing the code for it, and then devising a way to test the code. That would take a while, since your question is the first I have heard of it.) I also do not know how that statistic is itself distributed, and if a confidence interval could be calculated for it.
Star Strider
on 5 Aug 2024
You will have to ask the author of the MATLAB function about that. (All I did was to provide the search information.)
Sim
on 5 Aug 2024
Categories
Find more on Hypothesis Tests in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!