2080 3

CSC328 ยท 2080 ยท 10 marks

What are the two main properties of random numbers? Test whether the 3rd, 7th, 11th, and so on numbers in the sequence in the following random number sample are auto-correlated. (Zalpha=0.05 and Z0.025=1.96) 0.12, 0.01, 0.23, 0.28, 0.89, 0.31, 0.64, 0.28, 0.83, 0.93, 0.99, 0.15, 0.33, 0.35, 0.91, 0.

What are the two main properties of random numbers? Test whether the 3rd, 7th, 11th, and so on numbers in the sequence in the following random number sample are auto-correlated. ($Z_{\alpha}=0.05$ and $Z_{0.025}=1.96$)

0.12, 0.01, 0.23, 0.28, 0.89, 0.31, 0.64, 0.28, 0.83, 0.93, 0.99, 0.15, 0.33, 0.35, 0.91, 0.41, 0.60, 0.27, 0.75, 0.88, 0.68, 0.49, 0.05, 0.43, 0.95, 0.58, 0.19, 0.36, 0.69, 0.87, [10]

Simulation and ModelingChapter 5: Random NumbersTests for Randomness - Uniformity and independenceNumerical: random number autocorrelation test

Two Main Properties of Random Numbers and Autocorrelation Test

Part 1: Two Main Properties

  1. Uniformity: The random numbers $R_i$ are uniformly distributed on $[0,1]$. Each value is an independent draw from a continuous uniform distribution with pdf $$f(x)=\begin{cases}1 & 0\le x\le 1\ 0 & \text{otherwise}\end{cases}$$ giving $E(R)=\tfrac12$ and $Var(R)=\tfrac{1}{12}$.

  2. Independence: Successive random numbers are statistically independent; the current value has no correlation with previous ones.


Part 2: Autocorrelation Test

Given Data

30 numbers, 1-indexed:

iRiRiR
10.12110.99210.68
20.01120.15220.49
30.23130.33230.05
40.28140.35240.43
50.89150.91250.95
60.31160.41260.58
70.64170.60270.19
80.28180.27280.36
90.83190.75290.69
100.93200.88300.87

Test: 3rd, 7th, 11th, ... โ†’ starting index $i=3$, lag $m=4$. $Z_{0.025}=1.96$, $\alpha=0.05$.

Step 1: Determine M

Standard formula (Banks/Carson): $M$ = largest integer such that $i + (M+1)m \le N$, with $N=30$.

$$3 + (M+1)\cdot 4 \le 30 \Rightarrow (M+1)\cdot4 \le 27 \Rightarrow M+1 \le 6.75 \Rightarrow M+1=6 \Rightarrow M=5$$

So we use indices $3, 7, 11, 15, 19, 23$: that is $M+1 = 6$ values forming $M+1 = 6$ terms... let me apply the standard autocorrelation formula precisely.

The autocorrelation estimator: $$\hat\rho_{im}=\frac{1}{M+1}\left[\sum_{k=0}^{M}R_{i+km},R_{i+(k+1)m}\right]-0.25$$

This requires indices up to $i+(M+1)m$. With $i=3,m=4$: $3+(M+1)4\le30\Rightarrow M+1\le6.75\Rightarrow M=5$.

Indices needed: $3,7,11,15,19,23,27$ (from $k=0$ to $M+1=6$).

Values: $R_3=0.23,\ R_7=0.64,\ R_{11}=0.99,\ R_{15}=0.91,\ R_{19}=0.75,\ R_{23}=0.05,\ R_{27}=0.19$

Step 2: Products $R_{i+km}R_{i+(k+1)m}$, k = 0..M (=0..5)

k$R_a$$R_b$product
00.230.640.1472
10.640.990.6336
20.990.910.9009
30.910.750.6825
40.750.050.0375
50.050.190.0095

$$\sum = 2.4112$$

Step 3: Compute $\hat\rho$

$$\hat\rho=\frac{1}{M+1}(2.4112)-0.25=\frac{2.4112}{6}-0.25=0.40187-0.25=0.15187$$

Step 4: Standard deviation

$$\sigma_{\hat\rho}=\frac{\sqrt{13M+7}}{12(M+1)}=\frac{\sqrt{13(5)+7}}{12(6)}=\frac{\sqrt{72}}{72}=\frac{8.4853}{72}=0.11785$$

Step 5: Test statistic

$$Z_0=\frac{\hat\rho}{\sigma_{\hat\rho}}=\frac{0.15187}{0.11785}=1.289$$

Step 6: Decision

Critical value $Z_{0.025}=1.96$.

Since $|Z_0| = 1.289 < 1.96$, we fail to reject the null hypothesis of independence.

Conclusion: There is no significant autocorrelation among the 3rd, 7th, 11th, ... numbers. They can be considered independent.


Common mistake: using $M = 6$ pairs and dividing by $M-1 = 5$, and then applying $\sigma = \frac{\sqrt{13M+7}}{12M}$ with that wrong $M$. The Banks-Carson convention gives $M = 5$, $\hat\rho = 0.1519$, $\sigma = 0.1179$ and $Z_0 \approx 1.29$. The conclusion (not autocorrelated) is the same, but the intermediate values are not.

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.