GithubHelp home page GithubHelp logo

aj-cloete / pssa Goto Github PK

View Code? Open in Web Editor NEW
136.0 7.0 60.0 1.53 MB

Singular Spectrum Analysis for time series forecasting in Python

Python 1.61% Jupyter Notebook 98.39%
ssa caterpillar-ssa singular spectrum analysis singular-spectrum-analysis forecasting time-series-analysis time series

pssa's Introduction

pySSA

Singular Spectrum Analysis for time series forecasting in Python

An example of the implementation of this code can be found in Singular Spectrum Analysis Example.ipynb.

I will update the list of references/credits at another time. The research of Nina Golyandina from Russia was invaluable in aiding my understanding of this method.

[update 4 April 2017] - Please note that the current version requires a pandas dataframe with a datetime formatted index for it to work. I will push an update soon to allow numpy array inputs.

Please feel free to fork the project and contribute!

pssa's People

Contributors

aj-cloete avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pssa's Issues

What is the best way to install this package?

Since there is no setup.py, there is no way to pip install this package even using git+https://github.com/aj-cloete/pySSA.git. Do I just clone and copy the files, or is there a better way?

forecast_recurrent error

Hello!
I like your lib! But I've got some errors:

AttributeError Traceback (most recent call last)
~/Documents/notebooks/vk/SSA/mySSA.py in forecast_recurrent(self, steps_ahead, singular_values, plot, return_df, **plotargs)
206 try:
--> 207 self.X_com_hat
208 except(AttributeError):

AttributeError: 'mySSA' object has no attribute 'X_com_hat'

During handling of the above exception, another exception occurred:

KeyError Traceback (most recent call last)
~/Documents/notebooks/vk/SSA/mySSA.py in _forecast_prep(self, singular_values)
185 for i in singular_values:
--> 186 self.forecast_orthonormal_base[i] = self.orthonormal_base[i]
187 except:

KeyError: 3

During handling of the above exception, another exception occurred:

TypeError Traceback (most recent call last)
in ()
----> 1 ssa.forecast_recurrent(steps_ahead=ssa.ts.shape[0], singular_values=streams10, plot=True)

~/Documents/notebooks/vk/SSA/mySSA.py in forecast_recurrent(self, steps_ahead, singular_values, plot, return_df, **plotargs)
207 self.X_com_hat
208 except(AttributeError):
--> 209 self._forecast_prep(singular_values)
210 self.ts_forecast = np.array(self.ts_v[0])
211 for i in range(1, self.ts_N+steps_ahead):

~/Documents/notebooks/vk/SSA/mySSA.py in _forecast_prep(self, singular_values)
189 self.forecast_orthonormal_base[0] = self.orthonormal_base[0]
190 else:
--> 191 raise('Please pass in a list/array of singular value indices to use for forecast')
192 else:
193 self.forecast_orthonormal_base = self.orthonormal_base

TypeError: exceptions must derive from BaseException

Filling gaps using SSA

Hey aj, how are you?

I'm going to use your code to fill gaps in sea level data. How should I proceed? Use this method to my entire series and then extract correspondent values for each gap or there is another way to do this?

'm' is not defined

Hello,

I am trying to learn to use SSA and I wanted to use your tutorial to see how to use it and how ti works. But when I tried to use your code I get an error message :

" File "...\pssa-master\src\mySSA.py", line 91, in embed
self.X = m(linalg.hankel(self.ts, np.zeros(self.embedding_dimension))).T[:,:self.K]
NameError: name 'm' is not defined"

In mySSA, in embed, in several lines, there is a 'm', that is not defined. Could you tell me how to defined it ? Or at least explain what it does please ?

Thanks in advance

forecast_recurrent Error

Hey aj, how are you?

Trying to use ssa.forecast_recurrent() with my data I'm getting the message: "TypeError: exceptions must derive from BaseException." and if I run again my script, I'm getting: "AttributeError: 'mySSA' object has no attribute 'R'".

Do you have any idea about what are they?

Thanks!

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.