- Use the inverse transform method to produce a standard Cauchy distributed random variable X with density
from a standard uniformly distributed one,:
- Calculate the (generalized) inverse cdf FX1 of X.
- 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.
- Show that the Box-Muller algorithm
produces indeed two independent standard normal random variables from independent uniform ones.
- 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.
- Choose a reasonably small constant c such that cg(x) f(x) for all x R.
- 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.
- The MarsagliaBray 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 MarsagliaBray 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?
- Compare the BoxMuller and the MarsagliaBray 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.
- 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.
- Calculate the price of a European put option with maturity T = 0.5 and strike K = 110 using the BlackScholes formula.
- Calculate the price of a European put option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.
- 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.
- 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.
- Calculate the price of a European cubic put option (payoff ) option with maturity T = 0.5 and strike K = 110 using Monte-Carlo integration.
- 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.
- Calculate the price of a European exponential put option (payoff e(KST)+) 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
Reviews
There are no reviews yet.