Runstest: a good interpretation

1 回表示 (過去 30 日間)
Damiano Capocci
Damiano Capocci 2018 年 3 月 31 日
コメント済み: Damiano Capocci 2018 年 4 月 1 日
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 Center および File ExchangeHypothesis Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by