next up previous index
Next: Congruential Methods Up: Numerical Analysis for Statisticians Previous: Examples   Index

Random Number Generation

Read the following web site pages: http://www.maa.org/mathland/mathland_4_22.html

http://stat.fsu.edu/$\~$geo/diehard.html

And read chapter 7 of Numerical Recipes.

Motivation:
Random numbers are used:
1- To solve problems that are too complex (stochastic algorithms for NP complete problems)

2- For optimization (simulated annealing, genetic algorithms).

3- System Simulation (physics and biology, econometrics...)

4- Non-parametric tests, bootstrap, permutation tests.

5- Quadrature methods using Monte Carlo.

Solving a deterministic problem by rewriting it as equivalent to a problem with a stochastic component.

Little Example as a reminder of what Monte-Carlo is:

\begin{displaymath}\theta=\int_0^1 f(t)dt\end{displaymath}

If this exists it can be seen as $E(f(X))$ where $X$ has a uniform distribution on $[0,1]$. So we approximate it with

\begin{displaymath}\hat{\theta}= \frac{1}{N}\sum_{i=1}^N f(X_i)\end{displaymath}

for a sample of size $N$ of uniform random variables.

Most methods, even if they need non-uniform random variates, as in simulation, still use uniform random variables as their starting points.

So we will spend some time explaining the basics of random numbers.

The machine being deterministic, there is definitely a problem, we will never get purely random numbers, they will only look so.

(We already saw that there are some pretty bad ones, when we did the multidimensional visualization of the IBM randu generated numbers with xgobi).

Also beware of $srand$, the basic unix one is bad.

Every time I reconnect to matlab, it provides the same random number the first time I ask for one:

>> rand
ans =    0.9501

So it is quite predictable, and I could prove I am psychic.



Subsections
next up previous index
Next: Congruential Methods Up: Numerical Analysis for Statisticians Previous: Examples   Index
Susan Holmes 2002-01-12