Skip to main content

A financial math library for options pricing, stochastic processes, and fixed income analytics

Project description

Financial Math Library

A Python library for pricing derivatives, simulating stochastic processes, and analyzing fixed income instruments.

Features

  • Options Pricing

    • Black-Scholes analytical pricing
    • Heston stochastic volatility model
    • Monte Carlo simulation
    • Binomial/trinomial trees
    • Implied volatility calculation
  • Stochastic Processes

    • Arithmetic Brownian Motion (ABM)
    • Geometric Brownian Motion (GBM)
    • Cox-Ingersoll-Ross (CIR)
    • Ornstein-Uhlenbeck (OU)
    • Vasicek
    • Jump diffusion (Merton)
  • Fixed Income

    • Bond pricing and yield curve tools
  • Portfolio

    • Risk and performance metrics

Project Structure

fixed_income/
    fixed_income.py        # Fixed income pricing and analytics

options/
    iv.py                  # Implied volatility solver
    option.py              # Option contract definitions

portfolio/
    metrics.py             # Portfolio risk/performance metrics

pricing/
    black_scholes.py       # Black-Scholes model
    heston.py               # Heston stochastic volatility model
    monte_carlo.py          # Monte Carlo pricing engine
    trees.py                 # Binomial/trinomial tree pricing

processes/
    abm.py                  # Arithmetic Brownian Motion
    cir.py                    # Cox-Ingersoll-Ross process
    gbm.py                   # Geometric Brownian Motion
    jump_diffusion.py        # Jump diffusion process
    ou.py                      # Ornstein-Uhlenbeck process
    vasicek.py                # Vasicek interest rate model

testing.ipynb              # Example usage and validation notebook

Installation

git clone <repo-url>
cd <repo-name>
pip install -r requirements.txt

Usage

See testing.ipynb for example workflows, including:

  • Pricing European options with Black-Scholes and comparing to Monte Carlo
  • Simulating asset paths with GBM, CIR, and jump diffusion processes
  • Calibrating the Heston model to market data
  • Computing implied volatility surfaces
  • Evaluating fixed income instruments and portfolio metrics

Requirements

  • Python 3.8+
  • NumPy
  • SciPy
  • matplotlib (for notebook visualizations)

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

finmat-0.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

finmat-0.1.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file finmat-0.1.0.tar.gz.

File metadata

  • Download URL: finmat-0.1.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for finmat-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d0840194033c68a597c265e7352926b638e24e0b9051338bf547538b6d48f87
MD5 684e720b64e623f8a145dd26ef27dd55
BLAKE2b-256 9e10f46d7678cebbee93e081dbf7c99708c7907f1e3e7a8acf2f9a413d9bf5ae

See more details on using hashes here.

File details

Details for the file finmat-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: finmat-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for finmat-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f68026095bfce6ec9f7ad331854ee79df19a99dc0ca6386649024c0bc9896315
MD5 34ae211a67517b3823014217888b11ff
BLAKE2b-256 e4ef2b37d39f82fd06dc5a0034639ed3c3aa01156a87712ce30328a88cfbf83b

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