![]() Consequently, this is the method I have chosen to use in this project. This is exactly what we need for ‘latin hypercube’ sampling. The two most general methods, in the sense that they can be made to return distributions with any possible functional form, are the acceptance-rejection method and the inverse transform method, the latter has the further advantage that it can easily be made to return values from equal-probability subdivisions of the range of our desired random variable. Other methods are more general and can produce random numbers conforming to many different distributions. Most of them are specific to particular distributions with, as you might expect, the normal having the most. We want to convert a random variable that is uniformly distributed on the range [0, 1), as supplied by VBA’s Rnd() function, into a random variable distributed according to any desired distribution. Ways of generating non-uniform random variables As we are trying to develop a tool that is of fairly general applicability, we need a method that will generate samples distributed according to any distribution we may choose. Out there ‘in the wild’ random variables occur in all shapes and sizes, not just the standard ones. Excel and many other applications natively provide a random function that returns values that are uniformly distributed on the range [0, 1). The object of the exercise is to generate an array of random numbers that are distributed according to a given frequency distribution. Today’s post describes how to generate random numbers according to arbitrarily chosen probability distributions using the inverse transform method. It follows on from yesterday’s, where I gave an overview of the problem and how I propose to tackle it. Welcome back! This is number two in a series of five blog posts that describe how to construct a Monte Carlo risk analysis application in Excel VBA.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |