Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dz339_pygbm-0.0.post53.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dz339_pygbm-0.0.post53-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file dz339_pygbm-0.0.post53.tar.gz.

File metadata

  • Download URL: dz339_pygbm-0.0.post53.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

Hashes for dz339_pygbm-0.0.post53.tar.gz
Algorithm Hash digest
SHA256 e550a05d9a1b46d12e22fc5a048817eec2a49273fe792a14da0deca5ee957769
MD5 230b81d35f2b06d094bcb2562f519928
BLAKE2b-256 853b41e10bbadc45cbd6e049c49234fd92dc45532496f40d2783abce3444820b

See more details on using hashes here.

File details

Details for the file dz339_pygbm-0.0.post53-py3-none-any.whl.

File metadata

File hashes

Hashes for dz339_pygbm-0.0.post53-py3-none-any.whl
Algorithm Hash digest
SHA256 0e03f3637b252769a660d0241b099f09103981a78416fc84e62b73ae9c726d8d
MD5 e88b58d2faeefb9b7c0fef7a8b244a0e
BLAKE2b-256 681fcee68a61ac84a615d118293d7cc0b09c79ad0a8db1e7955e94cb7c465374

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page