Tutorial Using Stochastic Processes In this tutorial we demonstrate how to use Fairmat Academic to solve exercises involving Stochastic Processes 1, that can be found in John C. Hull Options, futures and other derivatives [Chapter 20, 5th Edition]. You can also find a video for this tutorial at: http://youtu.be/cjk3zfl0ovi 1 Hull & White, Mean Reverting 1
1 How to determine expected value of Call and Put options 1 How to determine expected value of Call and Put options As you know in order to calculate the expected value of a call or a put option it s necessary to calculate the maximum value many times before the end period: c = (S K) +, p = (K S) + where K is the strike price. We can t know the price of a future date, but financial theory says that price dynamic evolves as a stochastic process (Wiener, Geometric Brownian motion etc...): ds = µdt + σdw Note: A European option may be exercised only at the expiry date 2. An American option on the other hand may be exercised at any time before the expiry date. Fairmat creates a particular stochastic process. In order to calculate call/put value: Create parameters: K: it is the strike price; mu: it is average of process; Parameters & Functions Add Select Constant 2 Maturity/end date. 2
1 How to determine expected value of Call and Put options Create a Stochastic Process 3 : choose the stochastic models. built-in dynamics are available. Different Note: f these process aren t available you can install them as follows: Setting Plugins Settings Available online plugins. 3 Fairmat names them V1,V2,... 3
1 How to determine expected value of Call and Put options In this case we have chose Mean Reverting Process 4, but you can choose any one you wish. Note: in the Edit Stochastic Process (highlighted in orange) insert parameters (Mean Reversion Rate=µ Long-term Mean=K). Here you can see the process Dynamics Preview (highlighted in red) and the Distribution (highlighted in blue) at time t moving the cursor (highlighted in green). 4 ds t = µ (L S t)dt+ σ dw 4
1 How to determine expected value of Call and Put options In this case Long-Term Mean is a constant, but Fairmat can show it in another way, for example as a time function: Create a function in t (highlighted in blue), insert it in to the Long-term mean in Edit Stochastic Process. You can show then see a preview (highlighted in pink). Create in Option Map a option block. You can choose three types: European-style (green rhombus); American-style (blue rhombus); Custom (pink rhombus); Note: now consider a European-style. 5
1 How to determine expected value of Call and Put options The option payoff can be any analytical expression. In this case we are modelling a call 5 option: Insert call formula (V 1 K) 6 and the End(Maturity). Choose a Simulation date and click the Run button Double click on Exp. Value and you can see the MTM price and present value distribution (highlighted in pink). 5 Use K-V1 for put modelling. 6 Fairmat considers maximum. 6
2 Forward Rate Agreement You can change the type of option, for example from European to Americanstyle, using the combo box in the option block: Fairmat automatically changes the type of Option. Fairmat computes the Mark-to-Market (MTM) price using Monte-Carlo simulation with a default setting, but you can change this: Choose the number of step and of simulation. 2 Forward Rate Agreement A Forward Rate Agreement (FRA) is a forward contract (see Tutorial #1), between parties that determines the rate of interest to be paid or received on a future date. In Fairmat it is easy to calculate a Forward rate Agreement (FRA). 7
2 Forward Rate Agreement The following data are available: Pd: vector containing payment dates; tau: it is a vector difference transformation about Pd; zr: it is the zero rates vector; Parameters zr is a Interpolate function, column X (highlighted in pink) indicates the period column Y (highlighted in green) indicates the rates value. Pd is a vector dates 7. 7 See Tutorial # 2 for import parameters. 8
2 Forward Rate Agreement The combo box (in blue) indicates the date on which to start the transformation (write it in Setting Project Preferences 8 ), the green indicates the convention of adjusting dates specified or determined with regard to a particular transaction, and the pink indicates the difference between the actual date and the previous one. 8 See Tutorial # 2 to do it. 9
2 Forward Rate Agreement To enter the cash flows, open the Option Map and create a strip of options (pink rhombus), which can handle a sequences of payments. The block FRA calculates the total rates for the nominal amount (in this case it is 1). 9 Block FRA: the payoff F RA(P d[#]; T au[#]; @zr) is calculated for element in Vector in a determinate position expressed that takes the values 1,2,...,length(@Pd) click Run Analysis and see the valuation result in the bottom panel (Valuation tab) 9 Options Strips simplifies the repetition of similar payoffs and exercise dates (by allowing to parametrize expressions using the character #), and summing them over the components of an input vector. 10
3 How to calculate a variable rate 3 How to calculate a variable rate Consider section 3 in Tutorial #2. The floating rates aren t known, but with Fairmat you can do a simulation for them. For example, to calculate a VAR leg with nominal amount, zero rates and payment date. The data are: Pd: it is a vector contain the payment date; tau: it is a vector difference transformation about Pd; zr: it is the zero rates vector; RD: it is the rate date vector; Parameters Constant 10 See Tutorial # 2 for import parameters. Vector 10 11
3 How to calculate a variable rate The combo box (in blue) indicates the date to start the transformation (write it in Setting Project Preferences so Fairmat calculates the difference between the actual date and the previous one. In order to calculate the VAR leg create a Stochastic Process 11 11 Use Hull and White method John C. Hull Options, futures and other derivatives [Chapter 24 section 24.1, 5th Edition] 12
3 How to calculate a variable rate Insert the Hull and White parameters. Note: zr is a vector 12 In order to calculates the VAR leg open the Option map and insert a Option Strip and click on it 12 Write the symbol @ before vector name. 13
3 How to calculate a variable rate It calculates the total payment of the floating rates of the nominal amount (nominal (rate(rd[#]; tau[#]; @v1) + spread) Rd[#]). Options Strips simplifies the repetition of similar payoffs and exercise dates (by allowing you to parametrize expressions using the character #), and summing them over the components of an input vector. The parameter RATE is a particular function in Fairmat Click Ctrl+spacebar to show a help bar 14
3 How to calculate a variable rate To do the calculation click on Run Analysis. You will then see the valuation result in the bottom panel (Valuation tab). Note: the solutions have a Standard Deviation and a Standard Error because they are stochastic calculation Double click on a solution and see the Project value graphic and statistics. 15