2012-04-09 90 views
2

我有一些歷史期權價格,我試圖確定一個隱含的增量。R選項隱含增量計算

我有:

1) strike 
2) call/put 
3) stock price 
4) dividend 
5) interest rate 
6) option price 

我有一個很難尋找在R A包/函數來進行。

我已經看了fOptions包,但似乎沒有任何東西來計算隱含的希臘字符。

有什麼建議嗎?

回答

4

您可以使用RQuantLib計算隱含波動率,然後計算其他希臘幣。

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