GBMSimulator package
GBMSimulator.GBMSimulator module
- class Modules.Simulator.GBMSimulator[source]
Bases:
object- simulate(mu, n, T, M, y0, sigma)[source]
Simulate geometric Brownian motion for given parameters.
- Parameters:
mu (int) – Drift coefficient.
n (int) – Number of time steps.
T (int) – Total time in years.
M (int) – Number of simulation paths.
y0 (int) – Initial value.
sigma (int) – Volatility of the process.
- Returns:
Simulated paths, with shape (n + 1, M).
- Return type:
numpy.ndarray
- Example:
>>> simulator = GBMSimulator() >>> paths = simulator.simulate(mu=0.1, n=1000, T=1, M=10, y0=100, sigma=0.2) >>> paths.shape (1001, 10)
CLI Tool Documentation
Generate and plot Gemoetric Brownian motion paths
usage: __main__.py [-h] --mu MU --n N --T T --M M --y0 Y0 --sigma SIGMA
Named Arguments
- --mu
Drift coefficient
- --n
Number of time steps
- --T
Total time duration
- --M
Number of simulations
- --y0
Initial value
- --sigma
Volatility coefficient