ABSTRACT

Step 1 is an example of model building. Typically we build up a complex model from simple components, which in this case are independent rv’s with known distributions. In other words, random variables are the building blocks of stochastic simulations. As we have seen, R has built-in functions for simulating all the common rv’s we encountered in Chapters 15 and 16. The purpose of this chapter is to see how to do this for ourselves, so that we have the tools for simulating the random variables that R does not provide for us. We consider discrete random variables, the inversion and rejection methods for simulating continuous random variables, and then look at particular techniques for simulating normals.