SEED VARIABLES AND RANDOM NUMBER GENERATION

At the most basic level, the random element in a financial simulation model is a random variable, which is a quantification that can change. How a random variable is first established and how it changes each time is critical. The first and most obvious characteristic of a random variable is that it is random, meaning that the random variables created should not evolve and repeat in a pattern. The two key elements to preventing repetition are the initial starting point or seed state and the algorithm used to create the random variables.

Prior to explaining the details of a seed variable and random number generation algorithms, we should pause a moment to reflect that the mere mention of using a seed variable suggests that the numbers are not truly random. The proper terminology for random numbers that have deterministic attributes is pseudorandom numbers. More advanced methods of creating random numbers use observable real-world phenomena that can be detected and converted numerically. For example, low-level thermal or voltage change can be measured and converted to a numeric value. I once read that the decay of radioactive material would be one of the best random number generators. I could just picture a junior analyst at an investment bank with his computer hooked up to a protective, radiation-proof box containing uranium, explaining to his boss that he needs it to run his simulations. For practical computational purposes in finance, we will be creating and working with pseudorandom numbers.

The first critical part of generating pseudorandom numbers is determining how to select a seed state. As its name suggests, it is the beginning or first growth point of a series of pseudorandom variables. If the same pseudorandom number generation algorithm were applied to the same seed state, the same series of pseudorandom numbers should be produced. Since the evolution of the pseudorandom numbers is predicated on the value of the seed state, seed states themselves should be as random as possible. Many pseudorandom functions use the precise time the random variable is initiated as the seed state. In other cases some analysts want to be able to repeat the chain of pseudorandom numbers that were generated, and they have systems that allow them to enter a specific seed state.

Once a seed state is selected, an algorithm is required to create pseudorandom variables at future time steps. Such algorithms have evolved over the last few decades, constantly improving to eliminate repetitive elements. For the purposes of this book we will be relying on Excel's algorithm to generate a pseudorandom number, which has been a bit controversial. The pseudorandom number generator in versions of Excel prior to 2003 is problematic when used with millions of iterations. For these reasons Microsoft changed the pseudorandom number generator in 2003. Microsoft states that its new pseudorandom number generator passes a series of professional standard tests:

The battery of tests is named Diehard. The algorithm that is implemented in Excel 2003 was developed by B.A. Wichman and I.D. Hill. This random number generator is also used in the RAT-STATS software package that is provided by the Office of the Inspector General, U.S. Department of Health and Human Services. It has been shown by Rotz et al. to pass the DIEHARD tests and additional tests developed by the National Institute of Standards and Technology (NIST, formerly National Bureau of Standards).

For most users' purposes, this level of sophistication is sufficient. For those who seek further advancement in pseudorandom number generation, there are third-party add-ins such as ZRandom, which uses the Mersenne Twister algorithm.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset