Risk-neutral Density Fitting Tool (MATLAB)
MATLAB App installer v18.12 (recommended)
Zip archive containing all codes v18.12
The Risk-neutral Density Fitting Tool tool (rndfittool) allows for inferring the risk-neutral density (RND) and the Greeks embedded in a set of observed call and put option prices. The underlying methodology is fully non-structural, meaning that it does not rely on any parametric model, and it consists in approximating the RND through orthogonal polynomial expansions. A detailed description of this methodology is provided in this paper (RND and moments) and in this paper (Greeks). Please note that this tool is not a standalone software, but it fully relies on the MATLAB suite.
This code has been tested on MATLAB R2017a, R2016b, R2015b, R2014a and R2014b. However, there is a chance that it also runs on older versions of MATLAB. The following MATLAB Toolboxes are required to ensure full compatibility of the code:
There are two options to install the Risk-neutral Density Fitting Tool on your machine.
rndfittool
to run the tool.
Edit input data
. Press Edit input data
to validate your changes. Change strike boundaries (you may need to repeat this step in case the fitting is not satisfactory). Press Apply tool
and Apply and Exit
to save all changes and return to the main window.
Find greeks
to compute the Greeks (still model-free).
Export plots
and Export results
.
The standard format for input data is a MAT-file (see this sample) with the following structure
Variable name: [Size Type]
K: [Mx1 double] %%%%%%
call: [Mx1 double] % Mandatory
put: [Mx1 double] %
m: [2x1 double] %%%%%%
obsDate: [1x6 int] %%%%%%
expDate: [1x6 int] %
call_a: [Mx1 double] % Optional
call_b: [Mx1 double] %
put_a: [Mx1 double] %
put_b: [Mx1 double] %%%%%%
K
vector of strike valuescall
vector of observed call pricesput
vector of observed put pricesm
vector containing guessed mean and variance (can be set to [])obsDate
observation date in numeric format ‘yyyy mm dd’expDate
expiry date in numeric format ‘yyyy mm dd’call_a
vector of call ask pricescall_b
vector of call bid pricesput_a
vector of put ask pricesput_b
vector of put bid pricesInput data can also be loaded from external sources and optionally converted into compatible MAT-file forma through Edit input data
. However, loading MAT-formatted data is normally faster.
The data must have .xls, .xlsx or .csv extension and be formatted with all options (e.g. date format) set to the default values provided in the OptionMetrics download page. The dataset must contain all the information related to the mandatory variables. Possibly unrequired fields can be safely appended at any position of the spreadsheet, if needed. Options with several maturities and/or observation dates can be collected into the same file. If this is the case, the user will be asked to choose a maturity when loading data.
The data may be saved either into default .dat format available at CBOE website or be pre-converted into .xls/.xlsx format. The dataset must contain all the information related to the mandatory variables. Possibly unrequired fields can be safely appended at any position of the spreadsheet, if needed. If this is the case the user will be asked to choose a maturity when loading data.
Note: The CBOE format changed on 26/11/2018. The new format is supported only in the latest version of rndfittool.