Skip to main content

Computes non-parametric distributions by optizing a constrained smoothing function

Project description

Smoother is a statistical tool for computing non-parametric distributions by optimizing a constrained smoothing function.

Why smoother?

We often want to estimate a distribution given limited information, such as its mean and standard deviation. Rather than impose parametric assumptions, smoother uses non-parametric techniques to infer an entire distribution given limited information.

Installation

$ pip install smoother

Quickstart

from smoother import Smoother, MomentConstraint

import matplotlib.pyplot as plt
import numpy as np

# fit a smooth distribution with given mean and standard deviation
lower_bound, upper_bound = -3, 3
mean_const = MomentConstraint(0, degree=1)
std_const = MomentConstraint(1, degree=2, type_='central', norm=True)
smoother = Smoother().fit(lower_bound, upper_bound, [mean_const, std_const])

# plot smoother pdf
x = np.linspace(lower_bound, upper_bound, num=100)
f_x = np.array([smoother.pdf(x_i) for x_i in x])
plt.plot(x, f_x)

The result should look like a normal distribution.

Citation

@software{bowen2020smoother,
  author = {Dillon Bowen},
  title = {Smoother: a statistical package for computing smooth, non-parametric distributions},
  url = {https://dsbowen.github.io/smoother/},
  date = {2020-08-06},
}

License

Users must cite this package in any publications which use it.

It is licensed with the MIT License.

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

smoother-0.0.1.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

smoother-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file smoother-0.0.1.tar.gz.

File metadata

  • Download URL: smoother-0.0.1.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for smoother-0.0.1.tar.gz
Algorithm Hash digest
SHA256 263b69b63b647d0e3f095f95f39ef300accfa1ab18fae5f82b6fddd7eed9dcac
MD5 b23a0cfa127784b842051838c77e76a8
BLAKE2b-256 f9b52f2819dd8191a99f50387a97e7cc46bfae4754214af7386f46d0fb505d0f

See more details on using hashes here.

File details

Details for the file smoother-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: smoother-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.6.8

File hashes

Hashes for smoother-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c33fb6feb82284cfefd097f402d0914ecb3160f7b100ebdedb56ae5c479d2258
MD5 bd02efe9dbaded0c673f18d1f4252842
BLAKE2b-256 8287621087ea53aec4726d3eb7c34b3f3dc6bb6e0106a7f211a3266cfa27c5b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page