13.1 Introduction
When we do a simulation, we have to make many assumptions. One major assumption is the choice of the distribution to use for a particular variable. Each particular distribution has parameters that are integral to generating data from the distribution. We need to set a value for these parameters to simulate a value from a distribution.
How we decide that choice of distribution and the manner in which the values of the parameters are to be estimated are beyond the scope of this chapter.
Given a particular distribution and known parameters, we can generate values from that distribution. However, in reality, we never know the true distribution, and we never know the exact parameter values needed to generate values from that distribution. Practical statistical analysis helps us to identify a good choice of the distribution and estimate reasonable parameters.
We can think of the simulated values as a sample of a larger population. Samples with a large number of values will better reflect the properties of the distribution of the larger population.
In what follows, examples are shown to generate values from a normal, Bernoulli, Uniform, Poisson, and Gamma. The last subsection shows how to combine simulating first from a Poisson and then from Gamma distribution to illustrate how more complex processes can be simulated simply.