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

pip install finmat

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.2.0.tar.gz (8.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.2.0-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: finmat-0.2.0.tar.gz
  • Upload date:
  • Size: 8.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.2.0.tar.gz
Algorithm Hash digest
SHA256 610a0068dcc0fc37c57ed79ffe2e96663b8a8e94b6103218046f3587a9bf73d1
MD5 ef6b9f352d0edf39e8535ceb08ea9c4c
BLAKE2b-256 c7bb3d793e0f9d9501130d9ab78c18d3910f4d4cb57f95da8cb1bb40f36b5994

See more details on using hashes here.

File details

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

File metadata

  • Download URL: finmat-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.7 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70c35379bd957bfcd65c2e735296f68f5499dfdf7e1460db78d2bdb1fd5693b7
MD5 7f62091d3003e30af91b972605bf7f29
BLAKE2b-256 27279afd091522fc3b3fc5b81523f7842c89d75ac770299cf50b9bbd59079fbb

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