In [1]:
%load_ext autoreload
%autoreload 2
import numpy as np
import matplotlib.pyplot as plt
from quantfinlib.sim import BrownianMotion
Random walk
Below a plot of 3 scenarios of Brownian Motion (BM) random walk, \(dS = \mu + \sigma dW\)
In [2]:
gbm_sample(
s0=120.70,
vol=0.25,
drift=0.02,
t0='2021-01-01',
freq='B',
path_len=252,
num_paths=3
).plot()
plt.show()