[SOLVED] MA 573 - Computational Methods of Mathematical Finance - Assignment 2

35.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon HW2-y0iigb.zip (1336.1 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
Rate this product

 

 

  1. Use the inverse transform method to produce a standard Cauchy distributed random variable X with density

from a standard uniformly distributed one,:

  1. Calculate the (generalized) inverse cdf FX−1 of X.
  2. Sample the Cauchy distribution numerically by creating a histogram for x ∈ [−5,5) and bin size with 10,000 samples and compare it to a direct plot of the density f.
  1. Show that the Box-Muller algorithm

produces indeed two independent standard normal random variables from independent uniform ones.

  1. Use the acceptance rejection method to produce a sample of a folded normal random variable X with density

if x > 0;

0                    else,

by using an exponential density as dominating term.

  1. Choose a reasonably small constant c such that cg(x) ≥ f(x) for all x ∈R.
  2. Plot the density of your trial by plotting a histogram for x ∈ [0,3) and bin size with 10,000 samples and compare it to a direct plot of the density f.
  1. The Marsaglia–Bray method is an alternative method to generate a normal distribution out of a uniform sample, using the acceptance-rejection method: Using two independent standard normal distributed random variables,, we set V 1 = 2U1 − 1 and V 2 = 2U2 − 1, and calculate 1 we reject the sample,

otherwise we calculate

; .

Prove that X1 and X2 are standard-normal distributed random variables.

Note: The Marsaglia–Bray algorithm is superior to Box-Muller as it uses only one computationally expensive transcendental functions (namely log) instead of three (log, sin and cos), at the price of having a part of the sample rejected.

Bonus question: Which percentage of the sample gets rejected?

  1. Compare the Box–Muller and the Marsaglia–Bray algorithm (see problem 2 and 4) by using them to produce samples of standard-normal distributed random variables from uniform random variables given by the built-in random number generator of your programming language. Compare the densities of your samples generated by the two methods with each other and the exact normal density function by plotting a histogram for x ∈ [−3,3) and bin size . Choose the sample size in a way that the runtime of the slower algorithm is between 1s and 10s (just using trial and error) and compare the runtimes.
  2. Assume a financial markets where stock and money market account follow the dynamics

dSt = µSt dt + σSt dWt,                                        S0 = 100;

dBt = rBt dt,                                                          B0 = 1,

with µ = 0.05, σ = 0.2 and r = 0.03.

  1. Calculate the price of a European put option with maturity T = 0.5 and strike K = 110 using the Black–Scholes formula.
  2. Calculate the price of a European put option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.
  3. Compare the results of part (a) and part (b), using different sample sizes for the Monte-Carlo integration. Make a plot that shows the numerically computed option price as function of the sample size.
  4. Calculate the price of a European asset-or-nothig digital call option (payoff

ST1l{ST>K}) option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.

  1. Calculate the price of a European cubic put option (payoff ) option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.
  2. Calculate the price of a European gap call option (payoff (ST − L)+1l{ST>K}) option with maturity T = 0.5 and strike K = 110 and exercise level L = 105 using Monte-Carlo integration.
  3. Calculate the price of a European exponential put option (payoff e(K−ST)+) option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.

Bonus question: Which of the options of problem (d)–(g) admit a closed-form representation of the option price?

Note: All programming problems should be either in Python 2.7 (recommended) or Python 3.5, matlab, or R (no support for these languages provided). Please comment the programs extensively and send them in a .zip file with title Lastname HW2.zip and suject line ”MA 573 HW2 Lastname” to Qingyun Ren [email protected] before the due date of the homework (replacing the bold words by your actual last name). Plots can be provided either as printout or as .pdf file.

4 points per problems

  • HW2-y0iigb.zip