Description Usage Arguments Examples
plotImpliedVol
takes a data frame, applies black76ImVoDF
to calculate
implied volatility and plot it against strike price and time to maturity.
1 2 | plotImpliedVol(df, Ftdf, Kdf, typedf, Timedf, rdf, optionPricedf,
sigma_ini = NULL, tol = 1e-04, maxiter = 20, phi = -70, theta = 5)
|
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. |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.