This exercise is the final project of Module 3, Derivatives Market, of the Diploma in Financial Markets and Risk Analysis, taught by the School of Economics of UNAM.

The exercise is based on excercise from Simon Benninga’s book Financial Modeling, chapter 18 Options Greeks, page 470. It is replicated with Open Source R through the derivmkts and optionstrat packages.

The aforementioned exercise is shown below, for verification purposes only.

Setting the variables into R session:

S <- 100
X <- 90
Y  <- 0.5
r <- .06
k <- .02
Sigma <- .35

All calculations are based on the Black-Scholes-Merton model which formulas are as follow:


where:


Solving \(\mathrm d_1\) and \(\mathrm d_2\) parameters:

Next chunk shows a commented line with formula as in Benninga book.
When running this, all values coincide but the Greeks, especially Theta vary enormously.
Under such line, it appear an alternative input as in Black-Scholes-Merton model for \(\mathrm d_1\) and \(\mathrm d_2\), just the same as above, when running it, parameters such as \(\mathrm d_1\), \(\mathrm d_2\), \(\mathrm N(\mathrm d_1)\) and \(\mathrm N(\mathrm d_2)\) stop to coinciding with Benninga book, but Greeks coincide with such book.

#d1 <- (log(S/X) + (r - k + 0.5 * Sigma^2) * Y)/(Sigma*sqrt(Y))  # Benninga book
d1 <- (log(S/X) + (r + Sigma^2/2 * Y))/(Sigma*sqrt(Y)) # As appears anywhere
d2 <- d1 - Sigma * sqrt(Y)


Displaying values of \(\mathrm d_1\) and \(\mathrm d_2\):

## d1 value:  0.7919011
## d2 value:  0.5444137


Solving for \(\mathrm N(\mathrm d_1)\) and \(\mathrm N(\mathrm d_2)\):

Nd1 <- pnorm(d1)
Nd2 <- pnorm(d2)


Displaying values of \(\mathrm N(\mathrm d_1)\) and \(\mathrm N(\mathrm d_2)\):

## N(d1) value:  0.7857908
## N(d2) value:  0.7069216

Call & Put Options prices using Brute Force:

CallbyHand <- S * exp(-k*Y) * Nd1 - X * exp(-r*Y) * Nd2
PutbyHand <- -S * exp(-k*Y) * pnorm(-d1) + X * exp(-r*Y) * pnorm(-d2)


Displaying values of Call and Put Options prices using Brute Force:

## Call Price by Brute Force:  16.05461
## Put Price by Brute Force:  4.389721

Call & Put Options Prices using derivmkts package:

callprice1 <- bscall(S, X, Sigma, r, Y, k)
putprice1 <- bsput(S, X, Sigma, r, Y, k) 


Displaying values of Call and Put options prices computed with bscall and bsput commands of derivmkts package:

## Call Price:  16.15311
## Put Price:  4.48822

Graphics of Call and Put Options Prices simulating S from 50 to 150

Figure 1. Call Option

Figure 1. Call Option


Figure 2. Put Option

Figure 2. Put Option


Computing the Greeks

The Greeks are the quantities representing the sensitivity of the price of derivatives such as options to a change in underlying parameters on which the value of an instrument or portfolio of financial instruments is dependent. Definitions of such quantities are displayed below.


The formulas for the partial derivatives that make up the Greek ones are shown below


Computing the Greeks by Brute Force:

Delta_Call_BF <- exp(-k*Y) * pnorm(d1)
Gamma_Call_BF <- exp(-d1^2/2 - k * Y)/(S * Sigma * sqrt(2*Y*pi))
Vega_Call_BF <- (S * sqrt(Y) * exp(-(d1^2)/(2 - k * Y)))/(sqrt(2 * pi))
Theta_Call_BF <- -S*exp(-(d1^2)/2-k*Y)*Sigma/sqrt(8*Y*pi)+k*S*exp(-k*Y)*Nd1-r*X*exp(-r*Y)*Nd2
Rho_Call_BF <- X*Y*exp(-r*Y) * pnorm(d2)

