All Projects → ServiceNow → Stl Decomp 4j

ServiceNow / Stl Decomp 4j

Licence: apache-2.0
Java implementation of Seasonal-Trend-Loess time-series decomposition algorithm.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Stl Decomp 4j

Hurst-exponent-R-S-analysis-
Calculates the Hurst exponent of a time series based on Rescaled range (R/S) analysis.
Stars: ✭ 33 (-56%)
Mutual labels:  timeseries, time-series
Tsai
Time series Timeseries Deep Learning Pytorch fastai - State-of-the-art Deep Learning with Time Series and Sequences in Pytorch / fastai
Stars: ✭ 407 (+442.67%)
Mutual labels:  time-series, timeseries
Deepadots
Repository of the paper "A Systematic Evaluation of Deep Anomaly Detection Methods for Time Series".
Stars: ✭ 335 (+346.67%)
Mutual labels:  time-series, timeseries
tempo
API for manipulating time series on top of Apache Spark: lagged time values, rolling statistics (mean, avg, sum, count, etc), AS OF joins, downsampling, and interpolation
Stars: ✭ 212 (+182.67%)
Mutual labels:  timeseries, time-series
Neural prophet
NeuralProphet - A simple forecasting model based on Neural Networks in PyTorch
Stars: ✭ 1,125 (+1400%)
Mutual labels:  time-series, timeseries
downsample
Collection of several downsampling methods for time series visualisation purposes.
Stars: ✭ 50 (-33.33%)
Mutual labels:  timeseries, time-series
Pydlm
A python library for Bayesian time series modeling
Stars: ✭ 375 (+400%)
Mutual labels:  time-series, timeseries
timemachines
Predict time-series with one line of code.
Stars: ✭ 342 (+356%)
Mutual labels:  timeseries, time-series
Ad examples
A collection of anomaly detection methods (iid/point-based, graph and time series) including active learning for anomaly detection/discovery, bayesian rule-mining, description for diversity/explanation/interpretability. Analysis of incorporating label feedback with ensemble and tree-based detectors. Includes adversarial attacks with Graph Convolutional Network.
Stars: ✭ 641 (+754.67%)
Mutual labels:  time-series, timeseries
Tidyquant
Bringing financial analysis to the tidyverse
Stars: ✭ 635 (+746.67%)
Mutual labels:  time-series, timeseries
modeltime.ensemble
Time Series Ensemble Forecasting
Stars: ✭ 65 (-13.33%)
Mutual labels:  timeseries, time-series
Phildb
Timeseries database
Stars: ✭ 25 (-66.67%)
Mutual labels:  time-series, timeseries
microprediction
If you can measure it, consider it predicted
Stars: ✭ 158 (+110.67%)
Mutual labels:  timeseries, time-series
cnosdb
An Open Source Distributed Time Series Database with high performance, high compression ratio and high usability.
Stars: ✭ 858 (+1044%)
Mutual labels:  timeseries, time-series
Deep XF
Package towards building Explainable Forecasting and Nowcasting Models with State-of-the-art Deep Neural Networks and Dynamic Factor Model on Time Series data sets with single line of code. Also, provides utilify facility for time-series signal similarities matching, and removing noise from timeseries signals.
Stars: ✭ 83 (+10.67%)
Mutual labels:  timeseries, time-series
Timetk
A toolkit for working with time series in R
Stars: ✭ 371 (+394.67%)
Mutual labels:  time-series, timeseries
Flot Downsample
Downsample plugin for Flot charts.
Stars: ✭ 186 (+148%)
Mutual labels:  time-series, timeseries
Lightkurve
A friendly package for Kepler & TESS time series analysis in Python.
Stars: ✭ 232 (+209.33%)
Mutual labels:  time-series, timeseries
Siridb Server
SiriDB is a highly-scalable, robust and super fast time series database. Build from the ground up SiriDB uses a unique mechanism to operate without a global index and allows server resources to be added on the fly. SiriDB's unique query language includes dynamic grouping of time series for easy analysis over large amounts of time series.
Stars: ✭ 438 (+484%)
Mutual labels:  time-series, timeseries
Uplot
📈 A small, fast chart for time series, lines, areas, ohlc & bars
Stars: ✭ 6,808 (+8977.33%)
Mutual labels:  time-series, timeseries

