GithubHelp home page GithubHelp logo

inphyt / unrollingaverages.jl Goto Github PK

View Code? Open in Web Editor NEW
18.0 0.0 2.0 770 KB

A Julia package to deconvolve ("unroll") moving averages of time series to get the original ones back.

Home Page: https://inphyt.github.io/UnrollingAverages.jl/dev

License: MIT License

Julia 100.00%
time-series time-series-analysis time-series-database time-series-transformation time-series-data statistics stats julia julia-language julia-package

unrollingaverages.jl's Introduction

UnrollingAverages.jl

License: MIT Docs: Stable Docs: Dev CI Compat Helper Format Check Coverage: Codecov Coverage: Coveralls Code Style: Blue DOI

UnrollingAverages is a Julia package aimed at deconvolving (or unrolling) moving averages of time series to get the original ones back.

UnrollingAverages currently assumes that the moving average is a simple moving average. Further relaxations and extensions may come in the future, see Future Developments section.

Installation

Press ] in the Julia REPL and then

pkg> add UnrollingAverages

Usage

The package exports a single function called unroll: it returns a Vector whose elements are the possible original time series.

unroll( moving_average::Vector{Float64},
        window::Int64;
        initial_conditions::U=nothing,
        assert_natural::Bool=false
      ) where {U<:Union{Tuple{Vararg{Union{Int64,Float64}}},Nothing}}

Arguments

  • moving_average: the time series representing the moving average to unroll ;
  • window: the width of the moving average ;
  • initial_conditions: the initial values of the original time series to be recovered. It may be a Tuple of window-1 positive integer values, or nothing if initial conditions are unknown. Currently it is not possible to specify values in the middle of the time series, this may be a feature to be added in the future ;
  • assert_natural default boolean argument. If true, the pipeline will try to recover a time series of natural numbers only. More then one acceptable time series (where "acceptable" means that it reproduces moving_average) may be found and all will be returned.

A few remarks:

  1. If isnothing(initial_conditions):
    • if assert_natural, then an internal unroll_iterative method is called, which tries to exactly recover the whole time series, initial conditions included. Enter ?UnrollingAverages.unroll_iterative in a Julia to read further details;
    • if !assert_natural, then an internal unroll_linear_approximation method is called. See this StackExchange post. NB: this is an approximated method, it will generally not return the exact original time series;
  2. If typeof(initial_conditions) <: Ntuple{window-1, <:Union{Int64,Float64}}, then an internal unroll_recursive method is called, which exactly recovers the time series. Mathematical details about this function are reported in the documentation, and you may read more by entering ?UnrollingAverages.unroll_recursive.

Future Developments

  • Modify initial_conditions argument of unroll so that it accepts known values throughout the series;
  • Implement reversing methods for other types of moving averages .

How to Contribute

If you wish to change or add some functionality, please file an issue. Some suggestions may be found in the Future Developments section.

How to Cite

If you use this package in your work, please cite this repository using the metadata in CITATION.bib.

Announcements

unrollingaverages.jl's People

Contributors

github-actions[bot] avatar interdisciplinaryphysicsteam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unrollingaverages.jl's Issues

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

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.