Coder Social home page Coder Social logo

geehaad / time-series_different-models Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 8.12 MB

understand Time series forecasting with different models in python, and fine tune the hyper-parameters to get the least possible error.

Jupyter Notebook 100.00%
python time-series fine-tuning arima cnn facebook-prophet forcasting

time-series_different-models's Introduction

Time-Series_Different-models

understand Time series forecasting with different models in python, and fine tune the hyper-parameters to get the least possible error.

The objective of this notebook is:

  1. In the first part: understand Time series forecasting with ARIMA model in python, and fine tune the hyper-parameters to get the least possible error.
  2. In the second part: Apply CNN from scratch to the same dataset.
  3. Apply Facebook prophet to the same dataset.

A. Time Series is a series of observations taken at specified time intervals usually equal intervals.

We don't need to apply Time series in atleast the following 2 cases:

  • a) The dependant variable(y) (that is supposed to vary with time) is constant.
    Eq: y=f(x)=4, a line parallel to x-axis(time) will always remain the same.
  • b) The dependant variable(y) represent values that can be denoted as a mathematical function.
    Eq: sin(x), log(x), Polynomials etc. Thus, we can directly get value at some time using the function itself. No need of forecasting.

There are 4 componentsof Time Series:

  • a) Trend - Upward & downward movement of the data with time over a large period of time. Eq: Appreciation of Dollar vs rupee.
  • b) Seasonality - seasonal variances. Eq: Ice cream sales increases in Summer only
  • c) Noise or Irregularity - Spikes & troughs at random intervals
  • d) Cyclicity - behavior that repeats itself after large interval of time, like months, years etc.

Why does Time Series(TS) need to be stationary?

It is because of the following reasons:

  • a) If a TS has a particular behavior over a time interval, then there's a high probability that over a different interval, it will have same behavior, provided TS is stationary. This helps in forecasting accurately.
  • b) Theories & Mathematical formulas ae more mature & easier to apply for as TS which is stationary.

Tests to check if a series is stationary or not

There are 2 ways to check for Stationarity of a TS:

  • a) Rolling Statistics - Plot the moving avg or moving standard deviation to see if it varies with time. Its a visual technique.
  • b) ADCF Test - Augmented Dickey–Fuller test is used to gives us various values that can help in identifying stationarity. The Null hypothesis says that a TS is non-stationary. It comprises of a Test Statistics & some critical values for some confidence levels. If the Test statistics is less than the critical values, we can reject the null hypothesis & say that the series is stationary. THE ADCF test also gives us a p-value. Acc to the null hypothesis, lower values of p is better.

time-series_different-models's People

Contributors

geehaad avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.