This Blog entry is from the Monte Carlo Model section in Learn R.
Monte Carlo Simulation is a technique to create many random simulations based upon a random case (i.e. a transaction). The random value can be forced to obey certain statistical assumptions, which in this example will be a triangular distribution. Monte Carlo simulation is an enormous topic in its own right yet this section of Blog entries are intended to give just a basic overview of the tool and allow for the simulation of models created in these procedures.
Simulation for Communication refers to being able to run models based on explainable statically assumptions so to facilitate expectation setting for the model's impact. Furthermore, that millions of random simulations will be exposed to the model, where records of both the randomly generated record and the output are retained, Monte Carlo simulation can help identify scenarios where there is potential for optimisation or risk mitigation.
There are many types of distributions that can be randomly simulated, supported by functions in R. The runif() and rnorm() functions are the most commonly used. The runif() function creates discrete values between a high and low amount. The rnorm function creates values inside a normal distribution, taking the minimum, maximum, mean and standard deviation as parameters.
For most business simulations, the triangular distribution is most practical, given that the normal distribution is quite rarely seen.