A python package to create simulations of geometric browninan motion.
Project description
PYGBM
A python package to create simulations of geometric browninan motion
Features
It can be used as a python package by importing it, as shown in the test, or it can be used inline in linux.
Installation
Download the pygbm repo and use pip install -e ..
Usage
The class GBMSimulator is initialised with the starting location, the drift and the diffusion of the system, and then the method simulate_path can be run to get the path.
An example simulation is below:
from pygbm.gbm_simulator import GBMSimulator
import matplotlib.pyplot as plt
# Parameters for GBM
y0 = 1.0
mu = 0.05
sigma = 0.2
T = 1.0
N = 100
# Initialize simulator
simulator = GBMSimulator(y0, mu, sigma )
# Simulate path
t_values, y_values = simulator.simulate_path_analytical(T, N)
# Plot the simulated path
plt.plot(t_values , y_values , label ="GBM Path")
plt.xlabel(" Time ")
plt.ylabel("Y(t)")
plt.title("Simulated Geometric Brownian Motion Path")
plt.legend()
plt.show()
This program can also be run on the cli by using the pygbm command, with the method subargument, as below
pygbm euler --y0 1.0 --mu 0.05 --sigma 0.2 --T 1.0 --N 100 --output gbm_plot.png
Documentation
To change Link to the documentation page.
Contributing
Contributions via pull requests are welcome!
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dz339_pygbm-1.0.post0.tar.gz.
File metadata
- Download URL: dz339_pygbm-1.0.post0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49f2fc935285a9df25b02e5785599a98c3b5460c22ab7e6fe0b9e99940e9d8fb
|
|
| MD5 |
def3d6c044a004a0635cfb32f9a6fe0d
|
|
| BLAKE2b-256 |
2b1dca208317a6edc20ea4c1fde17dfc4a3655aa2e9d6b3133e62d9d90f0fc80
|
File details
Details for the file dz339_pygbm-1.0.post0-py3-none-any.whl.
File metadata
- Download URL: dz339_pygbm-1.0.post0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f07e57e548c9dea897601520e6966ab5a05cc2160abadd45b19423e3008a01a5
|
|
| MD5 |
817a3d945cf949619f4505bb227bf678
|
|
| BLAKE2b-256 |
543b92cbf15ead5bfd3369d28b68f15e2c1dee7b070216aee938a1715cb6db43
|