Starting from:
$35

$29

End-Term Programming Assignment Solution

Veri cation of the Adjustment-Method for Pricing European Down-and-Out Continuous-, and European Down-and-Out Discrete-Barrier Options via Monte Carlo Simulation



Instructions

    1. If you worked with someone on a speci c problem, make sure you tell me about it. If you do not do this and I notice a verbatim reproduction of material, I consider it as plagiarism. There can be serious consequences to this.

    2. If you picked-up the solution from some source, make sure you mention it. If you do not do this and I notice a verbatim repro-duction of material, I consider it as plagiarism. There can be serious consequences to this.


    3. Each submitted document should be personalized. I expect to see (1) C++ code and header les (if any), (2) A two page write-up with information on your implementation that accompanies each submission by Midnight, 14 December, 2018 on Compass.



There are two parts to this programming assignment that involves the sim-ulation of price-paths using the material of Lesson 9. The rst part is about pricing an European Down-and-Out Continuous Barrier Option, and the sec-ond part is about pricing an European Down-and-Out Discrete Barrier Option. You are in e ect going to verify the adjustment-terms covered in section 1 of Lesson 7, and section 2 of Lesson 7. But this time, you are going to deal with the simulated price-paths assuming it follows the standard geometric Brownian motion model for asset-price. Let us review the details.

Review of the adjustment-term for the Continu-ous Barrier Option

According to Baldi, Caramellino and Iovino [?], suppose the initial asset-price is S0, the nal asset-price is ST , the volatility is , and the barrier price is B, then the probability that an asset-price path that starts at S0, ends up at ST



1





