This assignment is an extra credit opportunity worth 10 points. The goal is to demonstrate your understanding of the topic in the different areas of problem statement through a flowchart diagram propely marked, the analytics through a clear representation of the mathematical equations, the coding through the clear and properly commented execution steps, and finally results evaluation through the assessment of quality and integrity.
The topic of interest is the pricing of an Asian option. Asian options are a form of exotic options unlike the more vanilla European options. The case considered here is a special type of Asian options where the payoff is given by the average price of the underline asset over some predetermined period until expiration time. Other variations of Asian options (outside our scope) are possible and left for the reader’s investigation. The case in point is described on p.169 . Note that Asian options are characterized as path dependent options. By this we mean that the payoff of the option is dependent on the intermediate values of the underline asset along the path. In contrast a European option is path independent because the payoff depends only on the final value of the underline asset, and not on the intermediate or historical values. The case of American options is slightly tricky. Because of the early exercise opportunity one may be inclined to view American options as path dependendent. However at any exercise point the payoff is only dependent on the current asset price and not historical. As such it is not really path dependent.
Remember to always set your working directory to the source file location. Go to ‘Session’, scroll down to ‘Set Working Directory’, and click ‘To Source File Location’. Read carefully the below and follow the instructions to complete the tasks and answer any questions. Submit your work to RPubs as detailed in previous notes.
Always read carefully the instructions on Sakai. For clarity, tasks/questions to be completed/answered are highlighted in red color (visible in preview) and numbered according to their particular placement in the task section. Quite often you will need to add your own code chunk.
Execute all code chunks, preview, publish, and submit link on Sakai follwoing the naming convention. Make sure to add comments to your code where appropriate. Use own language!
Any sign of plagiarism, will result in dissmissal of work!
#Install package quantmod
if(!require("quantmod",quietly = TRUE))
install.packages("quantmod",dependencies = TRUE, repos = "https://cloud.r-project.org")
##
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
##
## as.Date, as.Date.numeric
## Version 0.4-0 included new data defaults. See ?getSymbols.
Inspired by the flowchart diagram of the MC simulation for European option, create an equivalent flowchart diagram for the considered case of Asian option. Describe the variables, label clearly, and write the discrete mathematical representation to be coded later. You can create the flowchart using a separate tool and include an image capture here. A hand drawn image is acceptable only if well executed.
knitr::include_graphics("IMG_0854.jpg")
Implement the R-code for the MC simulation to price an Asian Call option with input characteristics similar to the European Call option considered in Lab 6, task 2B.
#Algorithm 5.3 MC to calculate the price of Asian options
MCAsian=function(Type = "c",S=100,K=100,T=1/12,r=0.1,sigma=0.25,n=300,m=100,dt=T/300){
sum = 0;
for (i in 1:m) { # number of simulated paths
Asum = 0; # for cumulative sum along the path
Sold = S
for (j in 1:n) { # length of path
E = rnorm(1,0,1);
Snew = Sold + r*Sold*dt + sigma*Sold*sqrt(dt)*E;
Asum = Asum + Snew;
Sold = Snew;}
if(Type=="c"){payoff = max((1/n)*Asum - K,0)}
else if(Type =="p"){payoff = max(K-(1/n)*Asum,0)}
else{payoff = max((1/n)*Asum - K,0)} # default
sum = sum + payoff}
OptionValue = (sum*exp(-r*T))/m;
return(OptionValue)}
f2 = MCAsian(Type = "c", S=155,K=140,T=1/2,r=0.025,sigma=0.23,n=100, m=1000)
print(f2)
## [1] 15.69563
S = 155 K = 140 T = 1/2 r = 0.025 sigma = 0.23 b = r = 0.025 n = 100 m = 1000 dt = T/n = 0.005
For this question the below package is needed. Follow the example at bottom of p.171 to price the same Asian Call option using instead the approximate function referenced in the example. Compare to the MC simulation.
#Install required package
if(!require("fExoticOptions",quietly = TRUE))
install.packages("fExoticOptions",dependencies = TRUE, repos = "https://cloud.r-project.org")
##
## Attaching package: 'timeSeries'
## The following object is masked from 'package:zoo':
##
## time<-
##
## Attaching package: 'fBasics'
## The following object is masked from 'package:TTR':
##
## volatility
library("fExoticOptions")
TW = TurnbullWakemanAsianApproxOption(TypeFlag = "c",S=155, SA=155, X=140,Time = 1/2, time = 1/2, tau = 0, r=0.025, b=0.025, sigma = 0.23)
print(TW)
##
## Title:
## Turnbull Wakeman Asian Approximated Option
##
## Call:
## TurnbullWakemanAsianApproxOption(TypeFlag = "c", S = 155, SA = 155,
## X = 140, Time = 1/2, time = 1/2, tau = 0, r = 0.025, b = 0.025,
## sigma = 0.23)
##
## Parameters:
## Value:
## TypeFlag c
## S 155
## SA 155
## X 140
## Time 0.5
## time 0.5
## tau 0
## r 0.025
## b 0.025
## sigma 0.23
##
## Option Price:
## 16.63123
##
## Description:
## Fri Feb 8 22:24:14 2019
Monte Carlo Simulation Value = 15.12141
Approximation Formula Value = 16.63123
The Monte Carlo simulation yielded a slightly lower value than the approximation formula, most likely due to the lower volatility and higher number of periods in the MC calculation.
Calculating the Greeks for the Asian Option is not as straightforward using the approximate function. Instead we can approximate using numerical differentiation. Describe how would you implement a numerical differentiation to calculate the Delta. Show the code execution and the intermediate values to calculate the Delta and the Theta for the considered Asian Call option.
Explain how the price of the Asian Call option compares to the equivalent European Call option. Is it an expected behavior? What about the Delta comparison? Poorly stated insights will receive poor grade!
The Asian option price is based on the average underlying stock price, which is less volatile than the underyling stock price itself. An option value based on an underlying asset with lower volatility will be lower. Therefore, given the same option parameters an Asian option will have lower value than its European counterpart, which is what we see here.
15.12141 < 16.63123 < 20.04025
All else being equal, the Asian call option delta will be lower than the delta of its European option counterpart while out-of-the-money and higher once in-the-money. However, the delta of the Asian option may again dip below that of its European counterpart as the underlying stock price continues to increase.
#User defined function for Euler MC
EulerMC = function(Type = "c", S=100, K=100, T=1/12, r=0.1, sigma=0.25, n=300, m=100, dt=T/n){
sum=0
for(i in 1:m){# of paths
Sold=S
for(j in 1:n){# of periods in path
E=rnorm(1,mean = 0,sd = 1);
Snew=Sold+r*Sold*dt+sigma*Sold*sqrt(dt)*E;
Sold = Snew}
if(Type == "c"){payoff = max(Snew-K,0)}
else if(Type == "p"){payoff = max(K-Snew,0)}
else{payoff=max(Snew-K,0)} #default
sum = sum + payoff}
OptionValue = (sum*exp(-r*T))/m;
return(OptionValue)}
f <- EulerMC("c", 155, 140, 1/2, 0.025, 0.23, 100, 1000)
print(f)
## [1] 20.17142
GBSGreeks(Selection = "Theta",TypeFlag = "c", 155,140,1/2,0.025,0.025,0.23)
## [1] -9.928723
Delta for European Call Option = 0.783484
Theta for European Call Option = -9.928723