필터 지우기
필터 지우기

Troubles with Lillietest and chi2gof

조회 수: 1 (최근 30일)
Sasi
Sasi 2012년 1월 26일
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.

채택된 답변

Wayne King
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
Sasi
Sasi 2012년 1월 26일
So you mean the answer of [h,p]=chi2gof(x); and [h,p]=lillietest(x)should be the same?
Wayne King
Wayne King 2012년 1월 26일
You cannot guarantee that they will always be the same.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by