2012-04-09 18 views
2

Ich habe einige historische Optionspreise und ich versuche, ein implizites Delta zu bestimmen.R-Option implizierte Delta-Berechnung

Ich habe das:

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

ich zu tun, um eine harte, die so ein Paket/Funktion in R zu finden.

Ich habe mir das fOptions Paket angeschaut, aber es scheint nichts zu geben, um implizierte Griechen zu verstehen.

Irgendwelche Vorschläge?

Antwort

4

Sie können RQuantLib verwenden, um die implizite Volatilität und dann die anderen Griechen zu berechnen.

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 
Verwandte Themen