GithubHelp home page GithubHelp logo

time-series-math's Introduction

Time Series Math Library

Build Status Coverage Status Maven Central

Overview

The goal of this library is to provide optimised algorithms for time-series analysis and signal processing.

Features

  • Filters:
    • Moving Average Filter
    • Exponential Moving Average Filter
  • Normalizers:
    • Z-Normalization
    • Min-Max Normalization
  • Representations:
    • non-invertible
      • TESPAR DZ
      • Matrix Profile
        • full join
        • self join: STOMP, STAMP, SCRIMP
    • piecewise
      • Piecewise Aggregate Approximation (PAA)
      • Piecewise Linear Aggregate Approximation (PLAA)
      • Adaptive Piecewise Constant Approximation (APCA)
      • Piecewise Curve Fitting Approximation with linear (PLA), quadratic (PQA) or other types of curve fitting function
    • symbolic
      • Symbolic Aggregate Approximation (SAX)
      • Indexable Symbolic Aggregate Approximation (iSAX)
    • spectral
      • Discrete Fourier Transform (DFT)
      • Discrete Cosine Transform (DCT)
      • Discrete Chebyshev Transform (DChT)
    • wavelet
      • Discrete Haar Wavelet Transform (DWT)
  • Measurements:
    • Dynamic Time Warping (DTW)
    • Longest Common Subsequence (LCSS)
    • Edit Distance on Real sequence (EDR)
    • Edit distance with Real Penalty (ERP)
    • Uniform Scaling
    • Scaled and Warped Matching (use DTW in Uniform Scaling)
  • Others
    • Adaptive Distribution Divider used for (adaptive SAX/iSAX)
    • Complexity Invariant Distance

Usage

Add the following dependency to your maven project.

<dependency>
    <groupId>ro.hasna.ts</groupId>
    <artifactId>time-series-math</artifactId>
    <version><!--use latest version--></version>
</dependency>

Code examples

class Test {
    public static void main(String[] args) {
        double[] v1 = {-0.710518, -1.18332, -1.372442, -1.593083, -1.467002, -1.372442, -1.08876, 0.045967, 0.928532, 1.086133, 1.275254, 0.960052, 0.61333, 0.014447, -0.647477, -0.269235, -0.206195, 0.61333, 1.369815, 1.464375, 1.054613, 0.58181, 0.172048, -0.269235};
        double[] v2 = {-0.993009, -1.426787, -1.579884, -1.605401, -1.630917, -1.375754, -1.018526, -0.355102, 0.716583, 1.201393, 1.124844, 1.048295, 0.793132, 0.46142, 0.486936, 0.563485, 0.614518, 0.308322, 0.257289, 1.099327, 1.048295, 0.691066, -0.048906, -0.380618};
        double[] v3 = {1.319067, 0.569774, 0.195128, -0.085856, -0.179518, -0.27318, -0.085856, -1.397118, -1.116134, -0.741487, 0.007805, -0.085856, 0.007805, -0.460503, -0.554164, -0.741487, -0.741487, -0.741487, -1.116134, -0.460503, 0.476113, 2.349344, 2.255683, 1.600052};

        MovingAverageFilter ma = new MovingAverageFilter(2);
        v1 = ma.filter(v1);
        v2 = ma.filter(v2);
        v3 = ma.filter(v3);

        double tolerance = 0.05; //5%
        MinMaxNormalizer normalizer = new MinMaxNormalizer();
        DynamicTimeWarpingDistance dtw = new DynamicTimeWarpingDistance(tolerance, normalizer);

        System.out.println(dtw.compute(v1, v2));
        System.out.println(dtw.compute(v2, v3));
        System.out.println(dtw.compute(v1, v3));

        // => v1 and v2 are similar, v3 is different from the other two
    }
}

Contributing

Licensing

Time-Series Math library is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

time-series-math's People

Contributors

octavian-h avatar dependabot[bot] avatar

Stargazers

 avatar xudongdong avatar Hou, Weiying avatar  avatar  avatar Zhiyang Liu avatar Jon Chun avatar zqj avatar Evangelos Michelioudakis avatar wen avatar joe avatar  avatar Jacob Rachiele avatar  avatar  avatar

Watchers

 avatar stellawm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.