RQuantLib返回Vega,Theta,Rho,DivRho NA [英] RQuantLib is returning Vega, Theta, Rho, DivRho NA

查看:92
本文介绍了RQuantLib返回Vega,Theta,Rho,DivRho NA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在调用RQuantLib的AmericanOption方法来获取希腊语

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"))

对于上述参数,我们得到以下希腊文 简明的AmericanOption估值摘要

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

为什么某些值是NA?

Why some of the values are NA ?

我发送的值错误吗?

要获得所有有效值我需要进行哪些更改?

What changes i need to have to get all valid values ?

推荐答案

您必须通过数字计算剩余的希腊语.

You have to calculate the remaining Greeks numerically.

要对对类似问题的德克答案加一点:通过设计, QuantLib函数(RQuantLib依赖于此函数)仅返回可以廉价计算的希腊文.例如,欧洲期权通过分析公式定价,并且可以通过返回其衍生工具(也由分析公式给出,因此计算便宜)来返回所有希腊人.

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).

相反,美式期权的价格是通过有限差分模拟计算的,因此没有可区分的公式.模拟的机制使计算和返回Delta和Gamma变得容易,就像您看到的那样,但是其他希腊人必须通过更改输入和重新定价选项来进行数值计算;再看一遍Dirk答案中链接的主题,或者我录制的此截屏视频.这并不便宜,因此留给了可以评估要计算哪些希腊文以及精确度如何的用户.

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.

这篇关于RQuantLib返回Vega,Theta,Rho,DivRho NA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