plotImpliedVol: plotImpliedVol

Description Usage Arguments Examples

Description

plotImpliedVol takes a data frame, applies black76ImVoDF to calculate implied volatility and plot it against strike price and time to maturity.

Usage

1
2
plotImpliedVol(df, Ftdf, Kdf, typedf, Timedf, rdf, optionPricedf,
  sigma_ini = NULL, tol = 1e-04, maxiter = 20, phi = -70, theta = 5)

Arguments

df

A dataframe.

Ftdf

Name of a columns in the dataframe corresponding to future price.

Kdf

Name of a columns in the dataframe corresponding to strike price.

typedf

Name of a columns in the dataframe corresponding to option type.

Timedf

Name of a columns in the dataframe corresponding to time to maturity.

rdf

Name of a columns in the dataframe corresponding to interest rate.

optionPricedf

Observed market option premium. Numeric object.

sigma_ini

Initial value for iteration in the Newton-Raphson method. Numeric object or NULL(default). If no value is provided, the sigma which maximizes Vega is choosen.

tol

Error tolerance of the interation step.

maxiter

Maximum number of iteration

phi

Angles defining the viewing the colatitude direction.

theta

Angles defining the viewing the azimuthal direction.

Examples

1
2
3
4
5
6
7
example(black76ImVoDF)
df2 <- df2[sample(x = 1:nrow(df2), size = 10), ]
head(df2)

plotImpliedVol(df = df2, Ftdf = 'Ft', Kdf = 'Strike', typedf = 'type',
              Timedf = 'Time', rdf = 'r', optionPricedf = 'optionPrice',
              tol = 1e-5, maxiter = 1000, phi = -70, theta = 5)

OUKUN0705/black76IV documentation built on May 7, 2019, 8:55 p.m.