Runstest: a good interpretation

1 次查看(过去 30 天)
I've found this thing:
I generate 100000 random numb through rand but sometimes the null hypotesis is rejected. For see this thing here is the code:
tr = 300;
hyp = nan(1,tr);
for n = 1:tr
a=rand(1,100000);
[h,p]=runstest(a,median(a));
hyp(n) = h;
end
perc_one=size(find(hyp),2)/300;
where in my case:
perc_one=0.04
How could we interpret runstest? ok it tests the randomness of the order but in each step of the previous generation the coeff of correlation (corrcoef) is near zero so i dont understand how these two tests are related.
  2 个评论
dpb
dpb 2018-4-1
They're not all that directly related; one is the overall test of the whole sample as an aggregate; the other tests whether there are sub-sequences within the series that may appear non-random.
Also, remember that on occasion a truly random sample may just "appear" nonrandom. You can toss 5 heads in a row with a fair coin.
Damiano Capocci
Damiano Capocci 2018-4-1
Just few hours ago I made this point. :)

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Hypothesis Tests 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by