Skip to content

ldolberg/stl-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stl-java

travis-ci-status

A Java implementation of STL: A Seasonal-Trend Decomposition Procedure Based on Loess

To include this library in your project, add the following dependency

<dependency>
  <groupId>com.github.brandtg</groupId>
  <artifactId>stl-java</artifactId>
  <version>0.0.1</version>
</dependency>

Example

Assuming we have a time series of monthly data that is periodic with respect to years

double[] ts;
double[] ys; // some dependent variable on ts

We can run STL as follows

StlConfig config = new StlConfig();
config.setNumberOfObservations(12); // 12 months in a year
config.setNumberOfDataPoints(ts.length);

StlDecomposition stl = new StlDecomposition(config);
StlResult res = stl.decompose(ts, ys);

And optionally plot the results (n.b. StlPlotter is in test scope)

StlPlotter.plot(res);

STL result chart

About

A Java implementation of STL

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 93.5%
  • Python 6.5%