410 likes | 636 Views
Workshop on Stochastic Differential Equations and Statistical Inference for Markov Processes Day 3: Numerical Methods for Stochastic Differential Equations. Day 1: January 19 th , Day 2: January 28 th Day 3: February 9 th Lahore University of Management Sciences. Schedule.
E N D
Workshop on Stochastic Differential Equations and Statistical Inference for Markov ProcessesDay 3: Numerical Methods for Stochastic Differential Equations Day 1: January 19th , Day 2: January 28th Day 3: February 9th Lahore University of Management Sciences
Schedule • Day 1 (Saturday 21st Jan): Review of Probability and Markov Chains • Day 2 (Saturday 28th Jan): Theory of Stochastic Differential Equations • Day 3 (Saturday 4th Feb): Numerical Methods for Stochastic Differential Equations • Day 4 (Saturday 11th Feb): Statistical Inference for Markovian Processes
Today • Numerical Schemes for ODE • Numerical Evaluation of Stochastic Integrals • Euler Maruyama Method for SDE • Milstein and Higher Order Methods for SDE
Euler’s Scheme • Consider the following IVP • Using a forward difference approximation we get • This is called the Forward Euler Scheme
A Simple Example • Consider the IVP • The solution to the IVP is
Solving the IVP by Euler’s Method • For the IVP • The Euler Scheme is
Error • How to characterize the error ? • Factors which introduce an error • Discretization • Round off • Maximum of error over the interval • How does the error depend on
Discretization Error in Forward Euler • Consider the IVP • Satisfying the conditions • Also consider the Euler Scheme • Then the error satisfies
How Error Varies with ∆t • Claim : We saw theoretically Euler’s Method is O(∆t) accurate
Stability • Consider • The Euler Scheme is • For the solution to die out need • For
Stability of Euler Scheme • For • Discretize using Euler’s Scheme • At some stage of the solution assume a small error is introduced • The error evolves according to • Thus need for stability
Challenge • Write a code to verify the order of accuracy of the Euler Scheme • Experiment with different values of to explore the stability of the Euler Scheme • Note: You may use the IVP discussed here
Weiner Process • Recall a random variable is a Weiner Process if • For the increment • For the increments are independent
Simulating Weiner Processes • Consider the discretization • where and • Also each increment is given by
Numerical Expectation and Variance • Theoretically on the interval [0,t]
Stochastic Exponential Growth • The Exponential Growth Model is • Let • Then the solution is • Note that
Sources of Error in Numerical Schemes • Errors in Numerical Schemes for SDE • Discretization • Monte Carlo • Round off • Discretization determines the order of the scheme as in the ODE case • Also want a handle on the Monte Carlo errors
Some Numerical Schemes for SDE • Euler Maruyama • Half order accurate • Milstein • Order one accurate • Reference: “Numerical Solution of Stochastic Differential Equations by Kloeden and Platen (Springer)”
Euler Maruyama Scheme • Consider an autonomous SDE • A Simple (Euler-Maruyama) discretization is
E-M Applied of Exponential Growth • Consider • This has the solution • The Euler Murayama Scheme takes the form
Strong Accuracy of E-M • A method converges with strong order if there exists C such that • For the Euler Maruyama Scheme the following holds • i.e. E-M is order accurate
Weak Accuracy of E-M • A method converges with weak order if there exits C such that • For the Euler Maruyama Scheme the following holds true
Stochastic Oscillator • Consider the stochastically forced oscillator • The mean and variance are given by
Numerical Scheme • We simulate the oscillator using the following scheme (Higham & Melbo) • Note the semi implicit nature of the method
Challenge I • Derive the exact mean and variance for the stochastic oscillator • Use Euler Maruyama to simulate trajectories and calculate the mean and variance • Show numerically that the variance blow up with decreasing for the E-M method
Challenge II • Exploring the Stochastic SIR Model • Use the references provided on the webpage to simulate sample paths for the infected class for different parameters • Calculate the numeric mean and variance
References and Credits • Kloeden. P.E & Platen.E, Numerical Solution of Stochastic Differential Equations, Springer (1992) • Desmond J. Higham. An Algorithmic Introduction to Numerical Simulation of Stochastic Differential Equations , SIAM Rev. 43, pp. 525-546 • Atkinson. K, Han W. & Stewart D.E, Numerical Solution of Ordinary Differential Equations, Wiley • Many of the codes are available at Desmond Higham's webpage www.mathstat.strath.ac.uk/d.j.higham