Binomial Random Walk

Binomial Random Walk

INTRODUCTION TO STOCHASTIC CALCULUS Borun D Chowdhury Stochastic Processes What is a stochastic process? Series of events where a variable takes random values X0, X1….. Xt … Causality requires Xt depends only on Xt’ where t’<t A Markovian process is a memory less stochastic process so that Xt depends only on Xt’ Often it is useful to look at the difference process Yt = Xt - Xt-1 Binomial Random Walk The workhorse of stochastic processes is the Binomial Random walk To understand that we first look at a Bernoulli process B(p), a random variable that is 1 with probability p and 0 with probability q E[B(p)] = p, V ar[B(p)] = p(1 p) − We then define a variable that takes values 1 with probability p and -1 with probability q X =2B(p) 1 i − and we have E[X ]=2p 1,Var[B(p)] = 4p(1 p) i − − This is a model for a step taken by a drunk Binomial Random Walk If the drunk takes n steps then we have a new random variable n Yn = Xi i Its expectation value is X E[Y ]= E[X ]=n(2p 1) n i − Its variance is X Var(Yn)= Var(Xi)+ Cov(Xi,Xj) i i=j X X6 If the different steps are not correlated (or better yet independent) Var(Y )=4np(1 p) n − Note Yn is also a stochastic process StochasticProcesses/RandomWalkAndWeinerProcess.ipynb at master · borundev/StochasticProcesses 02/06/16 14:19 self.p=p self.dt=dt self.nsteps=int(self.T/self.dt) Paths.__setup__(self) self.randoms=2*(np.random.binomial(1,self.p,self.npaths*(self.nsteps-1))-.5) self.randoms.shape=[self.npaths,self.nsteps-1] for i in range(self.nsteps-1): self.paths[:,i+1]=self.paths[:,i]+self.randoms[:,i] b_paths=BinaryPaths(11,1,6).get_paths() number_columns=2 number_rows=3 figsize(12, 9) for i,j in enumerate([(i/number_columns,i%number_columns) for i in range(number_columns*number_row s)]): plt.subplot2grid((number_rows,number_columns),j) plt.plot(b_paths[i],"--o") plt.xlabel("time") Binomial pltRandom.ylabel("position") Walk plt.ylim(-7,7) From Binomial Walk to Weiner Process but not back! Note that after n steps the scale of fluctuations around the mean The process described above is a Binomial process and happens in discrete times. However for analytical reasons we would like to take a continuum limit of the same. Although having done that, for computational reasons the latter is approximated by a discrete process again. The reason for the analytical expression in continuous time is actually tied to the central limit theorem which for our purposes states that the sum of many independent incrememts by random variables with well defined meanp and variance tends to a Gaussian process (the Gaussian is stable under such sums or, as they are known technically, convolutions).σn Thus if we cann pass to a domain where such convergence has happened we do not care about the microscopic model anymore. ⇠ If the above is not clear already, I hope the plots below will help. Here I generate random walks, same as before, for the time interval t = [0, 10) by deviding the interval in 10000 steps. Then we zoom into the central region (any region would do) by factors of 2. You will notice that for the first 5 zoom ins the path looks the same. However, after that the discrete nature of Bernoulli jumps start becoming visible. In [2]: T=10.0 num_steps_bernoulli=2**12 delta_t_bernoulli=T/num_steps_bernoulli https://github.com/borundev/StochasticProcesses/blob/master/RandomWalkAndWeinerProcess.ipynb Page 2 of 6 StochasticProcesses/RandomWalkAndWeinerProcess.ipynb at master · borundev/StochasticProcesses 02/06/16 14:19 self.p=p self.dt=dt self.nsteps=int(self.T/self.dt) Paths.__setup__(self) self.randoms=2*(np.random.binomial(1,self.p,self.npaths*(self.nsteps-1))-.5) self.randoms.shape=[self.npaths,self.nsteps-1] for i in range(self.nsteps-1): self.paths[:,i+1]=self.paths[:,i]+self.randoms[:,i] b_paths=BinaryPaths(11,1,6).get_paths() number_columns=2 number_rows=3 figsize(12, 9) for i,j in enumerate([(i/number_columns,i%number_columns) for i in range(number_columns*number_row s)]): plt.subplot2grid((number_rows,number_columns),j) plt.plot(b_paths[i],"--o") plt.xlabel("time") Binomial Random Walk plt.ylabel("position") plt.ylim(-7,7) Covariance of random walk Covariance of steps Cov(X ,X )=4p(1 p)δ n m − n,m From Binomial Walk to Weiner Process but not back! The process described above is a Binomial process and happens in discrete times. However for analytical reasons we would like to take a Covariance of paths continuum limit of the same. Although having done that, for computational reasons the latter is approximated by a discrete process again. The reason for the analytical expression in continuous time is actually tied to the central limit theorem which for our purposes states that the sum of many independent incrememts by random variables with well defined mean and variance tends to a Gaussian process (the Gaussian is stable under such sums or, as they are known technically, convolutions). Thus if we can pass to a domain where such convergence has happened we do not care about the microscopic model anymore. If the above is not clear already, I hope the plots below will help. Here I generate random walks, same as before, for the time interval t = [0, 10) Cov(Yn,Ym)=4min(n, m)p(1by deviding the interval pin 10000) steps. Then we zoom into the central region (any region would do) by factors of 2. You will notice that for the first 5 zoom ins the− path looks the same. However, after that the discrete nature of Bernoulli jumps start becoming visible. In [2]: T=10.0 num_steps_bernoulli=2**12 delta_t_bernoulli=T/num_steps_bernoulli https://github.com/borundev/StochasticProcesses/blob/master/RandomWalkAndWeinerProcess.ipynb Page 2 of 6 StochasticProcesses/RandomWalkAndWeinerProcess.ipynb at master · borundev/StochasticProcesses 02/06/16 14:19 b=BinaryPaths(10,delta_t_bernoulli,1) time_line=b.get_timeline() path=b[0] number_columns=2 number_rows=4 figsize(12, 9) StochasticProcesses/RandomWalkAndWeinerProcess.ipynb at master · borundev/StochasticProcesses# plot the entire path first and then regions zoomed02/06/16 in by 14factor:19 of 2s for i,j in enumerate([(i/number_columns,i%number_columns) for i in range(number_columns*number_row s)]): plt.subplot2grid((number_rows,number_columns),j) b=BinaryPaths(10,delta_t_bernoulli,1) time_line_for_plot=time_line[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_b time_line=b.get_timeline() ernoulli/2 +num_steps_bernoulli/(2**(i+1))] path=b[0] path_for_plot=path[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_bernoulli/2 +num_steps_bernoulli/(2**(i+1))] number_columns=2 number_rows=4 plt.plot(time_line_for_plot,path_for_plot) figsize(12, 9) plt.xlabel("time") A glimpse of the central limit theorem plt.ylabel("position") # plot the entire path first and then regions zoomed in by factor of 2s for i,j in enumerate([(i/number_columns,i%number_columns) for i in range(number_columns*number_row s)]): For a very plt.subplot2grid large number((number_rows of steps,number_columns),j) time_line_for_plot=time_line[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_b ernoulli/2 +num_steps_bernoulli/(2**(i+1))] path_for_plot=path[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_bernoulli/2 +num_steps_bernoulli/(2**(i+1))] plt.plot(time_line_for_plot,path_for_plot) plt.xlabel("time") plt.ylabel("position") Take the central half and zoom in The distribution looks the same (after rescaling) It is intructive to understand what is happening here clearly. The discussion below works for all values of p away from 0 and 1 for sufficiently large n. The change in position after n steps is given by Yn = 2Binomial(n, p) − n . For large enough n (depending on how important tail events are the cutoffs are different) this can be approximated by Yn ∼ 2(np, √‾n‾p‾(‾1‾‾−‾‾p‾)) − n = n(2p − 1) + 2√‾n‾p‾(‾1‾‾−‾‾p‾)(0, 1) = n(2p − 1) + √4‾‾n‾p‾(‾1‾‾−‾‾p‾)(0, 1) Specializing to p = .5, if we progressively look at an interval n we can approximate 2k It is intructive to understand what is happening here clearly. The discussion below works for all values of p away from and for sufficiently‾‾n‾ large 0 1Yn ∼ (0, 1) . k n √ 2 and the plot is qualitatively the same as long as k is not large enough to violate the Binomial to Gaussian approximation. In the plots above we The change in position after n steps is given by have the size of intervals Yn = 2Binomial(n, p) − n . For large enough n (depending on how important tail events are theIn cuto [7]:ffs areprint different) [num_steps_bernoulli this can be approximated/2** byk for k in range(9)] Yn ∼ 2(np, √‾n‾p‾[4096,(‾1‾‾−‾‾p‾) )2048,− n 1024, 512, 256, 128, 64, 32, 16] = n(2p − 1) + 2√‾n‾p‾(‾1‾‾−‾‾p‾)(0, 1) = n(2p − 1) + 4‾‾n‾p‾(‾1‾‾−‾‾p‾)(0, 1) https://github.com/borundev/StochasticProcesses/blob/master/RandomWalkAndWeinerProcess.ipynb√ Page 3 of 6 Specializing to p = .5, if we progressively look at an interval n we can approximate 2k ‾‾n‾ Yn ∼ (0, 1) √ 2k and the plot is qualitatively the same as long as k is not large enough to violate the Binomial to Gaussian approximation. In the plots above we have the size of intervals In [7]: print [num_steps_bernoulli/2**k for k in range(9)] [4096, 2048, 1024, 512, 256, 128, 64, 32, 16] https://github.com/borundev/StochasticProcesses/blob/master/RandomWalkAndWeinerProcess.ipynb Page 3 of 6 StochasticProcesses/RandomWalkAndWeinerProcess.ipynb at master · borundev/StochasticProcesses 02/06/16 14:19 b=BinaryPaths(10,delta_t_bernoulli,1) time_line=b.get_timeline() path=b[0] number_columns=2 number_rows=4 figsize(12, 9) # plot the entire path first and then regions zoomed in by factor of 2s for i,j in enumerate([(i/number_columns,i%number_columns) for i in range(number_columns*number_row s)]): plt.subplot2grid((number_rows,number_columns),j) time_line_for_plot=time_line[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_b ernoulli/2 +num_steps_bernoulli/(2**(i+1))] path_for_plot=path[num_steps_bernoulli/2 -num_steps_bernoulli/(2**(i+1)):num_steps_bernoulli/2 +num_steps_bernoulli/(2**(i+1))] plt.plot(time_line_for_plot,path_for_plot) A glimpse pltof.xlabel the("time" central) limit theorem plt.ylabel("position") It is intructive to understand what is happening here clearly.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 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