Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import numpy as np
- np.random.seed(1)
- def gbm(mu=1, sigma = 0.6, x0=100, n=50, dt=0.1):
- step = np.exp( (mu - sigma**2 / 2) * dt ) * np.exp( sigma * np.random.normal(0, np.sqrt(dt), (1, n)))
- return x0 * step.cumprod()
- series = gbm()
Add Comment
Please, Sign In to add comment