title: Poisson Process and Random Walks
body: <p>I am trying to simulate a random walk in 1D by graphing a Poisson process with a mean rate of 1 s^(-1), but in a randomly chosen direction (left or right).  I am trying to plot the trajectories (<code>x</code> vs <code>t</code>) with a total duration of <code>t = 400s</code>, however, I can't seem to track the <code>x</code> direction with <code>t</code> (time) properly. How can I do this? I have this so far: </p>
  
  <pre><code>x = [0]
  
  t = [0]
  
  for j in range(100):
  
      mean_rate = 1.0 
      d = 1.0 
      step_x = np.random.poisson(0, mean_rate)
      bern_tri = np.random.binomial(0.5,step_x)
  
      if bern_tri == 1:
          x.append(x[j] + d)
          t.append(t[j])
      else:
          x.append(x[j] - d)
          t.append(t[j])
  plt.plot(x,t) 
  plt.show()
  </code></pre>