calcBSImpVol(cp,P,S​,K,T,r,q)

版本 1.13.0.0 (7.3 KB) 作者: Mark Whirdy
Calculates Black-Scholes Implied Volatility for Full Surface at High Speed
2.3K 次下载
更新时间 2018/2/11

查看许可证

Calculates Black-Scholes Implied Volatility Surface for an Option Price Matrix.
Uses Li's Rational Function Approximator for the Initial Estimate, followed by
3rd-Order Householder's Root Finder (i.e. using vega,vomma & ultima) for greater
convergence rate and wider domain-of-convergence relative to Newton-Raphson. Both
Li's Approximator and the Root Finder are calculated matrix-wise (i.e.
fully vectorized) for increased efficiency.

引用格式

Mark Whirdy (2024). calcBSImpVol(cp,P,S,K,T,r,q) (https://www.mathworks.com/matlabcentral/fileexchange/41473-calcbsimpvol-cp-p-s-k-t-r-q), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2012b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Financial Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.13.0.0

removed the linear regression code which estimates the initial vol for points lying outside Li's domain of approximation. this regression code required in-domain values to be passed-in by the user to work. Out-of-domain vols are now 0.8

1.12.0.0

Amended to facilitate input variables "cp", "q" & "r" as matrices
cp Call[+1],Put[-1] [m x n],[1 x 1]
r Continuous Risk-Free Rate [m x n],[1 x 1]
q Continuous Div Yield [m x n],[1 x 1]

1.11.0.0

Amended Code allowing matrix inputs for "cp", "r" and "q"

cp Call[+1],Put[-1] [m x n],[1 x 1]
r Continuous Risk-Free Rate [m x n],[1 x 1]
q Continuous Div Yield [m x n],[1 x 1]

1.9.0.0

Changed comment
"S Underlying Price [m x n]"
to
"S Underlying Price [1 x 1]"
.. as was misleading
This version of the file handles S as a scalar only.

1.7.0.0

Re-factoring of anonymous functions in Householder root solver to re-calculate derivatives & for only those points which have not converged. This increases speed by 20-50% (depending on particular surface).

1.6.0.0

Added Comments

1.1.0.0

Fixed bug in Put-Call Parity line

P = P + S.*exp(-q.*T) - K.*exp(-r.*T); % Convert Put to Call by Parity Relation

1.0.0.0