Seasonal Decomposition of Time Series by Loess

travis-ci-status License

The Seasonal-Trend-Loess (STL) algorithm decomposes a time series into seasonal, trend and residual components. The algorithm uses Loess interpolation (original paper here) to smooth the cyclic sub-series (e.g. all January values in the CO2 data shown in the example below). After removing the seasonality from the signal, the remainder is smoothed (in multiple steps) to find the trend. This process is repeated and may include robustness iterations that take advantage of the weighted-least-squares underpinnings of Loess to remove the effects of outliers. The details are described in STL: A Seasonal-Trend Decomposition Procedure Based on Loess.

stl-decomp-4j is a Java port of the original Ratfor/Fortran available from Netlib (original source here; also included as part of examples/StlPerfTest/fortran_benchmark), extended to support local quadratic interpolation. stl-decomp-4j expects equally spaced data with no missing values, similar to the original Fortran version (and the R and Python versions, which both use the original Fortran version under the hood).

Check out the the stl-decomp-4j wiki for TODOs, etc.

Example

At a minimum, the STL algorithm requires specifying the periodicity of the data (e.g. 12 for monthly) and the width of the Loess smoother used to smooth the cyclic seasonal sub-series. In general, there are three Loess smoothers that each require three parameters: a width, a degree, and a jump. The width specifies the number of data points that the local interpolation uses to smooth each point, the degree specifies the degree of the local polynomial that is fit to the data, and the jump specifies how many points are skipped between Loess interpolations, with linear interpolation being done between these points. Because of this complexity, construction is done via Builder objects, as shown in this simple example.

double[] values = getSomeMonthlyData(); // Monthly time-series data

SeasonalTrendLoess.Builder builder = new SeasonalTrendLoess.Builder();
SeasonalTrendLoess smoother = builder.
			setPeriodLength(12).    // Data has a period of 12
			setSeasonalWidth(35).   // Monthly data smoothed over 35 years
			setNonRobust().         // Not expecting outliers, so no robustness iterations
			buildSmoother(values);

SeasonalTrendLoess.Decomposition stl = smoother.decompose();
double[] seasonal = stl.getSeasonal();
double[] trend = stl.getTrend();
double[] residual = stl.getResidual();

The StlDemoRestServer example includes a copy of the Monthly CO2 Measurement Data and a simple REST server that reads this data, performs an STL decomposition on the data, and serves up the results to http://localhost:4567/stldemo. The examples/StlDemoRestServer/index.html file loads the data from this server and plots the resulting decomposition. The code that does the actual decomposition is identical to that shown above, resulting in the following decomposition:

CO2 Plot

Benchmarking

The StlPerfTest example times the STL running on the CO2 data mentioned above or on a time-series of 10 years of random hourly data. The same benchmark is implemented in the original Fortran here. See Performance Tests for instructions on running these tests.

Limited testing show the Java to be about half the speed of the Fortran. A comparison of the resulting decompositions is shown in the StlJavaFortranComparison notebook.

Documentation

The implementation of the quadratic extension of LoessInterpolator is described, mathematically, in ImplementationNotes.

TODO: JavaDoc link goes here

Build Dependencies

To include stl-decomp-4j in your maven project, add the following to your pom file:

        <dependency>
          <groupId>com.github.servicenow.stl4j</groupId>
          <artifactId>stl-decomp-4j</artifactId>
          <version>1.0.5</version>
        </dependency>

The stl-decomp-4j implementation has no external dependencies.

The unit tests depend on junit, commons-math3 and slf4j-simple.

The examples have further dependencies on commons-cli, opencsv, spark-core, and jackson-mapper-asl.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].