Skip to content

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

Notifications You must be signed in to change notification settings

geehaad/Time-Series_Different-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published