MATLAB: How to translate the Monte Carlo simulation into a distribution function in MATLAB

Financial Toolbox

I have a Monte Carlo simulation that I have simulated with the PORTSIM function in the Financial Toolbox. I would like to determine the probability that a portfolio return is within a given range.

Best Answer

A Monte Carlo simulation provides empirical data for the distribution. The ECDF function is used to calculate an empirical cumulative distribution function from the simulated data.
In PORTSIM, you can perform a Monte Carlo simulation of the return on a given portfolio, thus yielding several simulated returns all at once. These returns can then be passed to the ECDF function to determine the probability a return is within a specified range.