# Is cumulative sum large deviation an alarm for bad normal pseudo-random number generator?

Given a pseudo-random number generator of standard normal distribution, I generate a matrix $(z_{t,n})_{(t,n)=(1,1)}^{(T,N)}$ of samples. I computed the mean of the cumulative sum, i.e., $\displaystyle s_t = \frac1N\sum_{n=1}^N\sum_{s=1}^tz_{s,n}$. The expected standard deviation of $s_t$ should be $\sigma(s_t)=\sqrt\frac{t}{N}$. However, for $(T,N)=(600,4000)$, I have several $|s_t|$'s exceeding $2.5$-$3$ times $\sigma(s_t)$. Does this indicate the pseudo-random number generator is bad?

Your $s_t$ should be normally distributed. If a variable is normally distributed, you expect it to fall more than $2\sigma$ from the mean 4.5% of the time, and more than $3\sigma$ from the mean 0.27% of the time. So having "several" values beyond these bounds doesn't indicate that your RNG is bad.
• Thank you for the answer. I am aware of all you have said except the Dieharder test suite. The Kolmogorov-Smirnov test is best performed on the original sample itself rather than $s_t$. I was wondering if there was anything gained from examining the cumulative sum instead of the sample themselves. I was not clear about it in this question. I actually asked about the normality and independence test in another related question stats.stackexchange.com/q/280610/44368. I would very much like to hear your opinion there.