Your SlideShare is downloading. ×
  • Like
Monte Carlo Simulation Of Heston Model In Matlab(1)
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Monte Carlo Simulation Of Heston Model In Matlab(1)


Bachelore Thesis Presentation

Bachelore Thesis Presentation

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Monte Carlo Simulation of Heston Model in MATLAB GUI and its Application to Options BACHELOR THESIS IN MATHEMATICS /APPLIED MATHEMATICS DEPARTMENT OF MATHEMATICS AND PHYSICS MÄLARDALEN UNIVERSITY Author Amir Kheirollah Supervisor Robin Lundgren Examiner Dmitrii Silvestrov
  • 2. Abstract
    • In the Black-Scholes model, the volatility considered being
    • deterministic and it causes some inefficiencies and trends in pricing options. It has been proposed by many authors that the volatility should be modelled by a stochastic process . Heston Model is one solution to this problem. To simulate the Heston Model we should be able to overcome the correlation between asset price and the stochastic volatility .
    • This paper considers a solution to this issue. A review of
    • the Heston Model presented in this paper and after modelling some investigations are done on the applet.
    • Also the application of this model on some type of options has programmed by MATLAB Graphical User Interface (GUI).
  • 3. Summary
    • The Theoretical Background
    • Monte Carlo Simulation
    • An Overview on Black-Scholes Model
    • Theory of Heston Model
    • Cholesky Decomposition
    • Types of Options Under Study
    • Empirical Investigations
  • 4. The Theoretical Background
    • Implied or Local Volatility’s inefficiency on Black-Scholes Formula
    • Volatility varying by strike (e.g. volatility smile or skewness)
    • Observations where the volatility varies ( randomly)
    • Volatility to be stochastic
    • In compare to other stochastic volatilities Heston Model is:
        • A semi-analytical formula
        • Forms small steps of time
        • Keeps the volatility positive
        • Allows the correlation between asset returns and volatility
  • 5. Monte Carlo Simulation
    • A mathematical experimentation tool.
    • A crucial techniques in pricing of derivative securities
    • To improve the efficiency of a simulation.
    • Applications in Mathematical Finance
    • To assess the efficiency of the method three considerations are maid:
        • computing time,
        • biasness
        • and finally variance.
    The method samples randomly from a universe of possible outcomes and takes the fraction of random draws that fall in a given set as an estimate of the set’s measure. The Law of Large Numbers guarantees the convergence of the estimation to the correct value as the number of draws increases.
  • 6. An Overview on Black-Scholes Model
    • Black-Scholes Model is fairly the best known continuous time model.
    • The model is simple and requires only five inputs:
        • the asset price,
        • the strike price,
        • the time to maturity,
        • the riskfree rate of interest,
        • and the volatility.
    • The simple Black-Scholes assumes that the underlying price is given by the process
    • The Black-Scholes formula for a European Call Option
    • Where,
  • 7. The Heston Model – Genral Form of SDEs
    • The general form of an SDE
    • if,
    • Then
    • Which results in
    (1) (2)
  • 8. The Heston Model
    • Now by introducing the Heston Model and considering the last procedure;
    • where
    • v t is the instantaneous variance of the underlying asset,
    •  /  is the long-run mean of the instantaneous variance,
    •  is a parameter that indicates the speed of the mean-reversion of the variance,
    • and σ v is the variance of the variance process (volatility of volatility).
    • W 1 and W 2 are two correlated Wiener processes with correlation  .
    • drift in price process, .
    • drift in volatility process .
    • and finally diffusion processes;
      • for price process, .
      • for volatility, .
    (3) (4)
  • 9. The Heston Model
    • Next step is to simplify this model by discretization of the diffusion processes in order to apply the Cholesky decomposition and finding the correlation between Wiener processes.
    • By discretizing the Wiener processes
    • By the result
    W 1 and W 2 In equations (3) and (4) Replaced by Where epsilons are correlated (5) (6)
  • 10. The Heston Model – Discretization Versus Randomization
    • How to randomize the correlation?
    • Letting be a vector of IID normal random numbers and epsilon to be a vector of , then;
    • in order to get enough random vectors of correlations between two Wiener processes we repeat (5) and (6)
    ε = Ax + µ (7)
  • 11. The Heston Model – Mean Reversion
    • A fair generation of random numbers around the mean surges employing a mean reverting model on volatility process.
    • As before mentioned Beta is the factor which controls the speed of this mean reversion mechanism in the volatility process.
    • Also by considering equation (1), these factors are easily traceable on the general form of SDEs.
  • 12. The Heston Model – Application of Monte Carlo Simulation and Cholesky Decomposition
    • The data generated by Monte Carlo simulation where the two random stochastic processes are correlated by cholesky decomposition and randomizing this concept we are able to evaluate the underlying asset.
    • By considering the discretized Heston Model
  • 13. The Heston Model – Application of Monte Carlo Simulation and Cholesky Decomposition
    • And by refereeing to our last argument on epsilons and the random vector x,
    • If
    • By equation (7)
    • Where it results in
    • Which is ready for programming.
  • 14. Options under Study
    • The options programmed and studied
    • are:
      • European Call Option
      • Average (Asian) Option
      • Look-back Option
    1) 2) 3) where
  • 15. Empirical Investigation
    • An investigation on European option and evaluation methods
    • Pricing a European call option by both Heston and Black-scholes Model.
    • Consider equal condition for both models.
    • Consider some constant inputs for both models
    • Dividend considered for both models ( a note to Black-scholes)
    • The data
    • Type of option : European call option Volatility : 0.05
    • Time to maturity : 10 days Initial volatility : 0.05
    • Strike price : $89 Alpha : 0.02
    • Spot Price : $100 Beta : 0.2
    • Interest rate : 0.02 Rho : 0.04
    • Dividend yield : 0.1
  • 16. Empirical Investigation – The Table   Table 1: Data for Empirical Investigation Category Number of Iterations Black-Scholes (BLS) Price Heston Model Price Heston Model STD Heston Model MIN Heston Model MAX Heston Model COV Heston Model’s Relative Error from BLS 1 10 11,0666 11,3257 1,2997 7,8744 14,0729 1,6893 0,023413 2 100 11,0666 11,0667 0,4381 10,0278 12,2727 0,1919 9,04E-06 3 1000 11,0666 11,0632 0,1146 10,6927 11,2826 0,0131 0,000307 4 5000 11,0666 11,067 0,0567 10,9516 11,2267 0,0032 3,61E-05 5 10000 11,0666 11,0568 0,0402 10,9635 11,1486 0,0016 0,000886 6 25000 11,0666 11,0599 0,023 11,0006 11,1159 5,30E-04 0,000605 7 50000 11,0666 11,0601 0,0156 11,0249 11,0929 2,44E-04 0,000587
  • 17. Empirical Investigation
    • To improve the result categories of iterations by 100 expriments for each hired.
    • Two observations:
      • What is the relation of the mean on stochastic Heston Model to the deterministic Black-Scholes?
      • What the experiments tells us about the accuracy of the Heston formula modelled by Monte Carlo simulation?
    European call option priced by both methods. As number of iterations increases the price of Heston Model converges To price obtaind by Black-Scholes.
  • 18. Empirical Investigation
    • Increasing the number of iterations,
    • there is strong evidence in decreasing
    • standard deviation.
    • An evidence resulted by Strong Law
    • of Large Numbers .
    • This is clear from the 4 th and 5 th column of table one where the data on two extremes of each category of iterations is given. The interval diminishes by the rise of number of iterations.
    Standard Deviation
  • 19. Empirical Investigation
    • The relative error behaviour according
    • to increase in number of iterations.
    • after a dramatic decrease we face
    • an unusual increase followed by a
    • gradual decrease.
    • According to definition Monte Carlo
    • simulation’s set is a set of IID random
    • variables.
    • Our research shows that this is not
    • the case. But by increasing the
    • number of iterations the accuracy
    • of this assumption is more touchable.
    Relative Error of Heston Model from Black-Scholes Model Covariance Between Prices Respective Number of Iterations.
  • 20. Empirical Investigation
    • One of critics to this method of programming is the length of time to execute the program. For iterations more than 10000 performance of the program is under question. While it showed by impirical investigation that results of 10000 and more iterations are not really different from eachother.
    • One solution to this inefficiency can be simulation of standard Brownian motion by Karhunen-Loeve expansion .
    • An investigation on Options’ evaluation by MATLAB GUI
    • The same data applied from the first empirical investigation.
    • Three samples of each 100 observations on each type of option taken.
    • By calling the negligible difference between choosing 10000 or more iteration in order to reduce the time of experiment, samples of hundreds by 10000 iterations are chosen.
  • 21. Empirical Investigation Data for Empirical Investigation
    • Standard deviation, Min and Max values are in an acceptable range.
    • Mean on Average and European call options are almost close, which implies by a
    • larger sample of data the result of the calculation will be almost equal for this two types.
    • Interesting Result
    • European call option reach the value of the Average call option if the sample of data
    • gets large enough.
    10000 Iterations Price STD MIN MAX Asian Option 11,03488 0,025823128 10,972 11,095 Look Back Option 14,06824 0,028532498 14,001 14,139 European Call Option 11,05677 0,04028882 10,963 11,149
  • 22. MATLAB GUI Manual – Graphical Representation Opening window of the program HestonGUI.
  • 23. MATLAB GUI Manual – User Manual The pattern considered in example.
  • 24. MATLAB GUI Manual – User Manual
    • 1- Run the program from MATLAB.
    • 2- Choose the option type you want to calculate its price from the popup menu. In the case of our example we choose the European option which is by default chosen already by the program.
    • 3- Decide how many iteration you will consider in your calculation. Note that number of iterations can heavily affect on the time of calculations by Monte Carlo simulation. By default the program considers one thousand iterations which we will not change in our example.
    • 4- Put in the length of the period you want to calculate the price for it. The program considers the finance year to be 252 days. In our case we consider a 3 months or 90-days European call option.
    • 5- Next step can be determination of spot and strike price. We will consider the same values taken by default.
    • 6- Interest rate should be considered also as an input to the program. This value usually is declared by central banks in the countries. In our example we consider the interest rate to be 2%.
    • 7- The initial volatility also should be considered. The benchmark for this value can be the historical volatilities in option markets. In our case we consider %7 volatility.
    • 8- The last step in giving data to the program where we put in values for Greeks, we can consider the default values.
    • 9- To see the result we push the execute button and run the program.
    • 10- The result is shown in the asset price field.
    • 11- To reset the program to defaults reset button should be used.
  • 25. MATLAB GUI Manual – Error-dialogue Windows Error-dialogue declaring the input can not be negative or non-numeric. Error-dialogue declaring the input can not be taken other than the interval. Error-dialogue declaring the input can not take zero, non-numeric or negative values. Error-dialogue windows of the program.
  • 26. Conclusion
    • The Heston model successfully modelled by MATLAB GUI after development a solution to the desired calculation of correlations between stochastic terms of the model.
    • The Empirical Investigations on the model showed the accuracy of the model and since Black-Scholes chosen as benchmark the test on this model showed a high degree of accuracy.
    • Also as mentioned before in empirical investigation it is possible by some methods to avoid programming the inner loop of the program and in this way by using such a random distribution that mentioned before reduce the time of simulation dramatically.
    • Also the analytical solution to exotic options by Heston Model is available which can be an interesting research question to be compared with the simulation.