Skip to main content

A Python implementation of seasonal trend with Loess (STL) time series decomposition

Project description

This is a relatively naive Python implementation of a seasonal and trend decomposition using Loess smoothing. Commonly referred to as an “STL decomposition”, Cleveland’s 1990 paper is the canonical reference.

This implementation is a variation of (and takes inspiration from) the implementation of the seasonal_decompose method in statsmodels. In this implementation, the trend component is calculated by substituting a configurable Loess regression for the convolutional method used in seasonal_decompose. It also extends the existing DecomposeResult from statsmodels to allow for forecasting based on the calculated decomposition.

Usage

The stldecompose package is relatively lightweight. It uses pandas.Dataframe for inputs and outputs, and exposes only a couple of primary methods - decompose() and forecast() - as well as a handful of built-in forecasting functions.

See the included IPython notebook for more details and usage examples.

Installation

A Python 3 virtual environment is recommended.

The preferred method of installation is via pip:

(env) $ pip install stldecompose

If you’d like the bleeding-edge version, you can also install from this Github repo:

(env) $ git clone git@github.com:jrmontag/STLDecompose.git
(env) $ cd STLDecompose; pip install .

More Resources

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

stldecompose-0.0.5.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

stldecompose-0.0.5-py2.py3-none-any.whl (6.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file stldecompose-0.0.5.tar.gz.

File metadata

  • Download URL: stldecompose-0.0.5.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for stldecompose-0.0.5.tar.gz
Algorithm Hash digest
SHA256 dc13f103a1abb6fba53937dbf6607c2c7e5bc483317ab7879ea5fb3e968d97ac
MD5 a597e7f07247f72cf22f029ebf81bd34
BLAKE2b-256 367804d96ebbacf2c8d0876167c900e248f10440a84cd2e59490044a2944b84e

See more details on using hashes here.

File details

Details for the file stldecompose-0.0.5-py2.py3-none-any.whl.

File metadata

  • Download URL: stldecompose-0.0.5-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for stldecompose-0.0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 13b12c97ccd23438e5ca71af646ac2650b04c83a02f1ad2127b0d4f50b9ac5f1
MD5 04171753da298d0d0c7d051d56565363
BLAKE2b-256 7f0fcc3cf33ae4ec1ffc83a2951dc37b5cdb49f9166c0e1de1a61e11b6d954fe

See more details on using hashes here.

Supported by

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