Methods of Monte Carlo Simulation II

Methods of Monte Carlo Simulation II

Methods of Monte Carlo Simulation II Ulm University Institute of Stochastics Lecture Notes Dr. Tim Brereton Summer Term 2014 Ulm, 2014 2 Contents 1 SomeSimpleStochasticProcesses 7 1.1 StochasticProcesses . 7 1.2 RandomWalks .......................... 7 1.2.1 BernoulliProcesses . 7 1.2.2 RandomWalks ...................... 10 1.2.3 ProbabilitiesofRandomWalks . 13 1.2.4 Distribution of Xn .................... 13 1.2.5 FirstPassageTime . 14 2 Estimators 17 2.1 Bias, Variance, the Central Limit Theorem and Mean Square Error................................ 19 2.2 Non-AsymptoticErrorBounds. 22 2.3 Big O and Little o Notation ................... 23 3 Markov Chains 25 3.1 SimulatingMarkovChains . 28 3.1.1 Drawing from a Discrete Uniform Distribution . 28 3.1.2 Drawing From A Discrete Distribution on a Small State Space ........................... 28 3.1.3 SimulatingaMarkovChain . 28 3.2 Communication .......................... 29 3.3 TheStrongMarkovProperty . 30 3.4 RecurrenceandTransience . 31 3.4.1 RecurrenceofRandomWalks . 33 3.5 InvariantDistributions . 34 3.6 LimitingDistribution. 36 3.7 Reversibility............................ 37 4 The Poisson Process 39 4.1 Point Processes on [0, )..................... 39 ∞ 3 4 CONTENTS 4.2 PoissonProcess .......................... 41 4.2.1 Order Statistics and the Distribution of Arrival Times 44 4.2.2 DistributionofArrivalTimes . 45 4.3 SimulatingPoissonProcesses. 46 4.3.1 Using the Infinitesimal Definition to Simulate Approx- imately .......................... 46 4.3.2 SimulatingtheArrivalTimes . 47 4.3.3 SimulatingtheInter-ArrivalTimes . 48 4.4 InhomogenousPoissonProcesses. 48 4.5 Simulating an Inhomogenous Poisson Process . 49 4.5.1 Acceptance-Rejection. 49 4.5.2 Infinitesimal Approach (Approximate) . 50 4.6 CompoundPoissonProcesses . 51 5 ContinuousTimeMarkovChains 53 5.1 TransitionFunction. 53 5.2 InfinitesimalGenerator . 54 5.3 ContinuousTimeMarkovChains . 54 5.4 TheJumpChainandHoldingTimes . 55 5.5 Examples of Continuous Time Markov Chains . 56 5.5.1 PoissonProcess . 56 5.5.2 Birth-DeathProcess . 56 5.6 Simulating Continuous Time Markov Chains . 56 5.7 The Relationship Between P and Q intheFiniteCase . 58 5.8 Irreducibility, Recurrence and Positive Recurrence . ..... 59 5.9 Invariant Measures and Stationary Distribution . .. 61 5.9.1 ReversibilityandDetailedBalance . 62 6 Gaussian Processes 63 6.1 TheMultivariateNormalDistribution. 63 6.1.1 Symmetric Positive Definite and Semi-Positive Definite Matrices.......................... 65 6.1.2 DensitiesofMultivariateNormals . 66 6.1.3 SimulatingMultivariateNormals . 67 6.2 SimulatingaGaussianProcessesVersion1 . 68 6.3 Stationary and Weak Stationary Gaussian Processes . .. 71 6.4 FiniteDimensionalDistributions . 71 6.5 Marginal and Conditional Multivariate Normal Distributions . 72 6.6 InterpolatingGaussianProcesses . 73 6.7 MarkovianGaussianProcesses . 75 6.8 BrownianMotion ......................... 77 CONTENTS 5 7 Random Fields 81 7.1 GaussianRandomFields . 81 7.2 MarkovRandomFields. 85 7.3 GaussianRandomMarkovFields . 86 6 CONTENTS Chapter 1 Some Simple Stochastic Processes 1.1 Stochastic Processes To begin, we need to define the basic objects we will be learning about. Definition 1.1.1 (Stochastic Process). A stochastic process is a set of ran- dom variables X , taking values in a state space , with index sex I R. { i}i∈I X ⊂ In general, i represents a point in time. However, it could represent a point in 1D space as well. We will say a process is discrete time if I is discrete. For example, I could be N or 1, 2, 3, 10, 20 . Normally, when we talk about discrete time { } stochastic processes, we will use the index n (e.g., X N). { n}n∈ We will say a process is continuous time if I is an interval. For example [0, ) or [1, 2]. Normally, when we talk about continuous time stochastic processes,∞ we will use the index t (e.g. X ). { t}t∈[0,T ] 1.2 Random Walks 1.2.1 Bernoulli Processes One of the simplest stochastic processes is a random walk. However, even though the random walk is very simple, it has a number of properties that will be important when we think about more complicated processes. To define a random walk, we begin with an even simpler process called a Bernoulli process. A Bernoulli process is a discrete time process taking values in the state space 0, 1 . { } 7 8 CHAPTER 1. SIMPLE STOCHASTIC PROCESSES ETC. Definition 1.2.1 (Bernoulli Process). A Bernoulli process with parameter p [0, 1] is a sequence of independent and identically distributed (i.i.d.) ran- dom∈ variables, Y , such that { n}n≥1 P(Y =1)=1 P(Y =0)= p. (1.1) 1 − 1 A variable with the probability mass function (pmf) described by (1.1) is called a Bernoulli random variable with distribution Ber(p). In the case where p = 1/2, you can think of a Bernoulli process as a sequence of fair coin tosses. In the case where p = 1/2, you can think of a Bernoulli process as a sequence of tosses of an unfair6 coin. Note that if U U(0, 1), then P(U p) = p for p [0, 1]. This means if we define the random∼ variable Y = I(≤U p), where∈I( ) is the indicator function and U U(0, 1), we have ≤ · ∼ P(Y =1)=1 P(Y =0)= p. − In Matlab, we can make these variables as follows. Listing 1.1: Generating a Bernoulli Random Variable 1 Y = (rand <= p) If we want to make a realization of the first n steps of a Bernoulli process, we simply make n such variables. One way to do this is the following. Listing 1.2: Generating a Bernoulli Process 1 1 n = 20; p = 0.6; Y = zeros(N,1); 2 3 for i = 1:n 4 Y(i) = (rand <= p); 5 end We can do this more quickly in Matlab though. Listing 1.3: Generating a Bernoulli Process 2 1 n = 20; p = 0.6; 2 3 Y = (rand(n,1) <= p); It is important to be able to visualize stochastic objects. One way to represent / visualize a Bernoulli process is to put n =1, 2,... on the x-axis and the values of Yn on the y-axis. I draw a line (almost of length 1) at each value of Yn, as this is easier to see than dots. Figure 1.2.1 shows a realization of the first 20 steps of a Bernoulli process. 1.2. RANDOM WALKS 9 Listing 1.4: Generating and Visualizing a Bernoulli Process 1 n = 20; p = 0.6; 2 3 Y = (rand(n,1) <= p); 4 5 clf; 6 axis([1 n+1 -0.5 1.5]); 7 for i = 1:n 8 line([i, i+.9],[Y(i) Y(i)]); 9 end 1 n Y 0 2 4 6 8 10 n 12 14 16 18 20 Figure 1.2.1: A realization of the first 20 steps of a Bernoulli process. Now, it is easy to write out the probability of seeing a particular realiza- tion of n steps of a Bernoulli process. This is given by P(Y = y ,Y = y ,...,Y = y )= pNU (1 p)n−NU . n n n−1 n−1 1 1 − where NU is the number of times the Bernoulli process takes the value 1. More technically, we define NU as N =# 0 i n : y =1 , U { ≤ ≤ i } where # denotes the cardinality of the set. 10 CHAPTER 1. SIMPLE STOCHASTIC PROCESSES ETC. 1.2.2 Random Walks Now that we can generate Bernoulli processes, we are ready to consider our main object of interest in this chapter: the random walk. The random walk is a discrete time random process taking values in the state space Z. Definition 1.2.2 (Random Walk). Given a Bernoulli process Yn n≥1 with parameter p, we define a random walk X with parameter{p and} initial { n}n≥0 condition X0 = x0 by X = X + (2Y 1). n+1 n n+1 − Note that (2Yn 1) is 1 if Yn = 1 and 1 if Yn = 0. So, essentially, at each step of the process,− it goes up or down− by 1. There are lots of ways to think about random walks. One way is in terms of gambling (which is a classical setting for probability). Think of a game which is free to enter. The person running the game flips a coin. With probability p, the coin shows heads and you win AC1. With probability 1 p, − you lose AC1. If you start with ACx0, and assuming you can go into debt, Xn is the random variable describing how much money you have after n games. Given that we know how to generate a Bernoulli process, it is straight- forward to generate a random walk. Listing 1.5: Generating a Random Walk 1 1 n = 100; X = zeros(n,1); 2 p = 0.5; X_0 = 0; 3 4 Y = (rand(n,1) <= p); 5 X(1) = X_0 + 2*Y(1) - 1; 6 for i = 2:n 7 X(i) = X(i-1) + 2*Y(i) - 1; 8 end A more compact way is as follows. Listing 1.6: Generating a Random Walk 2 1 n = 100; X = zeros(n,1); 2 p = 0.5; X_0 = 0; 3 4 Y = (rand(n,1) <= p); 5 X = X_0 + cumsum((2*Y - 1)); It is good to be able to plot these. Here, we have at least two options. One is to draw a line for each value of Xn, as we did for the Bernoulli process. 1.2. RANDOM WALKS 11 Because the value of Xn n≥0 changes at every value of n, we can draw the lines to be length 1. This{ approach} is nice, because it reinforces the idea that Xn n≥0 jumps at each value of n (this is made obvious by the gaps between the{ lines).} Listing 1.7: Plotting a Random Walk 1 1 clf 2 axis([1 n+1 min(X)-1 max(X)+1]); 3 for i = 1:n 4 line([i,i+1],[X(i) X(i)],’LineWidth’,3); 5 end For larger values of n, it is help to draw vertical lines as well as horizontal lines (otherwise, things get a bit hard to see).

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    93 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us