Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Split Normal Distribution aka Two-Piece Normal Distribution

A tiny package implementing functions of the split normal distribution compatible with Numpy and JAX.

Install

pip install split-normal

Usage

import split_normal as sn

x = [-2.43953147, -1.31863936, -0.36272127, 0.77429312, 2.56092868]
p = [0.05, 0.25, 0.5, 0.75, 0.95]
loc = -1.
scale_1 = 1.
scale_2 = 2.

y_np = sn.numpy.pdf(x, loc, scale_1, scale_2)
print(y_np)
# [0.09437028 0.25279683 0.25279683 0.17943932 0.05450677]
p_np = sn.numpy.cdf(x, loc, scale_1, scale_2)
print(p_np)
# [0.05 0.25 0.5 0.75 0.95]
x_np = sn.numpy.ppf(p, loc, scale_1, scale_2)
print(x_np)
# [-2.43953147 -1.31863936 -0.36272127 0.77429312 2.56092868]

y_jax = sn.jax.pdf(x, loc, scale_1, scale_2)
print(y_jax)
# [0.09437027 0.2527968 0.2527968 0.17943932 0.05450677]
p_jax = sn.jax.cdf(x, loc, scale_1, scale_2)
print(p_jax)
# [0.04999999 0.25 0.5 0.75 0.95]
x_jax = sn.jax.ppf(p, loc, scale_1, scale_2)
print(x_jax)
# [-2.4395318 -1.3186394 -0.36272126 0.77429295 2.5609286]

Equations

PDF

Probability density function.

where .

CDF

Cummulative density function.

PPF

Percent point function (also called inverse CDF or quantile function).

Literature

Wallis, Kenneth F. “The Two-Piece Normal, Binormal, or Double Gaussian Distribution: Its Origin and Rediscoveries.” Statistical Science, vol. 29, no. 1, 2014, pp. 106–112. JSTOR, www.jstor.org/stable/43288461.

Release files for split-normal 0.1.0a3

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

Source distribution (sdist)

Source distribution for split-normal 0.1.0a3
File Size Uploaded
split-normal-0.1.0a3.tar.gz 3.8 kB Details

Release files / split-normal-0.1.0a3.tar.gz

Download URL split-normal-0.1.0a3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f7dcf7f7f69d2aff7ee45f88f3793073257ba9756b0f9fdaad593bad5bbf91a9
BLAKE2b-256 checksum
How to use checksums
73ba0daeb82e75941ba8d14b29dd7cc771e08aa13f43783733ddedf6d7b39918
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1.post20200622 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.6.10
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