RQuantLibを使用して、暗黙のボラティリティを計算し、次に他のグリreeを計算することができます。
library(RQuantLib)
value <- 9.15
type <- "call"
underlying <- 100
strike <- 100
dividendYield <- 0
riskFreeRate <- 0.03
maturity <- .5
# Compute the implied volatility
volatility <- EuropeanOptionImpliedVolatility(
type = type,
value = value,
underlying = underlying,
strike = strike,
dividendYield = dividendYield,
riskFreeRate = riskFreeRate,
maturity = maturity,
volatility = .01
)$impliedVol
# Compute all the greeks
EuropeanOption(
type = type,
underlying = underlying,
strike = strike,
dividendYield = dividendYield,
riskFreeRate = riskFreeRate,
maturity = maturity,
volatility = volatility
)
# Concise summary of valuation for EuropeanOption
# value delta gamma vega theta rho divRho
# 9.1500 0.5702 0.0185 27.7721 -9.7682 23.9330 -28.5080