Book contents
- Frontmatter
- Contents
- Preface
- 1 Random variables
- 2 Statistical models and inference
- 3 R
- 4 Theory of maximum likelihood estimation
- 5 Numerical maximum likelihood estimation
- 6 Bayesian computation
- 7 Linear models
- Appendix A Some distributions
- Appendix B Matrix computation
- Appendix C Random number generation
- References
- Index
Appendix C - Random number generation
Published online by Cambridge University Press: 05 April 2015
- Frontmatter
- Contents
- Preface
- 1 Random variables
- 2 Statistical models and inference
- 3 R
- 4 Theory of maximum likelihood estimation
- 5 Numerical maximum likelihood estimation
- 6 Bayesian computation
- 7 Linear models
- Appendix A Some distributions
- Appendix B Matrix computation
- Appendix C Random number generation
- References
- Index
Summary
Chapter 6, in particular, took it for granted that we can produce random numbers from various distributions. Actually we can't. The best that can be done is to produce a completely deterministic sequence of numbers that appears indistinguishable from a random sequence with respect to any relevant statistical property that we choose to test. In other words, we may be able to produce a deterministic sequence of numbers that can be very well modelled as being a random sequence from some distribution. Such deterministic sequences are referred to as sequences of pseudorandom numbers, but the pseudo part usually gets dropped at some point.
The fundamental problem, for our purposes, is to generate a pseudorandom sequence that can be extremely well modelled as i.i.d. U(0, 1). Given such a sequence, it is fairly straightforward to generate deviates from other distributions, but the i.i.d. U(0, 1) generation is where the problems lie. Indeed if you read around this topic, most books will largely agree about how to turn uniform random deviates into deviates from a huge range of other distributions, but advice on how to obtain the uniform deviates in the first place is much less consistent.
Simple generators and what can go wrong
Since the 1950s there has been much work on linear congruential generators. The intuitive motivation is something like this. Suppose I take an integer, multiply it by some enormous factor, rewrite it in base – ‘something huge’, and then throw away everything except for the digits after the decimal point. Pretty hard to predict the result, no? So, if I repeat the operation, feeding each step's output into the input for the next step, a more or less random sequence might result. Formally the pseudorandom sequence is defined by
Xi+1 = (aXi + b)modM,
where b is 0 or 1, in practice. This is started with a seed X0.
- Type
- Chapter
- Information
- Core Statistics , pp. 233 - 240Publisher: Cambridge University PressPrint publication year: 2015