Tutorial 3
Tutorial 3
Tutorial 3
Since RNGs are completely deterministic, we need to test them to see if they appear to be
random and IID uniform on [0, 1]. Most computers will have built-in RNGs but unless software
is designed for simulation the RNGs can be extremely poor and may not be adequate to be used to
generate random variates in a stochastic model. It is recommended to test such generators before
usage (or any generator in general) with one of the following tests. There two types of tests:
empirical tests
theoretical tests
In the empirical test the Ui’s produced by the generator themselves are used to check how
good is the generator using any of the statistical tests available.
The theoretical test on the other hand uses the parameters of the generator to assess it
globally without actually generating any random numbers. So this test is not actually a test in the
statistical sense.
2- Divide the range RN- R1 in n equidistant intervals such that each interval has at least 5
observations
3- Calculate
where:
Oi = the number of observations in the ith class
Ei = the expected number in the ith class
n = the number of classes
4- For significant level α, utilize the table of percentage points of the Chi square distribution
with v degrees of freedom to determine
5- If ≤
Accept: “No difference between and F(x)
If >
Reject