mjf-finance
Broken Symmetry of Stock Returns - Modified Jones-Faddy Skew t-Distributions
mjf-finance is a Python library that implements the Modified Jones-Faddy (mJF) Skew t-Distribution, a statistical model designed to capture the "broken symmetry" of stock market returns. Unlike traditional models that assume symmetry, mJF accounts for the fact that market crashes are more frequent and violent than rallies (negative skew) and that the market generally trends upwards over time.
Features
- mJF1 Distribution: Implements Eq. 20 from the paper, allowing for asymmetric power-law tails for gains and losses.
- Gain/Loss Decoupling: Analyze the "volatility of gains" and "volatility of losses" separately.
- Physics-Inspired: Parameters are derived from multiplicative stochastic volatility models, offering interpretability.
- Risk Metrics: Designed for better estimation of Value at Risk (VaR) and tail risk (Black Swans).
Installation
You can install the package using pip:
pip install mjf-finance
Or install from source:
git clone https://github.com/username/mjf-finance.git
cd mjf-finance
pip install .
Usage
Analyzing Returns
import numpy as np
from mjf_finance.distributions import pdf_mjf1
# Example parameters based on S&P 500 (illustrative)
mu = 0.0005 # Location parameter (drift)
alpha_g = 3.5 # Shape parameter for gains
alpha_l = 2.8 # Shape parameter for losses (heavier tail)
theta = 0.00015 # Mean variance
tau = 1.0 # Time increment (e.g., 1 day)
# Evaluate PDF at specific return
ret = -0.05 # 5% loss
density = pdf_mjf1(ret, mu, alpha_g, alpha_l, theta, tau)
print(f"Probability density at -5%: {density}")
Calculating Statistics
from mjf_finance.statistics import statistical_mean, statistical_variance
mean_val = statistical_mean(mu, alpha_g, alpha_l, theta, tau)
variance_val = statistical_variance(alpha_g, alpha_l, theta, tau)
print(f"Expected Return: {mean_val}")
print(f"Variance: {variance_val}")
References
This project incorporates research from the following paper:
- Broken Symmetry of Stock Returns -- a Modified Jones-Faddy Skew t-Distribution Siqi Shao, Arshia Ghasemi, Hamed Farahani, R. A. Serota arXiv:2512.23640
Metadata
Release files for mjf-finance 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mjf_finance-0.1.0.tar.gz | 8.9 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mjf_finance-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.1 kB
Release files / mjf_finance-0.1.0.tar.gz
| Download URL | mjf_finance-0.1.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5afee98c4f9228650b37177ad64eda30fac606389fb2f10f3b1def95ec4c57de
|
|
BLAKE2b-256 checksum How to use checksums |
f26f37ca01819263df7e5e54616401cfc14d88580ae0447e12ce645549d345de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2026.
Transparency logRelease files / mjf_finance-0.1.0-py3-none-any.whl
| Download URL | mjf_finance-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
65946cfd95d8cb256be353706553febf648aa3e6a56ddb91f5f8140e5ab5da73
|
|
BLAKE2b-256 checksum How to use checksums |
7eb0cbfd69ba526f7dc8541b9ea3a9232749d73c9a984c69bcc980769cf7843f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2026.
Transparency logSecurity for mjf-finance 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for mjf_finance-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.