Description Usage Arguments Details Value Author(s) References Examples
A collection and description of functions to valuate
Heston-Nandi options. Included are functions to compute
the option price and the delta and gamma sensitivities
for call and put options.
The functions are:
HNGOption | Heston-Nandi GARCH(1,1) option price, |
HNGGreeks | Heston-Nandi GARCH(1,1) option sensitivities, |
HNGCharacteristics | option prices and sensitivities. |
1 2 3 | HNGOption(TypeFlag, model, S, X, Time.inDays, r.daily)
HNGGreeks(Selection, TypeFlag, model, S, X, Time.inDays, r.daily)
HNGCharacteristics(TypeFlag, model, S, X, Time.inDays, r.daily)
|
model |
a list of model parameters with the following entries:
|
r.daily |
the daily rate of interest, a numeric value; e.g. 0.25/252 means about 0.001% per day. |
S |
the asset price, a numeric value. |
Selection |
sensitivity to be computed, one of |
Time.inDays |
the time to maturity measured in days, a numerical value; e.g. 5/252 means 1 business week. |
TypeFlag |
a character string either |
X |
the exercise price, a numeric value. |
Option Values:
HNGOption
calculates the option price, HNGGreeks
allows to compute the option sensitivity Delta or Gamma, and
HNGcharacterisitics
summarizes both in one function call.
HNGOption
returns a list object of class "option"
with $price
denoting the option price, a numeric value, and $call
a
character string which matches the function call.
HNGOGreeks
returns the option sensitivity for the selected Greek, either
"delta"
or "gamma"
; a numeric value.
HNGCharacteristics
returns a list with the following entries:
premium |
the option price, a numeric value. |
delta |
the delta sensitivity, a numeric value. |
gamma |
the gamma sensitivity, a numeric value. |
Diethelm Wuertz for the Rmetrics R-port.
Heston S.L., Nandi S. (1997); A Closed-Form GARCH Option Pricing Model, Federal Reserve Bank of Atlanta.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## model -
# Define the Model Parameters for a Heston-Nandi Option:
model = list(lambda = -0.5, omega = 2.3e-6, alpha = 2.9e-6,
beta = 0.85, gamma = 184.25)
S = X = 100
Time.inDays = 252
r.daily = 0.05/Time.inDays
sigma.daily = sqrt((model$omega + model$alpha) /
(1 - model$beta - model$alpha * model$gamma^2))
data.frame(S, X, r.daily, sigma.daily)
## HNGOption -
# Compute HNG Call-Put and compare with GBS Call-Put:
HNG = GBS = Diff = NULL
for (TypeFlag in c("c", "p")) {
HNG = c(HNG, HNGOption(TypeFlag, model = model, S = S, X = X,
Time.inDays = Time.inDays, r.daily = r.daily)$price )
GBS = c(GBS, GBSOption(TypeFlag, S = S, X = X, Time = Time.inDays,
r = r.daily, b = r.daily, sigma = sigma.daily)@price) }
Options = cbind(HNG, GBS, Diff = round(100*(HNG-GBS)/GBS, digits=2))
row.names(Options) <- c("Call", "Put")
data.frame(Options)
## HNGGreeks -
# Compute HNG Greeks and compare with GBS Greeks:
Selection = c("Delta", "Gamma")
HNG = GBS = NULL
for (i in 1:2){
HNG = c(HNG, HNGGreeks(Selection[i], TypeFlag = "c", model = model,
S = 100, X = 100, Time = Time.inDays, r = r.daily) )
GBS = c(GBS, GBSGreeks(Selection[i], TypeFlag = "c", S = 100, X = 100,
Time = Time.inDays, r = r.daily, b = r.daily, sigma = sigma.daily) ) }
Greeks = cbind(HNG, GBS, Diff = round(100*(HNG-GBS)/GBS, digits = 2))
row.names(Greeks) <- Selection
data.frame(Greeks)
|
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics
Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Rmetrics Package fOptions
Pricing and Evaluating Basic Options
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
S X r.daily sigma.daily
1 100 100 0.0001984127 0.01004349
HNG GBS Diff
Call 8.992100 8.939049 0.59
Put 4.115042 4.061991 1.31
HNG GBS Diff
Delta 0.67395339 0.65295993 3.22
Gamma 0.02211149 0.02315963 -4.53
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.