1 / 35

The Monte Carlo Method for pricing financial derivatives

What is a Monte Carlo" Method?. The phrase Monte Carlo method" is very general.It describes a method of investigating a problem that uses random numbers and probability statistics to estimate some non-random value. Monte Carlo methods appear in many math related fields: physics, engineering, eco

nerita
Download Presentation

The Monte Carlo Method for pricing financial derivatives

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


    1. The Monte Carlo Method for pricing financial derivatives John Sonchack

    2. What is a “Monte Carlo” Method? The phrase “Monte Carlo method” is very general. It describes a method of investigating a problem that uses random numbers and probability statistics to estimate some non-random value. Monte Carlo methods appear in many math related fields: physics, engineering, economics, etc.

    3. A general algorithm for any Monte Carlo method Draw a bunch of random numbers Process each of these random numbers in some way, i.e. plug them into an equation or use them in some way Analyze the results to find an estimation for a non random value

    4. More about Monte Carlo methods Monte Carlo methods can help us solve problems that are too complicated to solve using equations, or problems for which no equations exist. They are useful for problems which have lots of uncertainty They can also be used as an alternate way to solve problems that have equation solutions. However, they have drawbacks: Monte Carlo methods are often slower and less accurate than solutions via equations.

    5. Basically, a Monte Carlo method is a way of solving complex problems through approximation using many random numbers. They are very versatile, but are often slower and less accurate than other available methods.

    6. An example: Monte Carlo approximation of Pi If one point was drawn at every possible point on this square, then: Thus, a simple Monte Carlo method to approximate Pi would be to simply generate lots of random coordinates on this square and then do: number of points not in the circle / number of points total. This should come increasingly close to Pi. (example)

    7. A Monte Carlo Method for Financial Derivatives We don’t know what a stock will do in the future over time T. Blackscholes assumes a Brownian motion to figure out what is most likely to happen to the price of a stock after time T. if we figure out a way to approximate a possible brownian walk of a stock over some period of time T, we can approximate the blackscholes value by: 1) doing many sample walks of the stock 2) computing the value of a derivative for each sample walk 3) averaging the trial derivative values together to come up with an expected value for the derivative

    9. Recalling the beginning of the semester… We need some way of coming up with these sample walks for the stock. We know that ds= µ*dt + s *dx Where: ds= change in stock price ( in percentage) µ = “drift” (which we assume to be r, the riskless interest rate, in order to match with black scholes assumptions) dt = change in time s = the volatility of the stock dx = a random normally distributed variable with mean 0 and standard deviation SQRT(dt)

    10. Applying the Monte Carlo method to financial derivatives, continued Since ds = the percent change of stock price from time a to b, we can replace ds with (Sb-Sa)/Sa We can then take this formula and solve for Sb, the value of the stock at some time in the future, as a function of a bunch of stuff that we know: (Sb-Sa)/Sa = µ*dt + s *dx so, (Sb-Sa) = Sa* µ*dt + Sa* s *dx Sb=Sa+ Sa* µ*dt + Sa* s *dx

    11. Applying the Monte Carlo method to financial derivatives, continued We can use this formula: S2=S1+ S1* µ*dt + S1* s *dx To come up with subsequent values of S in a sample random walk of a stock.

    13. A tangent: Maple programming Most Monte Carlo Methods are implemented via a computer program rather than solved by hand or with a calculator. It is impractical to do the number of trial runs needed to get accurate results by hand. As we know, Maple is not only a very advanced calculator, but a programming language geared towards mathematical programming. This makes it a good language to implement this method in.

    14. Basics about Maple Programming: Variables In Maple, we can assign numbers or more complicated functions to variables for later use by using the assignment operator. We can type things like x:=2; m:=18; b:=54.2352; y:=m*x+b; Then, if we ever want to use these values again, we can simply type in the name. If we typed in everything in the previous few lines, we could type y; and get a number result.

    15. Basics about Maple Programming: Arrays Suppose we had the heights of all of the people in the class, and we wanted to do stuff to these values in maple. We could assign each value to a separate variable, but this would be inconvenient for a number of reasons: (time consuming to enter, even more time consuming to access, etc) Maple ( and nearly every other programming language ) has a special kind of variable called an array that solves this problem.

    16. Arrays, continued An array is a like variable that can hold many values. We can create an array in maple by using the array command. Heights:= array([74, 60, 65]); we can then access these variables by using an index; i.e. we can say things like: 45.3*Heights[1]; Heights[2]:=38; or even Heights[i]; etc. Maple also lets us make empty arrays that we can fill at a later time by typing: Heights := array(1..N); Where N is the number of elements we want the array to contain.

    17. Basics about Maple Programming: for loops Maple (and most other programming languages) have what is called a for loop that allows us to repeat some lines of code a number of times while incrementing a variable. Suppose we have an empty array called values. (values:=Array(1..10); And we wanted to fill it with the squares of the first 10 integers. We could type: For i from 1 to 10 do values[i]:=i^2; Od; These three lines of code would make maple fill the entire array with the value of each index squared.

    18. For loop syntax A for loop always follows this syntax in Maple: For {variable name} from {start value} to {end value} do {commands} Od; (curly brackets and stuff inside should be replaced with values that you want)

    19. Basics about Maple Programming: Procedures A procedure is basically a bunch of lines of code that achieves one common purpose. Maple has many build in procedures that we’ve all used like: blackscholes(S, K, r, T, volatility);, plot([xvalues],[yvalues]);, histogram([numbers]);, etc We can often pass either numbers or variables to procedures. For example, the blackscholes function takes 5 such parameters, S, K, r, T, and sigma. The answer that the procedure returns depends entirely on the values of these parameters.

    20. Basics about Maple Programming: Writing your own procedure Maple also allows us to write our own procedure. We can write procedures using the proc() command. procedurename:=proc(x, y) z:=x+y; End proc; We would call this procedure like this: procedurename(5,1542.6); Here, x and y represent the values that the user gives the procedure. They are known as local variables, because they apply to the procedure only. Ex: if we type procedurename(2, 5); then inside of the procedure x:=2 and y:=5. This is for inside the procedure only; x does not equal 2 outside of the procedure.

    21. Basics about Maple Programming: Misc stuff If you type in x:= 5+3y; (with a semicolon at the end) maple will evaluate what you wrote, and also print out the new value of x. If you type x:= 5+3y: (with a colon, not a semicolon) maple will suppress output. Using a colon is useful when you’re writing procedures, because you don’t want the user to see the output from every line of code. If you just want to enter text and don’t want maple to evaluate a line of code, put a # in front of it. (maple will not evaluate ##Hello!) The function evalf, when passed % will evaluate the last line of maple code entered. (Type evalf(%); to get a decimal approximation when you just entered a complicated equation)

    22. Basics about Maple Programming: Misc stuff Maple provides us with a convenient way to get random numbers from any distribution. If we type randomnumber:=stats[random, normald[mean, stdev]]: Then if we type randomnumber() anywhere, we get a random number from a normal distribution with mean mean and standard deviation stdev. What maple generates is actually a procedure, thus we must remember to put ()’s after randomnumber.

    23. Implementing the Monte Carlo Method for pricing financial derivatives… Finally! Remember that what we want to do is: 1) generate lots of random walks of the stock using the formula SN=SN-1+SN-1* µ*dt + SN-1* s *dx 2) compute the value of our financial derivative for each of these random walks by using a payoff formula. 3) average these values together to get an expected value

    24. One possible implementation for call options

    27. Finally, when all values of trialarray have been computed, their mean can be taken to come up with an approximation for the expected value of the financial derivative (a call, in our case).

    28. Accuracy of this Implementation We would expect that as the number of trial runs increases, the accuracy of the final result does as well. In order to test this, we need to asses how far our mean is from the true mean. We need to figure out a way to find the standard deviation of our mean in the distribution of means. the Central Limit Theorem guarantees that if N is large enough, the sample mean will be normally distributed in the distribution of all means with a standard deviation of s/sqrt(N), where s is the standard deviation of the sample. (no matter what the distribution of the sample is!)

    29. An example of the central limit theorem As an example, if we take the st. dev of a trial with N runs, we get some value s. If we take the mean of 100 such evaluations and then take the standard deviation of those means, we get a value that is always about s/10. This shows that the distribution of means of size 100 has a standard deviation of stdev(trial)/10. Thus, basically, to assess accuracy, we can use stdevsample/SQRT(N) where N is the sample size.

    30. What does the standard deviation represent again, anyway? A standard deviation of 1, in this case, means that there is a 68.1% or so chance that the mean which we computed is within +-.5 of the real mean. There is a 95% or so chance that the mean which we computed is within 2 *+-.5 of the real mean. We could calculate confidence intervals, however for a rough estimation of accuracy we can just look at the standard deviation of the mean in the distribution of means.

    31. Summary of accuracy concerns In order to figure out accurate our sample mean is with respect to the true mean, we use: Standard deviation of sample/ SQRT(Sample size)

    32. Steps vs. Trials and the cost of accuracy Increasing the number of steps creates more accurate depictions of a random walk. A more accurate random walk is only beneficial up to a certain point. For now, we can just use steps = 20. Increasing the number of trials, however, does bring with it huge benefits, at the cost of an increasingly large time cost

    33. Time vs. number of trials

    34. The actual uses of the Monte Carlo Method Although we can use a Monte Carlo Method to price calls and puts, there isn’t really that much of a point since we could use BlackScholes. With slight modifications, the code today can be made to evaluate option prices for path dependent options for which equations either do not exist, or are very difficult to solve. Useful for derivatives like: lookback options, asian options, other exotic options.

    35. Sources http://www.chem.unl.edu/zeng/joy/mclab/mcintro.html http://www.cargo.wlu.ca/introMaple.html http://ems.calumet.purdue.edu/mcss/kraftrl/mfmm/pdf/Worksheet13.pdf http://www.finweb.com/investing/exotic-options.html http://en.wikipedia.org/wiki/Monte_Carlo_methods_in_finance http://statistical-engineering.com/central_limit_theorem_fineprint.htm http://www.mapleprimes.com/forum/bughistogram http://ellerbruch.nmu.edu/Maple/Array.html The Concepts and practice of mathematical finance, Mark Suresh Joshi (google books link)

More Related