The Monte Carlo Method: Replicating Nature inside a Computer
January 17, 2014
Monte Carlo simulation is a way of solving complex and difficult mathematical problems, mostly those involving differential equations, using computers.
In other words, Monte Carlo simulation is just a "computer experiment". In conventional theory, we have an equation which can be solved in a closed form. This means the solution of a certain mathematical equation, such as the Black-Scholes equation in finance or the wave equation in quantum mechanics, yields a precise "formula" (a mathematical relationship between the input and output variables) which gives the state of the system. What the equation or the formula does is helps us in understanding and visualizing what happens when a natural system - a physical or a financial system, for example - moves from one state, or "configuration", to another. In other words, the equations and formulas help us study the time evolution of a natural system.
But what if we have a mathematical equation about the state of a system - say, a rather complex one - and are unable to solve it and arrive at a formula. What if the solution of an equation is either quite laborious or time consuming or cannot be found altogether. Nature is extremely complex and many a times it is not easy to study natural systems via mathematics. That is a time when we take the approach of an experimentalist. An experimentalist - someone who performs experiments to study a system as opposed to someone who draws up mathematical conjectures about the state of a system - studies nature in a laboratory. She performs measurements in the laboratory. In nature there exists a certain "configuration", of the system, and the experimentalist takes this configuration and observes a value for some quantity that she is studying. Nature presents us with a very large number of configurations, theoretically infinite, but the experimentalist - no matter how long she's at the experiment - will only be able to explore an extremely small subset of these configurations. Once she observes the values, she then averages over them to get to her objective which is to find out what is the new state of the system.
Thus observing values of certain variables which define the state of a system and then averaging over these values an experimentalist studies the temporal evolution - i.e. evolution with respect to time - of a system.
In a Monte Carlo method we replace nature with a computer. The computer now generates various configurations - based on rules supplied to it - and the experimentalist makes the observations. Thus, in a Monte Carlo method what is of paramount importance is to figure out how to present the computer with rules - or, give instructions to the computer - so that it can appropriately generate the states of "nature".
All this begs a very important question, one that has prompted us to write this article. Time and again students in our CFE classes and tutorials ask this question: does the time step matter? In other words, since Monte Carlo simulation is studying the temporal evolution of a system does it matter how we slice time - in millionth of a second, seconds, minutes, hours, days or weeks - to study the evolution of the system. As stated in the beginning of this article in Monte Carlo method we study systems which are governed by differential equations and these differential equations contain terms such as where is the differential operator with respect to time. If we have to experimentally understand such equations on a computer we need to figure out how small should "" be, ideally. Or, more importantly, does the size of "" - which is the time step - matter.
In physical sciences there are two approaches.
When we study classical systems using Monte Carlo method in a computer we actually code the microscopic equations that govern the temporal evolution of the system. We move the position and velocity forward by small time steps such as, and (where, and are position and velocity respectively) and then compute the force and acceleration on the system. Therefore, we are actually coding the governing equation of a system at a microscopic level.
However, in statistical mechanics, where Monte Carlo method is most widely used, and thankfully in quantitative finance - which is another area where Monte Carlos method is widely and heavily used - the microscopic evolution of paths that a system takes does not matter. If the final state of a system is at time and the system is currently in state then it does not matter what path the function, , takes to go from to . In the language of statistical mechanics the paths that and - the position and velocities - of the particles take in phase space are irrelevant. What is relevant is the probability that is used to generate the configuration of the system at time, . The probability, - or, - is all that matters. If we have that then we can get all our answers about how the system will look like at time in future given that we are at a present time .
In quantitative finance when we are simulating the stock price over a period of one year - that we are trying to see how the stock price will evolve over the next one year given we are at time , which is "today" - we are experimenting with a differential equation (which is called a stochastic differential equation, where "stochastic" means "random") for the stock price that has a probability measure embedded in it. This probability measure governs the system's evolution over time and when we perform the experiment we ask the computer - that is, give instructions to it - to generate this probability measure (which is generated from a probability distribution).
It is a fascinating experience to see nature unfold, albeit in a somewhat tentative manner, inside a computer.
Lecture Notes of Professor Richard T. Scalettar, Physics Department, University of California, Davis
Any comments and queries can
be sent through our
More on Quantitative Finance >>
back to top