append_implied_volatility: Append European Option Implied Volatilities to DataFrame

Description Usage Arguments Details Value Author(s) See Also

View source: R/compute_implied_volatility.R

Description

append_implied_volatility returns a dataframe with European Option implied volatilities

Usage

1
2
append_implied_volatility(df, risk_free_rate = 0.01,
  initial_volatility_guess = 0.5)

Arguments

df

Dataframe with columns named type, value, underlying, strike, and maturity

risk_free_rate

Risk-free rate (number, default: 0.01)

initial_volatility_guess

Initial guess for the volatility (number, default: 0.5)

Details

This function computes the volatilty of a European Option for each row in the dataframe that is passed to it. It will do so using the compute_implied_volatility function in this package, which is a wrapper around the EuropeanOptionImpliedVolatility function from the RQUantLib package.

The columns in the dataframe should be as follows: - type: One of the two values: 'call' or 'put' (string) - value: Value of the option (number) - underlying: Current price of the underlying (number) - strike: Strike price of the option (number) - maturity: Time to maturity in fractional years (number)

TODO: Model/financial restrictions on the parameters should be made clear here...

The EuropeanOptionImpliedVolatility function asks for a dividend_yield which we assume to be 0 as this is not a stock.

Fore more information about RQuantLib: https://cran.r-project.org/web/packages/RQuantLib/RQuantLib.pdf

For more information about QuantLib: http://quantlib.org/index.shtml

Value

implied volatility of a European Option appended (dataframe)

Author(s)

John Dole <jdoleiv@gmail.com>

See Also

EuropeanOptionImpliedVolatility

append_implied_volatility


otrenav/implied-volatility-r-package documentation built on Dec. 31, 2020, 1:10 a.m.