A collection and description of functions to valuate plain vanilla
options. Included are functions for the Generalized Black-Scholes
option pricing model, for options on futures, some utility functions,
and print and summary methods for options.

The functions are:

`GBS*` | the generalized Black-Scholes option, |

`BlackScholesOption` | a synonyme for the GBSOption, |

`Black76Option` | options on Futures, |

`MiltersenSchwartzOption` | options on commodity futures, |

`NDF, CND, CBND` | distribution functions, |

`print` | print method for Options, |

`summary` | summary method for Options. |

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 | ```
GBSOption(TypeFlag, S, X, Time, r, b, sigma,
title = NULL, description = NULL)
GBSGreeks(Selection, TypeFlag, S, X, Time, r, b, sigma)
GBSCharacteristics(TypeFlag, S, X, Time, r, b, sigma)
GBSVolatility(price, TypeFlag, S, X, Time, r, b, tol, maxiter)
BlackScholesOption(...)
Black76Option(TypeFlag, FT, X, Time, r, sigma,
title = NULL, description = NULL)
MiltersenSchwartzOption(TypeFlag, Pt, FT, X, time, Time,
sigmaS, sigmaE, sigmaF, rhoSE, rhoSF, rhoEF, KappaE, KappaF,
title = NULL, description = NULL)
NDF(x)
CND(x)
CBND(x1, x2, rho)
## S4 method for signature 'fOPTION'
show(object)
## S3 method for class 'fOPTION'
summary(object, ...)
## S3 method for class 'option'
print(x, ...)
## S3 method for class 'option'
summary(object, ...)
``` |

`b` |
the annualized cost-of-carry rate, a numeric value; e.g. 0.1 means 10% pa. |

`description` |
a character string which allows for a brief description. |

`FT` |
[Black76*][MiltersenSchwartz*] - |

`KappaE, KappaF` |
[MiltersenSchwartz*] - |

`maxiter, tol` |
[GBSVolatility*] - |

`object` |
an object of class |

`price` |
[GBSVolatility*] - |

`Pt` |
[MiltersenSchwartz*] - |

`r` |
the annualized rate of interest, a numeric value; e.g. 0.25 means 25% pa. |

`rhoSE, rhoSF, rhoEF` |
[MiltersenSchwartz*] - |

`S` |
the asset price, a numeric value. |

`Selection` |
[GBSGreeks] - |

`sigma` |
the annualized volatility of the underlying security, a numeric value; e.g. 0.3 means 30% volatility pa. |

`sigmaS, sigmaE, sigmaF` |
[MiltersenSchwartz*] - |

`time, Time` |
the time to maturity measured in years, a numeric value. |

`title` |
a character string which allows for a project title. |

`TypeFlag` |
a character string either |

`x, x1, x2, rho` |
[NDF][CND][CBND] - |

`X` |
a numeric value, the exercise price. |

`...` |
arguments to be passed. |

**Generalized Black Scholes Options:**

`GBSOption`

calculates the option price, `GBSGreeks`

calculates option sensitivities delta, theta, vega, rho, lambda
and gamma, and `GBScharacterisitics`

does both.
`GBSVolatility`

computes the implied volatility.

Note, that setting `b = r`

we get Black and Scholes' stock option
model, `b = r-q`

we get Merton's stock option model with continuous
dividend yield `q`

, `b = 0`

we get Black's futures option
model, and `b = r-rf`

we get Garman and Kohlhagen's currency
option model with foreign interest rate `rf`

.

**Options on Futures:**

The `Black76Option`

pricing formula is applicable for valuing
European call and European put options on commodity futures. The
exact nature of the underlying commodity varies and may be anything
from a precious metal such as gold or silver to agricultural products.

The `Miltersen Schwartz Option`

model is a three factor model
with stochastic futures prices, term structures and convenience
yields, and interest rates. The model is based on lognormal
distributed commodity prices and normal distributed continuously
compounded forward interest rates and future convenience yields.

**Miltersen Schwartz Options:**

The `MiltersenSchwartzOption`

function allows for pricing
options on commodity futures. The model is a three factor model
with stochastic futures prices, term structures of convenience
yields, and interest rates. The model is based on lognormal
distributed commodity prices and normal distributed continuously
compounded forward interest rates and futures convenience yields.

**Distribution Functions:**

The functions `NDF`

, `CND`

, and `CBND`

compute
vlues for the Normal density functions, for the normal
probability function, and for the bivariate normal probability
functions. The functions are implemented as described in the
book of E.G. Haug.

**Print and Summary Method:**

Thes are two methods to print and sumarize an object of class
`"fOPTION"`

or of `"option"`

. The second is used
for the older class representation.

`GBSOption`

`BlackScholesOption`

returns an object of class `"fOption"`

.

`GBSGreeks`

returns the option sensitivity for the selected Greek, a
numeric value.

`GBSCharacteristics`

returns a list with the following entries:
`premium`

, the option price,
`delta`

, the delta sensitivity,
`gamma`

, the gamma sensitivity,
`theta`