in time T , breaches the barrier price of B is given by
( 1
pc =
e


2 log
S0
log
ST

if S0    B or ST   B
(1)

B

B








otherwise:


2T





So, the probability that the asset price path that starts at S0 and ends up in ST in time T does not breach the barrier B is 1 pc.

Baron-Adesi, Fusari and Theal [?] suggest that we just price the option without taking the Barrier into consideration, and then discount the price by multiplying it by (1 pc). You will verify this assertion in the rst-half of this programming assignment, and simultaneously, you will implicitly verify equation 1 shown above.

Review of the adjustment-term for the Discrete Barrier Option

A Brownian bridge is a continuous-time stochastic process B(t), where

B(t) = X(t)    (t    Z);

where Z is a unit-normal variate.

The Brownian bridge is very useful for the following task { suppose we have generated a number of points X(0); X(1); X(2); : : : X(n) of a Wiener process path by computer simulation. We now wish to interpolate between the samples. The solution is to use a Brownian bridge that is required to go through the sample points X(0); X(1); X(2); : : : X(n).

In general when X(t1) = a and X(t2) = b, the distribution of X(ti) for ti 2 (t1; t2) is normally distributed with mean i
i = a +
ti
t1
(b  a);

t2
t1

and variance



i2 =
(ti
t1)(t2    ti)
:







t2
t1
We have the initial price S0, and we obtain the    nal price ST at expiration

    • through a simulated price-path, we can check if ST > B, the barrier-price. Following this, we can e ectively compute the probability that the price path never touched any discrete barrier located at t1; t2; : : : ; tm(= T ), as
m  1

1  N
B  i  i
(2)
pd = i=1




Y








Following what we did for the continuous barrier option, we price the discrete barrier option by ignoring the barrier entirely. Following this, we multiply the price by pd shown in equation 1.

2





You will verify this claim in the second-part of the programming assign-ment. As before, verifying the adjustment-term is an indirect veri cation of the Brownian Bridge concepts introduced above.

What I want from you: First-Part

To get full points for the assignment, I want you to meet the following require-ments1:

    1. Your program should take the following command-line input (in the fol-lowing order; this will make the grading-part easy):

        (a) Duration T ,

        (b) Risk-free interest rate r,

        (c) Volatility  ,

        (d) Initial stock price S0,

        (e) Strike Price K,

        (f) n, the number of trials/repetitions of the Monte Carlo simulations,

        (g) m, the number of sample-points in each sample price-path, and

        (h) Barrier Price B (assume the user will input a value of B such that B < S0),

    2. Your code will simulate a price-path of m-many equally spaced points. That is, your code will generate values for S0; S1; S2; : : : ; Sm(= ST ). You should exploit the \get-four-paths-for-the-price-of-one-path" method. If any Si B, the price path gets knocked-out, and gives you a zero-payo .

Otherwise, the payo is max(0; ST K) for a call, and max(0; K ST ) for a put. Present the average payo over the n-many trials as the price of the option, which is obtained via explicit-simulation.

3. Using the same code, and just the values of S0 and ST , compute pc as according to equation 1, and use a payo max(0; ST K)(1 pc) for paths did not get knocked-out; all other paths have a payo of zero. Present the average of these \adjusted" prices over the n-many trials as (an alternate) price of the option, which is obtained using just the initial- and nal-price along with the adjustment-term.

    4. Use the closed-form formulae in section 1.1 of lesson 7 to compute the theoretical price of the down-and-out option, and present it as the output too.

For the rst-part, I am looking for an output that looks something like what is shown in gure 1. When all these three prices are approximately similar, we have e ectively veri ed the formula shown in equation 1.


    • If you do not follow my instruction, you will loose points unnecessarily.


3




























Figure 1: A sample output for the    rst part of the assignment.

What I want from you: Second-Part

To get full points for the assignment, I want you to meet the following require-ments2:

    1. Your program should take the following command-line input (in the fol-lowing order; this will make the grading-part easy):

        (a) Duration T ,

        (b) Risk-free interest rate r,

        (c) Volatility  ,

        (d) Initial stock price S0,

        (e) Strike Price K,

        (f) n, the number of trials/repetitions of the Monte Carlo simulations.

        (g) m, the number of (equally-spaced) discrete barriers from 0 to T (note, the m-th barrier is at time T ),

        (h) Barrier Price B (assume the user will input a value of B such that B < S0),

    2. Your code will simulate a price-path of m-many equally spaced points, which corresponds to the price of the stock at the location of each discrete


    • If you do not follow my instruction, you will loose points unnecessarily.


4





barrier. Here too, you should exploit the \get-four-paths-for-the-price-of-one-path" method. If any Si B, the price path gets knocked-out, and gives you a zero-payo . Otherwise, the payo is max(0; ST K) for a call, and max(0; K ST ) for a put. Present the average payo as the price of the option over the n-many trials. This is the price obtained by the explicit simulation of the price-paths.

3. Using the same code, and just the values of S0 and ST , compute pc as according to equation 1, and use a payo max(0; ST K)pd, where pd is given by the expression in equation 2, for paths did not get knocked-out; all other paths have a payo of zero. Present the average of these \adjusted" prices as (an alternate) price of the option over the n-many simulations. This is the price of the option obtained by the brownian bride correction term.

For the second-part, I am looking for an output that looks something like what is shown in gure 2. When all these three prices are approximately similar,






















Figure 2: A sample output for the    rst part of the assignment.

we have e ectively veri ed the formula shown in equation 2.

Everything that I asked for has to be implemented { no partial credit for partial implementations. I want these two programs uploaded on Compass by Midnight, December 13, 2019.

    1. If your code works correctly on my data-sets (and this will require you to follow the input-format instructions rigorously), you get 100 points.

    2. I will permit one back-and-forth iteration, if your submitted code does not



5





work3. That is, if I notice something wrong with your code, I will e-mail you right away. You have 24 hours to x it and send it back to me.

    (a) If your revised code works correctly you will get 80 points.

    (b) Anything else, will get you zero points.
















































    • It is not hard to verify things { get approximately the same prices for all variations of the problem!


6

More products