Guest User

Untitled

a guest
Nov 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. import numpy as np
  2. np.random.seed(1)
  3.  
  4. def gbm(mu=1, sigma = 0.6, x0=100, n=50, dt=0.1):
  5. step = np.exp( (mu - sigma**2 / 2) * dt ) * np.exp( sigma * np.random.normal(0, np.sqrt(dt), (1, n)))
  6. return x0 * step.cumprod()
  7.  
  8. series = gbm()
Add Comment
Please, Sign In to add comment