File Exchange

image thumbnail

Estimating Option-Implied Probability Distributions for Asset Pricing

version (5.24 KB) by Ken Deeley
Create fan charts for future asset prices based on sparse call/put price market data


Updated 01 Sep 2016

View Version History

View License

This submission contains all code and data used in the technical article "Estimating Option-Implied Probability Distributions for Asset Pricing".

Cite As

Ken Deeley (2021). Estimating Option-Implied Probability Distributions for Asset Pricing (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)

Ken Deeley

Hi Tong Li,
I'm not sure why you still receive this error. Please could you contact MathWorks support for further assistance? (

Tong Li

Do you think I have a bad installation? I have the fininst toolbox installed (I removed my license number for security reason below), function 'instbond' works. Any other thing I need to do to enable SABR?

>> ver('fininst')
MATLAB Version: (R2015a)
MATLAB License Number: xxxxxx
Operating System: Microsoft Windows 7 Enterprise Version 6.1 (Build 7601: Service Pack 1)
Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
Financial Instruments Toolbox Version 2.1 (R2015a)
>> blackvolbysabr
Undefined function or variable 'blackvolbysabr'.

Ken Deeley

Hi Tong Li,

The error message indicates that MATLAB is unable to find the function blackvolbysabr. The function blackvolbysabr is part of Financial Instruments Toolbox and was introduced in R2014a. You can check your installation of this toolbox by entering

>> ver( 'fininst' )

at the command line.

Tong Li

Double-checked my Matlab version (R2015a) with all the toolbox installed. I still got the following error. Hope you can help me on this.

Undefined function 'blackvolbysabr' for input arguments of type 'double'.

Error in

Error in lsqnonlin (line 194)
initVals.F = feval(funfcn{3},xCurrent,varargin{:});

Error in OptImpRatesArticle (line 125)
XCall = lsqnonlin(objFunCall, [0.5, 0, 0.5], [0, -1, 0], [Inf, 1, Inf]);

Caused by:
Failure in initial user-supplied objective function evaluation. LSQNONLIN cannot

Caxap Puc

Hi! Thank you for reply. I really impressed with your work, that's why testing feedback is the minimum which I can contribute to motivate you to continue post such a good articles :)
I have found colleague, who uses 2016 version, an everything goes well!

Ken Deeley

Hi Caxap,

Please check the version of MATLAB you are using to run this code. Graphics commands such as


will only work in version R2014b onwards. Also note that the code used in this article is intended to run in MATLAB version R2015a onwards.

Caxap Puc

Error appears:

Attempt to reference field of non-structure array.

Error in OptImpRatesArticle (line 56)
cols = flipud(cat(1, ax.Children.Color));

MATLAB Release Compatibility
Created with R2015a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!