Rudina zeqirllari wrote:
> i am a student and i'm working with matlab, in order to create my own rng. I have written a program in matlab and it produces numbers between 0 and 1. now i should test them(if are random). my numbers have a beta distribution with shape parameters a=b= 0.5. (I have seen the histograms and i have used betafit in order to find a and b). i have test these numbers only with runstest. now i have some questions:
> 1) is this test a randomness test and it is used for numbers with a beta distribution?
> 2) There are other randomness tests in matlab(for numbers with a beta distribution)?
> 3) if no, how can i convert this distribution (beta) in a unifom one,in order to test them with other randomness test?
Rudina, I assume what you mean is that your generator was designed to produce values from a Beta(.5,.5) distribution, and you are trying to check that assumption. One thing you can do is to use a onesample KS test on a large number of samples of size, say, 1000. The pvalues across a large number of independent samples ought to be uniformly distributed, since the null hypothesis is true.
To transform to a uniform distribution, use the inverse CDF for your distribution. For example,
b = betarnd(.5,.5,1000,1);
u = betainv(b,.5,.5);
There is a large amount of research and literature on testing random number generators. I recommend looking at some of the papers and software by Pierre L'Ecuyer, e.g.,
<http://www.iro.umontreal.ca/~simardr/testu01/tu01.html>
for ideas on what tests you might want to try. Most of them should be pretty easy to implement in M.
Hope this helps.