Delta_Put_BF <- -exp(k*Y) * pnorm(-d1)
Gamma_Put_Bf <- exp(-d1^2/2 - k * Y)/(S * Sigma * sqrt(2*Y*pi))
Vega_Put_BF <- (S * sqrt(Y) * exp(-(d1^2)/(2 - k * Y)))/(sqrt(2 * pi))
Theta_Put_BF <- -S*exp(-(d1^2)/2-k*Y)*Sigma/sqrt(8*Y*pi)-k*S*exp(-k*Y)*(1-Nd1)+r*X*exp(-r*Y)*(1-Nd2)
Rho_Put_BF <- -X*Y*exp(-r*Y) * pnorm(-d2)


Displaying values of Greeks using Brute Force:

## Delta Call by Brute Force:  0.7779721
## Gamma Call by Brute Force:  0.01166378
## Vega Call by Brute Force:  20.5843  Divided by 100 as needed:  0.205843
## Theta Call by Brute Force:  -9.292679  Divided by 100 as needed:  -0.09292679
## Rho Call by Brute Force:  30.8713  Divided by 100 as needed:  0.308713
## Delta Put by Brute Force:  -0.216362
## Gamma Put by Brute Force:  0.01166378
## Vega Put by Brute Force:  20.5843  Divided by 100 as needed:  0.205843
## Theta Put by Brute Force:  -6.032373  Divided by 100 as needed:  -0.06032373
## Rho Put by Brute Force:  -12.79875  Divided by 100 as needed:  -0.1279875

The Greeks using derivmkts package:

Call_Greeks <- bsopt(S, X, Sigma, r, Y, k)[["Call"]][c("Delta", "Gamma", "Vega", "Theta", "Rho"), ] 
Put_Greeks <- bsopt(S, X, Sigma, r, Y, k)[["Put"]][c("Delta", "Gamma", "Vega", "Theta", "Rho"), ]


Displaying values of Greeks computed with bsopt command of derivmkts package:

## Delta Call:  0.7284224
## Gamma Call:  0.01308432
## Vega Call:  0.2289764
## Theta Call:  -0.02728405
## Rho Call:  0.2834457
## Delta Put:  -0.2616274
## Gamma Put:  0.0130845
## Vega Put:  0.2289764
## Theta Put:  -0.0183517
## Rho Put:  -0.1532548

The Greeks using optionstrat package (This package is used for results comparison purposes):

Call_Delta_2 <- callgreek("delta",S, X, Sigma, Y, r, k)
Call_Gamma_2 <- callgreek("gamma",S, X, Sigma, Y, r, k)
Call_Theta_2 <- callgreek("theta",S, X, Sigma, Y, r, k)
Call_Vega_2 <- callgreek("vega",S, X, Sigma, Y, r, k)
Call_Rho_2 <- callgreek("rho",S, X, Sigma, Y, r, k)
Put_Delta_2 <- putgreek("delta",S, X, Sigma, Y, r, k)
Put_Gamma_2 <- putgreek("gamma",S, X, Sigma, Y, r, k)
Put_Theta_2 <- putgreek("theta",S, X, Sigma, Y, r, k)
Put_Vega_2 <- putgreek("vega",S, X, Sigma, Y, r, k)
Put_Rho_2 <- putgreek("rho",S, X, Sigma, Y, r, k)


Displaying values of Greeks computed with callgreek and putgreek commands of optionstrat package:

## Delta Call 2:  0.7284224
## Gamma Call 2:  0.01308436
## Theta Call 2:  -0.03261145
## Vega Call 2:  0.2289764
## Rho Call 2:  0.2834457
## Delta Put 2:  -0.2616274
## Gamma Put 2:  0.01308436
## Theta Put 2:  -0.01474676
## Vega Put 2:  0.2289764
## Rho Put 2:  -0.1532548

Graphics of the Greeks. Underlying asset prices are simulated from 50 to 150. Call Greeks are in blue, Put Greeks are in red.

Figure 3. Delta Sensitivity

Figure 3. Delta Sensitivity


Figure 4. Gamma Sensitivity

Figure 4. Gamma Sensitivity


Figure 5. Vega Sensitivity

Figure 5. Vega Sensitivity


Figure 6. Theta Sensitivity

Figure 6. Theta Sensitivity


Figure 7. Rho Sensitivity

Figure 7. Rho Sensitivity


Creative Commons Licence
This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.