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.1.1.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.1-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: finmat-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 b9e9f2849550d85564c2a0475820930f69f4737724aa9eab36d6bbfccc30e76f
MD5 781f83a5ed4b9a8740b099bccd43fa07
BLAKE2b-256 08acc23d2c09c673e9b93c77e0fbdda89805d4ea2c5e3d8a48bd61e439ebc18b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: finmat-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.0 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4034c28336cbe5326d3d34f04867d0dbf64880acaa8bef9621f4a721ac4e3bf0
MD5 32b32925ab56c66ac564144dbac30502
BLAKE2b-256 be56f9448452c0672aa6938671c5a188b5aa2c089600990fad823f5dd4e4ef45

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