This submission contains all code and data used in the technical article "Estimating Option-Implied Probability Distributions for Asset Pricing".
Ken Deeley (2021). Estimating Option-Implied Probability Distributions for Asset Pricing (https://www.mathworks.com/matlabcentral/fileexchange/53473-estimating-option-implied-probability-distributions-for-asset-pricing), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
Hi Tong Li,
I'm not sure why you still receive this error. Please could you contact MathWorks support for further assistance? (https://www.mathworks.com/support/)
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: 8.5.0.197613 (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'.
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.
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
@(X)tempSigmaCall-blackvolbysabr(X(1),beta,X(2),X(3),char(settle),exercise,tempForward,tempK)
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
continue.
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!
Hi Caxap,
Please check the version of MATLAB you are using to run this code. Graphics commands such as
ax.Children.Color
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.
Error appears:
Attempt to reference field of non-structure array.
Error in OptImpRatesArticle (line 56)
cols = flipud(cat(1, ax.Children.Color));