Runstest: a good interpretation
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
dpb
el 1 de Abr. de 2018
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.
Respuestas (0)
Ver también
Categorías
Más información sobre Hypothesis Tests en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!