, the theta sensitivity,
`vega`

, the vega sensitivity,
`rho`

, the rho sensitivity,
`lambda`

, the lambda sensitivity.

`GBSVolatility`

returns the GBS option implied volatility for a given price.

`Black76Option`

,

`MiltersenSchwartzOption`

return an object of class `"fOption"`

.

The option valuation programs return an object of class
`"fOPTION"`

with the following slots:

`@call` |
the function call. |

`@parameters` |
a list with the input parameters. |

`@price` |
a numeric value with the value of the option. |

`@title` |
a character string with the name of the test. |

`@description` |
a character string with a brief description of the test. |

The functions implement algorithms to valuate plain vanilla options and to compute option Greeks as described in Chapter 1 of Haug's Option Guide (1997).

Diethelm Wuertz for the Rmetrics **R**-port.

Black F., Scholes M. (1973);
*The Pricing of Options and Corporate Liabilities*,
Journal of Political Economy 81, 637–654.

Haug E.G. (1997);
*The Complete Guide to Option Pricing Formulas*,
Chapter 1, McGraw-Hill, New York.

Hull J.C. (1998);
*Introduction to Futures and Options Markets*,
Prentice Hall, London.

Miltersen K., Schwartz E.S. (1998);
*Pricing of Options on Commodity Futures with
Stochastic Term Structuures of Convenience Yields and
Interest Rates*,
Journal of Financial and Quantitative Analysis 33, 33–59.

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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | ```
## All the examples are from Haug's Option Guide (1997)
## CHAPTER 1.1: ANALYTICAL FORMULAS FOR EUROPEAN OPTIONS:
## Black Scholes Option [Haug 1.1.1]
GBSOption(TypeFlag = "c", S = 60, X = 65, Time = 1/4, r = 0.08,
b = 0.08, sigma = 0.30)
## European Option on a Stock with Cash Dividends [Haug 1.1.2]
S0 = 100; r = 0.10; D1 = D2 = 2; t1 = 1/4; t2 = 1/2
S = S0 - 2*exp(-r*t1) - 2*exp(-r*t2)
GBSOption(TypeFlag = "c", S = S, X = 90, Time = 3/4, r = r, b = r,
sigma = 0.25)
## Options on Stock Indexes [Haug 1.2.3]
GBSOption(TypeFlag = "p", S = 100, X = 95, Time = 1/2, r = 0.10,
b = 0.10-0.05, sigma = 0.20)
## Option on Futures [Haug 1.1.4]
FuturesPrice = 19
GBSOption(TypeFlag = "c", S = FuturesPrice, X = 19, Time = 3/4,
r = 0.10, b = 0, sigma = 0.28)
## Currency Option [Haug 1.1.5]
r = 0.06; rf = 0.08
GBSOption(TypeFlag = "c", S = 1.5600, X = 1.6000,
Time = 1/2, r = 0.06, b = 0.06-0.08, sigma = 0.12)
## Delta of GBS Option [Haug 1.3.1]
GBSGreeks(Selection = "delta", TypeFlag = "c", S = 105, X = 100,
Time = 1/2, r = 0.10, b = 0, sigma = 0.36)
## Gamma of GBS Option [Haug 1.3.3]
GBSGreeks(Selection = "gamma", TypeFlag = "c", S = 55, X = 60,
Time = 0.75, r = 0.10, b = 0.10, sigma = 0.30)
## Vega of GBS Option [Haug 1.3.4]
GBSGreeks(Selection = "vega", TypeFlag = "c", S = 55, X = 60,
Time = 0.75, r = 0.10, b = 0.10, sigma = 0.30)
## Theta of GBS Option [Haug 1.3.5]
GBSGreeks(Selection = "theta", TypeFlag = "p", S = 430, X = 405,
Time = 0.0833, r = 0.07, b = 0.07-0.05, sigma = 0.20)
## Rho of GBS Option [Haug 1.3.5]
GBSGreeks(Selection = "rho", TypeFlag = "c", S = 72, X = 75,
Time = 1, r = 0.09, b = 0.09, sigma = 0.19)
## CHAPTER 1.3 OPTIONS SENSITIVITIES:
## The Generalized Black Scholes Option Formula
GBSCharacteristics(TypeFlag = "p", S = 1.5600, X = 1.6000,
Time = 1, r = 0.09, b = 0.09, sigma = 0.19)
## CHAPTER 1.5: RECENT DEVELOPMENTS IN COMMODITY OPTIONS
## Miltersen Schwartz Option vs. Black76 Option on Futures:
MiltersenSchwartzOption(TypeFlag = "c", Pt = exp(-0.05/4), FT = 95,
X = 80, time = 1/4, Time = 1/2, sigmaS = 0.2660, sigmaE = 0.2490,
sigmaF = 0.0096, rhoSE = 0.805, rhoSF = 0.0805, rhoEF = 0.1243,
KappaE = 1.045, KappaF = 0.200)
Black76Option(TypeFlag = "c", FT = 95, X = 80, Time = 1/2, r = 0.05,
sigma = 0.266)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.