Skip to main content

Efficient SuperSmoother for Python

Project description

Supsmu

Supsmu is an implementation of Friedman's SuperSmoother algorithm - a time series smoother that uses cross-validation to automatically select optimal spans for local linear regression.

The package is written in C for computational efficiency, with Python bindings for use with NumPy arrays.

A comparison of noisy data and its smoothed version using Supsmu

Installation

pip install supsmu

Python Example

Minimal example using dummy data:

import numpy as np
from supsmu import supsmu

x = np.linspace(0, 1, 100, dtype=np.float64)
# Dummy data - a basic sine wave
y = np.sin(2 * 2 * np.pi * x)
noise = np.random.normal(0, 0.2, 100)
y_noisy = y + noise

y_smooth = supsmu(x, y_noisy, periodic=True)

Additional Information

The implementation is designed to closely match the outputs of the Fortran version (available in R), however there may still exist some inconsistencies.

References

[1] J. H. Friedman, "A Variable Span Smoother", SLAC National Accelerator Laboratory (SLAC), Menlo Park, CA (United States), SLAC-PUB-3477; STAN-LCS-005, Oct. 1984. doi: 10.2172/1447470.

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

supsmu-1.0.0.tar.gz (209.4 kB view details)

Uploaded Source

File details

Details for the file supsmu-1.0.0.tar.gz.

File metadata

  • Download URL: supsmu-1.0.0.tar.gz
  • Upload date:
  • Size: 209.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.9

File hashes

Hashes for supsmu-1.0.0.tar.gz
Algorithm Hash digest
SHA256 17a114fc83188825f89871ef88bd50a6c6001e6587a7af96f78f3bea66df34b8
MD5 1c072131cc7a8840a111305b98915b38
BLAKE2b-256 a772606fee523965de76dab9816e136f32e4f2b189d9a34d3ee418835850ac8b

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