Euler-Approximation Leonie van de Sandt TU Dortmund Prof. Dr. Christine Müller 5. Juni 2012 Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 1 / 26
Inhaltsverzeichnis 1 Einleitung Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Inhaltsverzeichnis 1 Einleitung 2 Definition der Euler-Approximation Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Inhaltsverzeichnis 1 Einleitung 2 Definition der Euler-Approximation 3 Simulation der Euler-Approximation Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Inhaltsverzeichnis 1 Einleitung 2 Definition der Euler-Approximation 3 Simulation der Euler-Approximation 4 Vorstellung des Milstein-Schemas Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Inhaltsverzeichnis 1 Einleitung 2 Definition der Euler-Approximation 3 Simulation der Euler-Approximation 4 Vorstellung des Milstein-Schemas 5 Zusammenfassung Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Inhaltsverzeichnis 1 Einleitung 2 Definition der Euler-Approximation 3 Simulation der Euler-Approximation 4 Vorstellung des Milstein-Schemas 5 Zusammenfassung 6 Literatur Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 2 / 26
Einleitung Einleitung Gegeben: stochastische Differentialgleichung dx t = b(t, X t )dt + σ(t, X t )dw t Gesucht ist stetige Lösung X t, 0 t T Es kann eine diskrete Approximation für Lösung gefunden werden Euler-Approximation bietet häufig verwendetes numerisches Simulationsverfahren Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 3 / 26
Einleitung Zunächst formale Definition der Euler-Approximation Anschließend Simulationen anhand von zwei Beispielen: Ornstein-Uhlenbeck-Prozess Cox-Ingersoll-Ross-Prozess Vorstellung des Milstein-Schemas als Alternative zur Euler-Approximation mit Simulation Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 4 / 26
Definition der Euler-Approximation Definition der Euler-Approximation Gegeben sei stochastische Differentialgleichung dx t = b(t, X t )dt + σ(t, X t )dw t mit determinischtem Anfangswert X t0 = X 0 und Diskretisierung Π N ([0, T ]) Die Lösung dieser Gleichung sei der Prozess X t, 0 t T mit T > 0 Euler-Approximation von X ist stetiger stochastischer Prozess Y genügt iterativem Schema Y i+1 = Y i + b(t i, Y i )(t i+1 t i ) + σ(t i, Y i )(W i+1 W i ) i = 0, 1,..., N 1 und Y 0 = X 0 Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 5 / 26
Definition der Euler-Approximation konstante Schrittweite t = t i+1 t i = 1 N zwischen den Zeitpunkten t i und t i+1 kann man linear interpolieren: Y (t) = Y i + t t i t i+1 t i Y i+1 Y i für t [t i, t i+1 ) Euler-Approximation konvergiert gegen die Lösung der stochastischen Differentialgleichung schwach mit Ordnung β = 1 stark mit Ordnung γ = 1 2 Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 6 / 26
Simulation der Euler-Approximation Simulation der Euler-Approximation Zur Simulation nur der Wiener Prozess zu simulieren: Y i+1 = Y i + b(t i, Y i )(t i+1 t i ) + σ(t i, Y i )(W i+1 W i ) Als Lösung der stochastischen Differentialgleichung zwei Beispiele, welche zu simulieren sind: Ornstein-Uhlenbeck-Prozess Cox-Ingersoll-Ross-Prozess Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 7 / 26
Simulation der Euler-Approximation Der Ornstein-Uhlenbeck-Prozess Eindeutige Lösung der stochastischen Differentialgleichung dx t = (θ 1 θ 2 X t )dt + θ 3 dw t Explizite Lösung ist dann gegeben durch: X t = θ ( 1 + θ 2 x 0 θ 1 θ 2 ) t e θ2t + θ 3 e θ 2t hier: b(t, x) = (θ 1 θ 2 x) und σ(t, x) = θ 3 0 e θ 2(u) dw u Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 8 / 26
Simulation der Euler-Approximation Simulation des OU-Prozesses mit Euler >set.seed(123) >T <- 1 >x <- 10 >theta <- c(0, 5, 3.5) >Z <- BM(x=x,T=T,N=100) >N <- 100 >Dt <- T/N >t <- seq(0,t,by=dt) >Y <- numeric(n+1) >Y[1] <- x >for(i in 1:N){ + Y[i+1] <- Y[i] + (theta[1] - theta[2]*y[i])*dt + + theta[3]*(z[i+1]-z[i])} >Y <- ts(y,start=0, deltat=t/n) >plot(y) Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 9 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 N=10 N=100 N=1000 0.0 0.2 0.4 0.6 0.8 1.0 Time Abbildung: Simulation des Ornstein-Uhlenbeck-Prozesses mithilfe der Euler-Approximation Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 10 / 26
Simulation der Euler-Approximation Ornstein-Uhlenbeck-Prozess auch mit der Integraldarstellung zu simulieren: X t = θ ( 1 + x 0 θ ) t 1 e θ2t + θ 3 e θ 2t e θ2(u) dw u θ 2 θ 2 0 Zur Veranschaulichung der Approximationsgüte der Euler-Approximation werden beide Simulationen mit verschiedenen Schrittweiten in je einer Grafik dargestellt Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 11 / 26
Simulation der Euler-Approximation Simulation des OU-Prozesses via Integral >T <- 1 >x <- 10 >theta <- c(0, 5, 3.5) >N <- 100 >Dt <- T/N >t <- seq(0,t,by=dt) >itosumou.n <- 0 >XOU.N <- rep(x,n+1) >for(i in 1:N){ + itosumou.n<-itosumou.n+exp(theta[2]*t[i])*(z[i+1]-z[i]) + XOU.N[i+1]<-theta[1]/theta[2]+(x-theta[1]/theta[2])* + exp(-theta[2]*t1[i])+theta[3]*exp(-theta[2]*t[i])* + itosumou.n} >XOU.N <- ts(xou.n,start=0, deltat=dt) Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 12 / 26
Simulation der Euler-Approximation Y 2 0 2 4 6 8 10 Euler Approximation via Integral 0.0 0.2 0.4 0.6 0.8 1.0 Time Abbildung: Simulation des Ornstein-Uhlenbeck-Prozesses mit Euler-Approximation und via Integral mit 10 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 13 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 Euler Approximation via Integral 0.0 0.2 0.4 0.6 0.8 1.0 Time Abbildung: Simulation des Ornstein-Uhlenbeck-Prozesses mit Euler-Approximation und via Integral mit 100 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 14 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 Euler Approximation via Integral 0.0 0.2 0.4 0.6 0.8 1.0 Time Abbildung: Simulation des Ornstein-Uhlenbeck-Prozesses mit Euler-Approximation und via Integral mit 1000 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 15 / 26
Simulation der Euler-Approximation Der Cox-Ingersoll-Ross-Prozess Lösung der stochastischen Differentialgleichung dx t = (θ 1 θ 2 X t )dt + θ 3 Xt dw t Explizite Lösung ist dann gegeben durch: X t = θ ( 1 + θ 2 x 0 θ 1 θ 2 ) t e θ2t + θ 3 e θ 2t hier: b(t, x) = (θ 1 θ 2 x) und σ(t, x) = θ 3 x 0 e θ 2u X u dw u Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 16 / 26
Simulation der Euler-Approximation Simulation des CIR-Prozesses mit Euler >T <- 10 >x <- 10 >theta <- c(1, 1, 1) >Z <- BM(x=x,T=T,N=100) >N <- 100 >Dt <- T/N >Y <- numeric(n1+1) >Y[1] <- x >for(i in 1:N){ + Y[i+1] <- Y1[i] + (theta[1] - theta[2]*y[i])*dt + + theta[3]*sqrt(y[i])*(z[i+1]-z[i])} >Y <- ts(y,start=0, deltat=t/n) >plot(y) Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 17 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 N=50 N=100 N=1000 0 2 4 6 8 10 Time Abbildung: Simulation des Cox-Ingersoll-Ross-Prozesses mithilfe der Euler-Approximation Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 18 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 Euler Approximation via Integral 0 2 4 6 8 10 Time Abbildung: Simulation des Cox-Ingersoll-Ross-Prozesses mit Euler-Approximation und via Integral mit 50 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 19 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 Euler Approximation via Integral 0 2 4 6 8 10 Time Abbildung: Simulation des Cox-Ingersoll-Ross-Prozesses mit Euler-Approximation und via Integral mit 100 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 20 / 26
Simulation der Euler-Approximation Y 0 2 4 6 8 10 Euler Approximation via Integral 0 2 4 6 8 10 Time Abbildung: Simulation des Cox-Ingersoll-Ross-Prozesses mit Euler-Approximation und via Integral mit 1000 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 21 / 26
Vorstellung des Milstein-Schemas Vorstellung des Milstein-Schemas Das Milstein-Schema ist ebenfalls eine Methode, um Lösungen stochastischer Differentialgleichungen zu approximieren Definition des Milstein-Schemas: Y i+1 = Y i + b(t i, Y i ) t + σ(t i, Y i )(W i+1 W i ) + 1 2 σ(t i, Y i )σ x (t i, Y i ){(W i+1 W i ) 2 t} Es wird Gebrauch vom Itô-Lemma gemacht, wodurch der Term σ x (t i, Y i ) als Ableitung nach x von σ(t i, Y i ) hinzukommt Für den Ornstein-Uhlenbeck-Prozess mit b(t, x) = θ 1 θ 2 x und σ(t, x) = θ 3 stimmen Euler-Approximation und Milstein-Schema überein Als Beispiel zum Vergleich der beiden Approximations-Schemen kann man den Cox-Ingersoll-Ross-Prozess verwenden Hierbei ist dann σ x = 1 x für θ 3 = 2 Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 22 / 26
Vorstellung des Milstein-Schemas R Code für die Simulation des CIR-Prozesses mit dem Milstein-Schema >N <- 100 >x <- 10 >T <- 10 >Dt <- T/N >theta <- c(1, 1, 1) >X <- numeric(n+1) >X[1] <- x >for(i in 1:N){ + X[i+1] <- X[i] + (theta[1] - theta[2]*x[i])*dt + + theta[3]*sqrt(x[i])* + (Z[i+1]-Z[i])+(1/2)*theta[3]* + sqrt(x[i])*(1/sqrt(x[i]))*((z[i+1]-z[i])^2-dt)} >X <- ts(x,start=0, deltat=t/n) Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 23 / 26
Vorstellung des Milstein-Schemas X1 1 2 3 4 5 Euler Milstein Integral 0 2 4 6 8 10 Time Abbildung: Simulation des Cox-Ingersoll-Ross-Prozesses mit Euler-Approximation, Milstein-Schema und via Integral mit 100 Schritten Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 24 / 26
Zusammenfassung Zusammenfassung Euler-Approximation häufig verwendetes numerisches Verfahren zur Simulation von Lösungen stochastischer Differentialgleichungen Iteratives Schema, welches Wiener Prozess beinhaltet Zu simulieren ist der Wiener Prozess Je kleiner die Schrittweite gewählt wird, desto besser die Approximation Milstein-Schema ebenfalls gut für Approximation und Simulation, enthält weiteren Term σ x (t, x) Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 25 / 26
Literatur Literatur Iacus, S. M. (2008): Simulation and Inference for Stochastic Differential Equations: With R Examples. 1. Auflage. New York: Springer. Iacus, S. M. (2009): sde: Simulation and Inference for Stochastic Differential Equations.R package version 2.0.10. url: http://cran.r-project.org/package=sde. R Development Core Team (2011):R 2.13.1: A Language and Environment for Statistical Computing.ISBN 3-900051-07-0. R Foundation for Statistical Computing. Vienna, Austria. url: http://www.r-project.org/. Leonie van de Sandt (TU Dortmund) Euler-Approximation 5. Juni 2012 26 / 26