Exercise Sheet 8 - Solutions

Similar documents
Exercise Sheet 7 - Solutions

The concentration of a drug in blood. Exponential decay. Different realizations. Exponential decay with noise. dc(t) dt.

Stochastic Calculus. Kevin Sinclair. August 2, 2016

Stochastic differential equation models in biology Susanne Ditlevsen

MA8109 Stochastic Processes in Systems Theory Autumn 2013

Stochastic Modelling in Climate Science

Lecture 12: Diffusion Processes and Stochastic Differential Equations

Question 1. The correct answers are: (a) (2) (b) (1) (c) (2) (d) (3) (e) (2) (f) (1) (g) (2) (h) (1)

Malliavin Calculus in Finance

Introduction to numerical simulations for Stochastic ODEs

DUBLIN CITY UNIVERSITY

Partial Differential Equations with Applications to Finance Seminar 1: Proving and applying Dynkin s formula

I forgot to mention last time: in the Ito formula for two standard processes, putting

Stochastic Differential Equations

Brownian Motion. An Undergraduate Introduction to Financial Mathematics. J. Robert Buchanan. J. Robert Buchanan Brownian Motion

Short-time expansions for close-to-the-money options under a Lévy jump model with stochastic volatility

Numerical Integration of SDEs: A Short Tutorial

Mathematical Methods for Neurosciences. ENS - Master MVA Paris 6 - Master Maths-Bio ( )

The moment-generating function of the log-normal distribution using the star probability measure

Bernardo D Auria Stochastic Processes /12. Notes. March 29 th, 2012

Stochastic Calculus and Black-Scholes Theory MTH772P Exercises Sheet 1

Chapter 4: Monte-Carlo Methods

1 Brownian Local Time

Lecture 4: Ito s Stochastic Calculus and SDE. Seung Yeal Ha Dept of Mathematical Sciences Seoul National University

LECTURE 2: LOCAL TIME FOR BROWNIAN MOTION

Kolmogorov Equations and Markov Processes

Exact Simulation of Diffusions and Jump Diffusions

lim n C1/n n := ρ. [f(y) f(x)], y x =1 [f(x) f(y)] [g(x) g(y)]. (x,y) E A E(f, f),

DISCRETE-TIME STOCHASTIC MODELS, SDEs, AND NUMERICAL METHODS. Ed Allen. NIMBioS Tutorial: Stochastic Models With Biological Applications

Brownian Motion and Stochastic Calculus

Affine Processes. Econometric specifications. Eduardo Rossi. University of Pavia. March 17, 2009

Theoretical Tutorial Session 2

Expectation, variance and moments

Lecture 2: From Linear Regression to Kalman Filter and Beyond

Numerical methods for solving stochastic differential equations

Numerical Simulation of Stochastic Differential Equations: Lecture 2, Part 1. Recap: SDE. Euler Maruyama. Lecture 2, Part 1: Euler Maruyama

Stochastic Integration and Stochastic Differential Equations: a gentle introduction

Adaptive timestepping for SDEs with non-globally Lipschitz drift

Stochastic Differential Equations

Introduction to the Numerical Solution of SDEs Selected topics

Optimal portfolio strategies under partial information with expert opinions

Exercises in stochastic analysis

Derivation of Itô SDE and Relationship to ODE and CTMC Models

Introduction. Stochastic Processes. Will Penny. Stochastic Differential Equations. Stochastic Chain Rule. Expectations.

Stochastic Calculus Made Easy

Moment Generating Functions

Weak solutions of mean-field stochastic differential equations

A Concise Course on Stochastic Partial Differential Equations

Introduction to multiscale modeling and simulation. Explicit methods for ODEs : forward Euler. y n+1 = y n + tf(y n ) dy dt = f(y), y(0) = y 0

B8.3 Mathematical Models for Financial Derivatives. Hilary Term Solution Sheet 2

Stochastic Differential Equations.

Lecture 4: Numerical Solution of SDEs, Itô Taylor Series, Gaussian Approximations

Populations Models: Part I

On the martingales obtained by an extension due to Saisho, Tanemura and Yor of Pitman s theorem

Exact Simulation of Multivariate Itô Diffusions

IEOR 4701: Stochastic Models in Financial Engineering. Summer 2007, Professor Whitt. SOLUTIONS to Homework Assignment 9: Brownian motion

The multidimensional Ito Integral and the multidimensional Ito Formula. Eric Mu ller June 1, 2015 Seminar on Stochastic Geometry and its applications

Lecture on Parameter Estimation for Stochastic Differential Equations. Erik Lindström

HOMEWORK 4 1. P45. # 1.

Lecture 4: Numerical Solution of SDEs, Itô Taylor Series, Gaussian Process Approximations

A numerical method for solving uncertain differential equations

MATH4210 Financial Mathematics ( ) Tutorial 7

A MODEL FOR THE LONG-TERM OPTIMAL CAPACITY LEVEL OF AN INVESTMENT PROJECT

University Of Calgary Department of Mathematics and Statistics

Some Terminology and Concepts that We will Use, But Not Emphasize (Section 6.2)

Introduction to Diffusion Processes.

Moment Properties of Distributions Used in Stochastic Financial Models

1. Stochastic Process

Bernardo D Auria Stochastic Processes /10. Notes. Abril 13 th, 2010

Bridging the Gap between Center and Tail for Multiscale Processes

TMS165/MSA350 Stochastic Calculus, Lecture on Applications

The Multivariate Normal Distribution 1

Lecture 21: Stochastic Differential Equations

HJB equations. Seminar in Stochastic Modelling in Economics and Finance January 10, 2011

Poisson random measure: motivation

Multilevel Monte Carlo for Lévy Driven SDEs

Exact and high order discretization schemes. Wishart processes and their affine extensions

Stochastic Numerical Analysis

Uses of Asymptotic Distributions: In order to get distribution theory, we need to norm the random variable; we usually look at n 1=2 ( X n ).

Mean-square Stability Analysis of an Extended Euler-Maruyama Method for a System of Stochastic Differential Equations

