问题
I am calling the RQuantLib's AmericanOption method to get the Greeks as
print( AmericanOption(type = 'call',
underlying = 100,
strike = 100,
dividendYield = 0.02,
riskFreeRate = 0.0023,
maturity = 0.5,
volatility= 0.4,
timeSteps = 150,
gridPoints = 149,
engine="CrankNicolson"))
for above parameters, we get following Greeks Concise summary of valuation for AmericanOption
value delta gamma vega theta rho divRho
10.8149 0.5429 0.0141 NA NA NA NA
Why some of the values are NA ?
Am i sending wrong values ?
What changes i need to have to get all valid values ?
回答1:
You have to calculate the remaining Greeks numerically.
To add a bit to Dirk's answer to a similar question: by design, QuantLib functions (which RQuantLib depends upon) only return the Greeks that can be calculated cheaply. For instance, European options are priced through an analytic formula and can return all the Greeks by returning its derivatives (which are also given by an analytic formula, and therefore cheap to calculate).
The price of an American option, instead, is calculated through a finite-difference simulation, so there's no formula to differentiate. The mechanics of the simulation make it easy to calculate and return the Delta and Gamma—which are returned, as you saw—but the other Greeks must be calculated numerically by changing the inputs and repricing the option; see, again, the thread linked in Dirk's answer or this screencast I recorded. That's not cheap, and so is left to the user who can assess what Greeks to calculate and to what accuracy.
来源:https://stackoverflow.com/questions/34629345/rquantlib-is-returning-vega-theta-rho-divrho-na