Wednesday, October 18, 2006

Other parameters of distribution

Unlike normal distribution, variance and mean are not the only parameters of all distribution. And as you know K-S is a non-parametric test and works with all distributions. So, if there is a skewness factor in a distribution, it can make difference in a two sample set which they have same mean and variance. look at the below example. two series y1 and y2 are almost same in Variance and Mean (with a little bit more trial and error you can get even better results). the distribution type of these two sample is the same too. t-test can not catch the difference, but ks shows a very significant difference:

clc
x = linspace(-3,6,1000);
y1 = gevpdf(x,-.5,1.2,0);
y2 = gevpdf(x,0,1,0);
meanY1=mean(y1)
meanY2=mean(y2)
varY1=var(y1)
varY2=var(y2)
[h p]=ttest(y1,y2)
[hKs pKs]=kstest2(y1,y2)
plot(x,y1,'-', x,y2,'-');

No comments: