A Python package for simulating Geometric Brownian Motion (GBM).
Project description
pygbm — Geometric Brownian Motion Simulator
pygbm is a lightweight Python package for simulating Geometric Brownian Motion (GBM) paths.
It provides both a Python API and a command-line interface, with documentation hosted on Read the Docs.
Documentation
https://geometric-brownian-motion-simulations.readthedocs.io/en/latest/
Installation
Install from PyPI
Once published on PyPI, the package can be installed directly via:
pip install pygbm_xzy
Install from Source (Editable Mode)
Alternatively, clone the repository and install the package in editable mode:
git clone https://github.com/ZZZiyao/Geometric-Brownian-motion-simulations.git
cd Geometric-Brownian-motion-simulations
pip install -e .
Description
Geometric Brownian Motion (GBM) is a stochastic process commonly used to model multiplicative random dynamics. It satisfies the stochastic differential equation:
dY(t) = μ Y(t) dt + σ Y(t) dB(t)
where μ is the drift coefficient and σ is the diffusion coefficient.
Features
- Object-oriented design with a shared base class
- Simulation of GBM paths using the analytical solution
- Simple Python interface
- Command-line interface
- Automatically generated documentation using Sphinx and Read the Docs
Usage
Python Interface
from pygbm.gbm_simulator import GBMSimulator
simulator = GBMSimulator(y0=1.0, mu=0.05, sigma=0.2)
t_values, y_values = simulator.simulate_path(T=1.0, N=100)
simulator.plot_path(t_values, y_values, output="gbm_plot.png")
Command-Line Interface
pygbm simulate --y0 1.0 --mu 0.05 --sigma 0.2 --T 1.0 --N 100 --output gbm_plot.png
Documentation
Full documentation, including the API reference and an example notebook, is available at:
https://geometric-brownian-motion-simulations.readthedocs.io/en/latest/pygbm
The documentation is automatically built and published using Read the Docs.
Contributing
Contributions are welcome.
Fork the repository and submit a pull request.
License
This project is licensed under the MIT License.
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 pygbm_xzy-0.1.0.post3.tar.gz.
File metadata
- Download URL: pygbm_xzy-0.1.0.post3.tar.gz
- Upload date:
- Size: 84.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ef1f39cce114307666f0f984d8d22b66ec57defe2c07d70d8fd519b64400984d
|
|
| MD5 |
50aa20c3b81b05d00306adf34e4bdfd8
|
|
| BLAKE2b-256 |
3a812da3fd89b47026526c7568203240247be7169242f18f6018abdafd9f0428
|
File details
Details for the file pygbm_xzy-0.1.0.post3-py3-none-any.whl.
File metadata
- Download URL: pygbm_xzy-0.1.0.post3-py3-none-any.whl
- Upload date:
- Size: 82.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
114139bed3a2adf88105f470e376741a8f7954570df1e12a4dd521279f8b3fe0
|
|
| MD5 |
9456462d1ae78b07ab88bb31af9d8c55
|
|
| BLAKE2b-256 |
e5a15610223e0b2ee64fe0ec5a3707d3c0ff2166991330e043b1bef08199ba28
|