Skip to main content

Pure python implementation of Peter Jaeckel's LetsBeRational.

Project description

Overview

lets_be_rational is the canonical package for Peter Jaeckel's LetsBeRational algorithm. It provides a pure Python implementation and keeps the historical py_lets_be_rational import path available for compatibility.

Execution Speed

lets_be_rational is orders of magnitude faster than traditional implied volatility calculation libraries, thanks to the algorithms developed by Peter Jaeckel.

Numba Dependency

Numba is an optional dependency. Because Numba installation can be tricky and OS-dependent, we decided to leave it up to each user to decide how and whether to install Numba. If Numba is present, execution speed will be faster. If not, the code will still run -- just slower.

Installing numba

lets_be_rational optionally depends on numba which in turn depends on llvm-lite. llvm-lite wants LLVM 3.9 being installed. On Mac OSX, use the latest version of HomeBrew to install numba's dependencies as shown below:

brew install llvm@3.9
LLVM_CONFIG=/usr/local/opt/llvm@3.9/bin/llvm-config pip install llvmlite==0.16.0
pip install numba==0.31.0

For other operating systems, please refer to the llvm-lite and numba documentation.

Development

Fork our repository, and make the changes on your local copy:

git clone git@github.com/your_username/py_lets_be_rational
cd py_lets_be_rational
pip install -e .
pip install -r dev-requirements.txt

When you are done, push the changes, and create a pull request on your repo.

About "Let's be Rational"

"Let's Be Rational" is a paper by Peter Jäckel showing "how Black's volatility can be implied from option prices with as little as two iterations to maximum attainable precision on standard (64 bit floating point) hardware for all possible inputs."

The paper is accompanied by the full C source code, which resides at www.jaeckel.org/LetsBeRational.7z.

    Copyright © 2013-2014 Peter Jäckel.

    Permission to use, copy, modify, and distribute this software is freely granted,
    provided that this notice is preserved.

    WARRANTY DISCLAIMER
    The Software is provided "as is" without warranty of any kind, either express or implied,
    including without limitation any implied warranties of condition, uninterrupted use,
    merchantability, fitness for a particular purpose, or non-infringement.

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

lets_be_rational-1.1.0.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

lets_be_rational-1.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file lets_be_rational-1.1.0.tar.gz.

File metadata

  • Download URL: lets_be_rational-1.1.0.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for lets_be_rational-1.1.0.tar.gz
Algorithm Hash digest
SHA256 60f2c1948e5364f819bfc703316e6a1fea0813b769c1038d9817e7db7658be5d
MD5 316185f394d416b3beca741b22946ac2
BLAKE2b-256 a9d1eef256c37506c90c4f082ed272b5af7b829324450229e8a13deb17bad6f5

See more details on using hashes here.

File details

Details for the file lets_be_rational-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for lets_be_rational-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a55acf1faa8d78352164bf1a23089fd4020cd1634e4a16b36ae0ea8972fcaf20
MD5 06453cfcbe61b1d01d0f06a7eb4bf39b
BLAKE2b-256 0c7255c1469f01c0caedcdab16fdee749555665d1faa6d343a5cebdcdb2f8493

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