This Case Study shows, how to speed-up a Monte Carlo simulation in Excel. The model for the Monte Carlo simulation is the pricing of an American option, which is defined in a ThetaML model. This is defined in Theta Suite, evaluated in Matlab and controlled from within MS Excel.
The following Monte Carlo case study requires:
- Theta Proxy XL
- Theta Suite Professional
- Matlab
- Matlab SpreadsheetLink
After the installation of Theta Proxy, Matlab, Matlab SpreadsheetLink and Theta Suite Professional, you are ready for using Monte Carlo from Theta Suite and Matlab in Theta Proxy.
Please follow the instructions below:
After the successful intallation of the Matlab SpreadsheetLink addin, everytime when you open excel, matlab will be automatically open. Now, download ThetaRunWrapperInit.m and ThetaRunWrapper.m and put them into your matlab path folder.
Start Theta Suite by a click on “runThetaSuite” in your ThetaSuite folder. In the Project Explorer, we can find “EquityOptions.thetaml” file, double click it, the ThetaML configurator will display:

Right click on this thetaml file and click properities, copy the location of this file and paste into your matlab “Current Folder” address, for example:

Copy the following two file into your current Matlab directory:
Now, you are able to run this EquityOptions model in Matlab, simply type:
>> ThetaRunWrapperInit
>> A=ThetaRunWrapper('EquityOptions.thetaml', 1000, 'P', 'data.SInitial', 90)in your Matlab Command window. If you get A = 10.8809, you are all set with the configuration part.
Now, it is time to work on Excel. Prepare a new Excel sheet with the following content:

If you can get the same result 10.8809, then you are ready to train this function in Theta Proxy. If you get error “#'NOCOMMAND”, please make sure that the address of your matlab Current Folder is correct.
After that, you are invited to click on the train button and speed-up your function. See QuickStart for further details. After training, we can get the result as below:

That means, we got a speed-up of over 15.000x ! Now, the American Option is set for real-time Excel evaluations!