Skip to main content

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.

Metadata

Release files for py-lets-be-rational 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for py-lets-be-rational 1.1.2
File Size Uploaded
py_lets_be_rational-1.1.2.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for py-lets-be-rational 1.1.2
File Interpreter ABI Platform
py_lets_be_rational-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.7 kB

Release files / py_lets_be_rational-1.1.2.tar.gz

Download URL py_lets_be_rational-1.1.2.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2c4980eb7df97023c8b9918e8086d7d39a33304962e121212c580322cc7f4553
BLAKE2b-256 checksum
How to use checksums
933465aae0e922de66ac4c0de4fa4ffbc44534f9c6a9d6a06f684b87d523e45e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / py_lets_be_rational-1.1.2-py3-none-any.whl

Download URL py_lets_be_rational-1.1.2-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d4f489fdb5e9d1b7d6a3757331f905aab712a2cd4d97ebc77f51dcccf5bf08fb
BLAKE2b-256 checksum
How to use checksums
4ded16feed5f9af7516acfdc40b2cd47edf6591f8c98b8006d53292584b1b004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 release files

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page