Troubles with Lillietest and chi2gof
2 次查看(过去 30 天)
显示 更早的评论
Hi
I generate 100 numbers which came from a normal distribution, and when I use lillietest I get the answer h=0 but when I use the chi2gof test I get the answer h=1.
here is my codes:
A=randn(1,100);
chi2gof(A,'cdf',@(z)normcdf(z,mean(A),std(A)),'nparams',2)
ans =
1
lillietest(A)
ans =
0
can someone please explain why it is like this?
Tanx
[Merged information from other question]
Hello,
I have a problem with hypothesis tests in MATLAB. I have a dataset and I want to know what is the distribution of this dataset. At the first try I used Lillietest which can show me if my data is coming from a normal distribution family or not. At second try I used chi2gof test. Here is the problem, the data which lillietest find it normally distributed, chi2gof test finds it not normally distributed. I want to know what is the difference between this two tests.
0 个评论
采纳的回答
Wayne King
2012-1-26
I don't get that Sasi:
rng default; % let's make sure we're using the same vector
x = randn(100,1);
[h,p] = chi2gof(x,'cdf',{@normcdf,mean(x),std(x)});
Note that the above is the same as:
[h,p] = chi2gof(x);
hL = lillietest(x);
2 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Hypothesis Tests 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!