Guest User

Untitled

a guest
Oct 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. od0o = np.zeros((N,))
  2. od0o[0]=0.7
  3. od0n = np.zeros((N,))
  4.  
  5. def TOTAL(a):
  6. ...
  7. return...
  8.  
  9. for i in range (1,N):
  10. R = np.random.uniform(0,1)
  11.  
  12. od0n[i] = od0o[i-1] + 0.001 * np.random.normal()
  13.  
  14. L = np.exp(-0.5 * (TOTAL(od0n[i]) - TOTAL(od0o[i-1]))
  15. LL=min(1,max(L,0))
  16.  
  17. if LL>R:
  18. od0o[i]= od0n[i]
  19. chi = TOTAL(od0o[i])
  20. else:
  21. od0o[i]= od0o[i-1]
  22. chi = TOTAL(od0o[i])
Add Comment
Please, Sign In to add comment