Monte Carlo Simulation - Google Sites

1 downloads 335 Views 1MB Size Report
You are going to use simulation elsewhere in the .... If we use Monte Carlo simulation to price a. European ...... Do no
5092.2 Monte Carlo Simulation FM5092 Chris Prouty University of Minnesota

Agenda

• First, a little more on C# Interfaces • Then today’s main topic: an introduction to Monte Carlo simulation • I strongly encourage you to read the chapters in Implementing Derivative Models that have to do with simulation • Also, if you have the Brandimarte book I encourage you to read the relevant chapters regarding Monte Carlo – You are going to use simulation elsewhere in the MFM program, so you’ll see this stuff again

C# Interfaces

• I’d like to cover an example of interfaces using a common .NET interface: IConvertible • We have seen IConvertible at work when we’ve used the Convert class • IConvertible forces the implementing class to implement a number of methods to convert data to a new desired type • We are going to create our own type and implement IConvertible to make our type compatible with the Convert class • Recall the syntax for implementing interfaces: class OurNewType : IConvertible

• I’m going to create a class that contains the Spot AUD/USD FX rate

C# Interfaces

• I can right-click on the IConvertible interface to implement the necessary methods in my class

The bottom choice, to implement explicitly, is useful if two interfaces are being implemented and they share a method name. For now, we can choose the top selection, “Implement Interface”.

• Notice the code generated by Visual Studio

C# Interfaces

Notice that these methods feature parameters that must implement the IFormatProvider interface.

• We must now implement code to deal with making a type conversion from our SpotAUDUSD data to any given format – Some type conversions are not supportable

• Here I added a field to contain the FX value SpotFX field with basic getter and setter definition.

C# Interfaces

Does it make sense to be able to convert a Spot FX price to a boolean?

• For type conversions that don’t make sense, we can throw a relevant exception This same exception is thrown if you try to convert a DateTime object to a boolean.

C# Interfaces

• For all other methods, implement relevant code to perform the conversion

• Now our new class can be used with Convert Because we are converting to an integer, rounding will take place and data will be lost.

C# Interfaces

• Don’t be afraid to try implementing .NET interfaces in your projects • Using .NET resources (like Convert) is much easier if you make your code conform to .NET using interfaces • Later in the semester I will introduce a feature of the C# language called LINQ • LINQ is a powerful way to organize and query collections of objects in your code • Understanding interfaces will allow you to make classes that work smoothly within the LINQ query structure

• So far in this class we have discussed three methods of pricing derivatives

Monte Carlo Simulation

– Black-Scholes (closed formula) – Binomial tree – Trinomial tree

• These methods, properly applied, provide ways to price many types of options (European, American, Asian, etc) • For a number of reasons, these methods are sometimes intractable • Monte Carlo simulation is a numerical technique that can be used to price almost anything

Monte Carlo Simulation

• There are a number of complex derivatives for which formulas, such as B-S, are unrealistic • Monte Carlo simulation is a process of creating a simulated path of an underlying (such as a stock) many times, and using those paths to price some type of financial instrument • Simulation is very useful in cases of options on multiple assets, spreads, and stochastic volatility or rates • Simulation can also create a more realistic picture of price evolution, including jumps in asset prices from daily close/open

Monte Carlo Simulation

• Monte Carlo simulation is often based on geometric Brownian motion • Recall from last semester one of the assumptions of the Black-Scholes model: The price of the underlying instrument follows a geometric Brownian motion with constant drift μ and volatility σ, and the price changes are log-normally distributed. • Recall also that Black-Scholes prices European options • If we use Monte Carlo simulation to price a European option, will the result be the same as Black-Scholes?

Monte Carlo Simulation

• Simulation, although highly flexible and useful, has substantial downsides • The foremost downside is required computation • Simulation by nature is computationally inefficient • In contrast, the Black-Scholes model or even a tree model requires much less computation • Simulation is based on numbers generated randomly, which generates a variance value relating to the group of random values • This variance is present in the price of the derivatives priced using the simulation, which can lead to inconsistent pricing

Monte Carlo Simulation

• All of the downsides can be addressed (although not eliminated) through a handful of tricks involving variance reduction and computational efficiency • We define a standard one-dimensional Brownian motion on [0,T] as a stochastic process {W(t),0≤t≤T} with the following properties – W(0)=0 – the mapping t → W(t) is, with probability one, a continuous mapping on [0,T] – the increments {W(t1)-W(t0),W(t2)-W(t1),…,W(tk)-W(tk1)} are independent for any k and any 0≤t0