Chapter Five

Random Variate Generation

Armed with a suitable model of uncertainty, possibly one of those described in Chapter 3, whose parameters have been estimated as illustrated in Chapter 4, we are ready to run a set of Monte Carlo experiments. To do so, we must feed our simulation program with a stream of random variates mimicking uncertainty. Actually, the job has already been done, at least for R users trusting the rich library of random generators that is available. So, why should we bother with the internal working of these generators and learn how random variates are generated? Indeed, we will not dig too deep in sophisticated algorithms, and we will also refrain from treating generators for a too wide class of probability distributions. Still, there are quite good reasons to get a glimpse of the underpinnings of random variate generation. The aims of this chapter are:

To gain an understanding of the different options that R offers: for instance, there are alternative generators that can be set and controlled with the RNGkind function.
To understand how to manage seeds of random generators, which is essential for debugging and controlling experiments.
To have an idea of ...

Get Handbook in Monte Carlo Simulation: Applications in Financial Engineering, Risk Management, and Economics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.