Stochastic Models (Lecture #4)

STAT/MATH 395 A - PROBABILITY II UW Winter Quarter Moment functions. x r p X (x) (1) E[X r ] = x r f X (x) dx (2) (x E[X]) r p X (x) (3)

Derivation of SPDEs for Correlated Random Walk Transport Models in One and Two Dimensions

Stochastic Processes and Advanced Mathematical Finance

Discretization of SDEs: Euler Methods and Beyond

1 Solution to Problem 2.1

Stochastic Computation

Generalised Fractional-Black-Scholes Equation: pricing and hedging

Variance Reduction Techniques for Monte Carlo Simulations with Stochastic Volatility Models

Stochastic Calculus for Finance II - some Solutions to Chapter VII

Monte-Carlo MMD-MA, Université Paris-Dauphine. Xiaolu Tan

ON THE FIRST TIME THAT AN ITO PROCESS HITS A BARRIER

JUST THE MATHS UNIT NUMBER LAPLACE TRANSFORMS 3 (Differential equations) A.J.Hobson

Linear Filtering of general Gaussian processes

GARCH processes continuous counterparts (Part 2)

Least Squares Estimators for Stochastic Differential Equations Driven by Small Lévy Noises

Data Analysis and Machine Learning Lecture 10: Applications of Kalman Filtering

Lecture 4: Introduction to stochastic processes and stochastic calculus

Multilevel Monte Carlo for Stochastic McKean-Vlasov Equations

Parameter Estimation for Random Differential Equation Models

Transcription:

Exercise Sheet 8 - Solutions Alessandro Gnoatto June 16, 015 1 Exercise 1 Let X t = x + µ t + σ W t denote a scaled Brownian motion with constant diffusion coefficient σ and constant drift µ. 1. Prove that Y t = e Xt where Y (t = Y (0 + t 0 dy with Y (0 = ex and dy t = (µ + 1 σ Y t dt + σy t dw t. We shall assume that the SDE for dy has a unique 1 solution in [0, t]. Since the solution to the SDE for dy is unique, we will prove the claim by obtaining d(e Xt and verifying that it is the same SDE as dy. Let us then start with dx t. By definition of Ito processes, dx t = µdt + σdw t and therefore, using Ito s lemma to obtain df(x t with f(z = e z. We have f (z = f (z = e z and d(e Xt =e Xt dx t + 1 σ e Xt dt d(e Xt =(µ + σ ext dt + σe Xt dw t. Note that f(x 0 = e X0 = e x = Y (0. Hence f(x t = e Xt and Y t are both solutions to the same SDE, i.e., Y t = e Xt. Another way is to take d(log Y t and show that its solution equals X t. We have g(y = log y, g (y = 1 y, and g (y = 1 y. Thus, hence also i.e. d(log Y t =(µ + σ Y t dt Y t Y t Y =µdt + σdw t, log Y t = log Y (0 + t σ dt + σ Y t Y t dw t t 0 µds + t log Y t = x + µt + σw t = X t. 0 σdw s 1 For more details about the necessary conditions for uniqueness of SDE, see Section 3, Chapter 5 of the lecture notes Lawrence Evans, An Introduction to Stochastic Differential Equations, ver 1., UC Berkeley. 1

. An example Java program of the solution can be found in 4 package de. math. lmu. exercise08 ; import java. text. DecimalFormat ; import net. finmath. montecarlo. BrownianMotion ; 6 import net. finmath. montecarlo. RandomVariable ; import net. finmath. stochastic. RandomVariableInterface ; 8 import net. finmath. time. TimeDiscretization ; 10 public class LogNormalTest { 1 s t a t i c f i n a l DecimalFormat formattersci6 = new DecimalFormat (" 0.000000 E00 ; -0.000000 E00 "; 14 public s t a t i c void main ( String [] args { int seed = 134; 16 int numberofpaths = 1000; //double dt = 0.01; 18 double sigma = 0.1; double mu = 0.1; 0 double initialvalueybar = Math. exp (1.0 ; double initialvaluex = 1.0; //define time grid 4 int numberoftimes = 00; double t0 =0.0; 6 double T =.0; double[] times = new double [00]; 8 for ( int countertime =0; countertime < numberoftimes ; countertime ++ { times [ countertime ] = t0 + countertime *( T- t0/(( double numberoftimes ; 30 3 //brownian motion TimeDiscretization mytimes = new TimeDiscretization ( times ; 34 36 BrownianMotion W = new BrownianMotion ( mytimes,1, numberofpaths, seed ; RandomVariableInterface previousvalueybar = new RandomVariable ( t0, initialvalueybar ; 38 RandomVariableInterface initialx = new RandomVariable ( t0, initialvaluex ; System. out. println (" time "+ " "+" mean value Y"+ " "+ " mean value Ybar " +" "+ " theor. mean "+ " "+ " error Y"+ " "+" error Ybar " + " "+ " Y - Ybar " ; 40 for ( int countertime =0; countertime < numberoftimes -1; countertime ++ { 4 double dt = times [ countertime +1] - times [ countertime ]; RandomVariableInterface dw = W. getbrownianincrement ( countertime, 0;//.getIncrementAtIndex( countertime; 44 RandomVariableInterface nextvalueybar = previousvalueybar. mult (1+( mu +0.5* sigma * sigma *dt. add (dw. mult ( previousvalueybar. mult ( sigma ; double empiricalmeanybar = nextvalueybar. getaverage

46 (; RandomVariableInterface nextvaluex = initialx. add (( mu* times [ countertime ]. add (W. getbrownianincrement ( countertime, 0. mult ( sigma ; 48 RandomVariableInterface nextvaluey = nextvaluex. exp (; double empiricalmeany = nextvaluey. getaverage (; 50 double theoreticalmean = initialvalueybar * Math. exp (( mu +0.5* sigma * sigma * times [ countertime ]; //continuous model 5 double absdifference = Math. abs ( empiricalmeanybar - empiricalmeany ; 54 double errory = Math. abs ( empiricalmeanybar - theoreticalmean ; double errorybar = Math. abs ( empiricalmeany - theoreticalmean ; 56 System. out. println ( formattersci6. format ( times [ countertime ] + " " + formattersci6. format ( empiricalmeany + " " + formattersci6. format ( empiricalmeanybar 58 + " " + formattersci6. format ( theoreticalmean + " "+ formattersci6. format ( errory + " "+ formattersci6. format ( errorybar +" " + formattersci6. format ( absdifference ; previousvalueybar = new RandomVariable ( nextvalueybar ; 60 6 64 3. Partial solution: We can express the approximations Ȳ in the following Euler-Maruyama recursion Ȳ n = t Ȳ +σȳ W for n =, 3,... with Ȳ0 = e x. From the solution to the previous exercise sheet we have that ( V ar[ȳn] = e x ( t l + σ t l 3 t l

and if we take t l, l, ( V ar[ȳn] =e x ( + σ ( ( n =e x + σ ( ( n n =e x (1 + (µ + σ σ + (µ + + σ ( ( n n =e x 1 + µ + σ + (µ + σ + σ ( ( n n =e x 1 + (µ + σ + (µ + σ n In order to compute V ar[y n ] = V ar[e Xn ], with X n = X + µ t + σ W we need to know the first and second moments of e Xn. Note that X n = x + µt n + σ W l therefore E [ e Xn] = e x+µtn E [e σ ] W l = e x+µtn E [ e Z] where Z := σ W l is just an N (0, σ n = N (0, σ t n distributed r.v. hence E [ e Z] = e σ tn and E [ e Xn] σ x+(µ+ = e tn. Now, computing E[(e Xn ] = E[e Xn ], we have Note that hence and finally E [ e Xn] = e x+µtn E [e σ ] W l = e x+µtn E [ e Z]. V ar[y n ] =V ar[e Xn ] E [ e Z] = e σ t n, E [ e Xn] = e x+(µ+σ t n =E[e Xn ] (E[e Xn ] =e x+(µ+σ σ t n x+(µ+ (e tn =e x+(µ+σ σ t n x+(µ+ e tn σ x+(µ+ =e tn (e σ t n 1 4

Now, we can compare V ar[ȳn] and V ar[y n ]. We note that, since e x is a common factor of both, it is enough to compare V ar[yn] e V ar[ȳn] x e with 0. We have that x n e (µ+σ t n (1 + (µ + σ + (µ + σ > e (µ+σ t n ( 1 + (µ + σ + (µ + σ n = e (µ+σ t n (1 + (µ + σ n n n ( = e (µ+σ t n 1 + (µ + σ t n n n > 0. Note that the right hand term is a lower bound for the left hand term (and its limit as n is the left hand term. Similarly n σ (µ+ e tn < 0. It remains to show whether n t n (1 + (µ + σ + (µ + σ n e(µ+σ < σ (µ+ e tn or not. If it is true, we conclude that V ar[y n ] e x V ar[ȳn] e x < 0, i.e. V ar[y n ] < V ar[ȳn], otherwise V ar[y n ] > V ar[ȳn]. Exercise The example Java program containing the solution is in provided in the following files package de. math. lmu. exercise08 ; 4 import java. text. DecimalFormat ; import net. finmath. montecarlo. BrownianMotion ; 6 import net. finmath. montecarlo. RandomVariable ; import net. finmath. stochastic. RandomVariableInterface ; 8 import net. finmath. time. TimeDiscretization ; 10 public class OptionsTest { 1 14 s t a t i c f i n a l DecimalFormat formattersci6 = new DecimalFormat (" 0.000000 E00 ; -0.000000 E00 "; public s t a t i c void main ( String [] args { 16 int numberoftimes = 800; 5

double t0 =0.0; 18 double T = 1.0; double initialvalue = 1.0; 0 double mu = 0.1; double r = 0.0; double sigma = 1.0; double strikes [] = {0.8,0.9,1.0,1.1,1.; 4 double price [] = new double[ strikes. length ]; double riskyvalue [] = new double[ strikes. length ]; 6 double pricebs [] = new double[ strikes. length ]; 8 double[] times = new double[ numberoftimes ]; for ( int countertime =0; countertime < numberoftimes ; countertime ++ { 30 times [ countertime ] = t0 + countertime *( T- t0/(( double numberoftimes ; 3 int seed = 34; 34 int numberofpaths = 10000; 36 TimeDiscretization mytimes = new TimeDiscretization ( times ; 38 BrownianMotion brownianw = new BrownianMotion ( mytimes,1, numberofpaths, seed ; //RandomVariableInterface initialxbar = new RandomVariable (t0,0.0; 40 RandomVariableInterface previousvaluep = new RandomVariable ( t0, initialvalue ; 4 RandomVariableInterface previousvalueq = new RandomVariable ( t0, initialvalue ; 44 46 System. out. println (" strike "+ " "+" risky value "+ " "+"MC price " + " "+ "BS price "; for ( int countertime =0; countertime < numberoftimes -1; countertime ++ { 48 double dt = times [ countertime +1] - times [ countertime ]; RandomVariableInterface dw = brownianw. getbrownianincrement ( countertime, 0; 50 RandomVariableInterface nextvaluep = previousvaluep. mult (1+ mu*dt. add (dw. mult ( previousvaluep. mult ( sigma ; 5 RandomVariableInterface nextvalueq = previousvalueq. mult (1+ r*dt. add (dw. mult ( previousvalueq. mult ( sigma ; 54 56 //continuous model // double MCerror = Math.abs(empiricalMean theoreticalmean; 58 previousvaluep = new RandomVariable ( nextvaluep ; previousvalueq = new RandomVariable ( nextvalueq ; 60 //System.out.println(formatterSci6.format(times[ countertime]+ " "+formattersci6.format( empiricalmean+ " "+formattersci6.format( 6

6 theoreticalmean+ " ; "+formattersci6.format(mcerror 64 66 68 for ( int counterstrike = 0; counterstrike < strikes. length ; counterstrike ++ { 70 price [ counterstrike ] = Math. exp (-r*(t-t0* previousvalueq. sub ( strikes [ counterstrike ]. floor (0. getaverage (; riskyvalue [ counterstrike ] = Math. exp (-r*(t-t0* previousvaluep. sub ( strikes [ counterstrike ]. floor (0. getaverage (; 7 74 pricebs [ counterstrike ] = net. finmath. functions. AnalyticFormulas. blackscholesoptionvalue ( initialvalue, 76 r, sigma, 78 T, strikes [ counterstrike ]; 80 8 84 System. out. println ( formattersci6. format ( strikes [ counterstrike ] +" " + formattersci6. format ( riskyvalue [ counterstrike ] + " " + formattersci6. format ( price [ counterstrike ] + " " + formattersci6. format ( pricebs [ counterstrike ]; 86 package de. math. lmu. exercise08 ; 4 import java. text. DecimalFormat ; import net. finmath. montecarlo. BrownianMotion ; 6 import net. finmath. montecarlo. RandomVariable ; import net. finmath. stochastic. RandomVariableInterface ; 8 import net. finmath. time. TimeDiscretization ; 10 public class OptionsTest { 1 14 s t a t i c f i n a l DecimalFormat formattersci6 = new DecimalFormat (" 0.000000 E00 ; -0.000000 E00 "; public s t a t i c void main ( String [] args { 16 int numberoftimes = 800; 18 double t0 =0.0; double T = 1.0; 0 double initialvalue = 1.0; double mu = 0.1; double r = 0.01; double sigma = 1.0; 7

4 double strikes [] = {0.8,0.9,1.0,1.1,1.; double price [] = new double[ strikes. length ]; 6 double riskyvalue [] = new double[ strikes. length ]; double pricebs [] = new double[ strikes. length ]; 8 double[] times = new double[ numberoftimes ]; for ( int countertime = 0; countertime < numberoftimes ; countertime ++ { 30 times [ countertime ] = t0 + countertime *( T- t0/(( double numberoftimes ; 3 int seed = 34; 34 int numberofpaths = 10000; 36 TimeDiscretization mytimes = new TimeDiscretization ( times ; 38 System. out. println ( mytimes. getnumberoftimes (; 40 BrownianMotion brownianw = new BrownianMotion ( mytimes,1, numberofpaths, seed ; RandomVariableInterface initialxbar = new RandomVariable ( t0,0.0 ; 4 44 RandomVariableInterface myw = new RandomVariable (0.0 ; for ( int i = 0; i < mytimes. getnumberoftimesteps (; i ++ { 46 myw = myw. add ( brownianw. getbrownianincrement (i, 0; 48 50 System. out. println (" strike "+ " "+" risky value "+ " "+"MC price " + " "+ "BS price "; 5 RandomVariableInterface valuelogxbarp = initialxbar. add ((( mu -0.5* sigma * sigma * times [ numberoftimes -1]. add ( myw. mult ( sigma ; 54 RandomVariableInterface valuexbarp = valuelogxbarp. exp (; 56 RandomVariableInterface valuelogxbarq = initialxbar. add ((( r -0.5* sigma * sigma * times [ numberoftimes -1]. add ( myw. mult ( sigma ; RandomVariableInterface valuexbarq = valuelogxbarq. exp (; 58 60 for ( int counterstrike = 0; counterstrike < strikes. length ; counterstrike ++ { 6 price [ counterstrike ] = Math. exp (-r*(t-t0* valuexbarq. sub ( strikes [ counterstrike ]. floor (0. getaverage (; riskyvalue [ counterstrike ] = Math. exp (-r*(t-t0* valuexbarp. sub ( strikes [ counterstrike ]. floor (0. getaverage (; 64 pricebs [ counterstrike ] = net. finmath. functions. AnalyticFormulas. blackscholesoptionvalue ( 66 initialvalue, r, 68 sigma, T, 70 strikes [ counterstrike ]; 8

7 System. out. println ( formattersci6. format ( strikes [ counterstrike ] +" " + formattersci6. format ( riskyvalue [ counterstrike ] + " " + formattersci6. format ( price [ counterstrike ] + " " + formattersci6. format ( pricebs [ counterstrike ]; 74 76 78 Each uses a different approach to approximate S, the first uses the Euler- Maruyama scheme on ds and the second computes the exact value of S using the Euler-Maruyama scheme on logs. (The second approach is faster. The correct measure to compute is the pricing measure Q. In order to implement this measure by Monte-Carlo, the empirical mean must be computed on the MC paths simulated under the Q-model. The Q-model for S is ds t = r t S t dt + σs t dw Q t and since r t 0, we have the following Q-model for S ds t = σs t dw Q t. 9