HW3_LIMO

# HW3_LIMO - 642:623 Computational Finance Report of Homework...

• Homework Help
• 8
• 100% (1) 1 out of 1 people found this document helpful

This preview shows pages 1–4. Sign up to view the full content.

642:623 Computational Finance: Report of Homework 3 Due on Feb 7, 2012 1:00 pm Tues 6:30PM Mo Li

This preview has intentionally blurred sections. Sign up to view the full version.

Mo Li 642:623 Computational Finance : Report of Homework 3 Explanation The task of this assignment is to implement the L’Ecuyer uniform random number generator and the Fishman acceptance-rejection algorithm for generate normally distributed numbers in this assignment. Based on these work, we compare the performance of the combinations of each uniform random number generators with each normal random number generating algorithm. Closed-form option price Algorithm Closed-form option pricing formula of Black Scholes model is the same as we have discussed before. Brieﬂy, we use formula for European Call c ( t, x ) = xe - N ( d + ( τ, x )) - e - KN ( d - ( τ, x )) for direct pricing. Where d ± ( tau, x ) = 1 σ τ [ log x K + ( r - a ± 1 2 σ 2 ) τ ] Implementation Implemented by C++ function of double BSVanillaCallClosedform( double Expiry, double Spot, double Vol, double r, 5 double Strike); With most of the parameters self-explainable. Especially, the parameter r is the risk-free rate. MC option price with Park-Miller unform generator Algorithm Park-Miller is a method of generating uniform random numbers, a linear congruential generator. With the following formula x i +1 = ( ax i + c ) mod m where x 0 = seed a = multiplier c = shift m = modulus then we have u i +1 = x i +1 /m to be the i + 1th generated random number. Here, in the example of Park-Miller generator, we have a = 168707 m = 2 31 - 1 c = 0 which has a period of 2 31 - 1. Page 1 of 7
Mo Li 642:623 Computational Finance : Report of Homework 3 Implementation We use the code implemented by Joshi for generating random numbers. Joshi’s code constructed two main classes for this algorithm. Class RandomBase in head file Random2.h is the base class of all generator class with the method of GetGaussians(MJArray& variates) of generating normal random numbers by inverse transform. Class RandomParkMiller in head file ParkMiller.h is is derivative class of RandomBase , which implements the method of generating uniform random numbers by Park-Miller Algorithm by function GetOneRandomInteger() . And inheriting the normal random number generating function of RandomBase . MC option price with L’Ecuyer uniform generator Algorithm L’Ecuyer uniform generator employing the idea of combined generator to increase period length but preserve same simplicity. Construct two elementary congruential random number generators as following x 1 ,i = ( a 11 x 1 ,i - 1 + a 12 x 1 ,i - 2 + a 13 x 1 ,i - 3 ) mod m 1 with a 11 = 0, a 12 = 63308, a 13 = - 183326 and m 1 = 2 31 - 1. And x 2 ,i = ( a 21 x 2 ,i - 1 + a 22 x 2 ,i - 2 + a 23 x 2 ,i - 3 ) mod m 2 with a 21 = 86098, a 12 = 0, a 13 = - 539608 and m 1 = 2145483479. And we get the uniform random number in (0 , 1) by two more steps of x i = x 1 ,i - x 2 ,i mod m 1

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.
• Spring '16
• Normal Distribution, probability density function, Cumulative distribution function, random number, uniform random number, Mo Li

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern