INTRODUCTION TO TIME SERIES..

Saurabhmirgane
6 min readOct 9, 2020

During the time of “Demonetization” the Futures on the S&P 500, had tumbled as much as 5 %, and the Mexican peso plummeted as much as 12 %, to a record low. but what exactly these terms are making us to think!! we were in the situation what is going to the future market performance, what is going to be the raise and fall of the stock, if the price fluctuates from the market moment ETC. But finally as say, for every problem their is a solution and that solution name is called Time Series.

“Prediction is very difficult, especially if it’s about the future.”

Only to solve this kind of issue, we come across with time series analysis which covers the detail study of future predictions. Let’s understand each and every concept of time series in detail.

What is time series?

A Time series is a sequence of data points in successive order, indexed by time. Which tracks the movement of the data points which are selected to check for a specific period of time.

The time series is always calculated, with the help of ‘Y ’which represents the yield time of particular year.

Yt, Yt-1,Yt-2, Yt-3,Yt-4,……is called time series.

  • Eg: Population of the country listed year-wise,
  • Temperature in the city listed by the hour,
  • Number of iPhones sold listed for each quarter

Goodness of Fit

  • MSE (Mean square error)
  • MAE (Mean absolute error)
  • RMSE (Root mean square error)
  • MAPE (Mean absolute percent error)
  • NMSE (Normalized mean square error)
  • NMAE (Normalized mean absolute error)
  • NMAPE (Normalized mean absolute percent error)

These are few error matrices which can help time series for better output.

Why One Requires Forecasting:-

The concept of forecasting deals with future predictions in different sectors/different areas.. This gives the estimation of what work need to be done for the next coming actions.. Typical Time Series can be linear or nonlinear function. Time series forecasting attempts to do same forecast just using the past data, without relying on any other external predictors like(xi ) best example goes with forecasting as follows:

Example1:-

Factors needed to forecast the next month’s stock price of Tata Motors.

— Current price ( yt)

—Current Sales, Revenue and profit data ( x1)

—Sales trend ( x2)

—Level debt carried by the company(x3)

— Competition(x4)

— Import/export rules(x5)

— Interest rate environment(x6)

— US/INR exchange rate(x7)

— Tax rates(x8)

— Crack down on black money? (x9)

— Cost of steel? (x10)

— Number of smart phones sold?(x11)

Since that we have understood about important points about timeseries, lets dive deep more about components of time series.

Components of Time Series:-

Trend:- The trend is normally referred to as the long-term movement in a cyclical context./ It captures the behavior of the Ups and downs of the market movement series over a time.

These are classified into 3 different categories those are:-

  • No Trend
  • Linear trend
  • Quadratic trend

No Trend:-
In the case where a time series doesn’t increase or decrease over time, it may instead randomly fluctuate around a constant value. In this case, the time series has no trend.

Linear Trend:- With a linear trend, the values of a time series tend to rise or fall at a constant rate, The following figure shows a time series with a positive linear trend. With this type of trend, the independent variable yt increases at a constant rate over time. (If a time series has a negative linear trend, the independent variable yt decreases at a constant rate over time.)

Quadratic Trend:-With a quadratic trend, the values of a time series tend to rise or fall at a rate that is not constant; it changes over time. As a result, the trend is not a straight line

Seasonality:-In Time Series data, seasonality is the presence of variations that occur at specific regular intervals less than a year, such as weekly, monthly, or quarterly. Seasonality may be caused by various factors, such as weather, vacation, and holidays, and consists of periodic, repetitive, and generally regular and predictable patterns in the levels of a time series.

Random component:-These are sudden changes occurring in a time series which are unlikely to be repeated. They are components of a time series which cannot be explained by trends, seasonal or cyclic movements. These variations are sometimes called residual or random components..

Quadratic fit with seasonality:

Plotting the fitted data-points separately for each quarter, shows how R manages to do such a good fit. Its basically fitting a quadratic line for each quarter with a different intercept.

Another Simple Way of Incorporating Seasonality

  • Take the trend prediction and actual prediction.
  • Depending on additive or multiplicative model compute the deviation and map it as seasonality effect for each prediction.

• Take averages of the seasonality value & Use this to make future predictions.

Issues with Regressing on Time

  • If there is no trend, or if seasonality, and fluctuations, are more important than trend, then the coefficients behave weirdly..
  • Historical data may not give a true picture of an underlying trend.
  • Long-term projections need more data to support them, and that may not always be available.
  • A major problem in forecasting trends involves identifying turning points.

Time Series Descriptive Statistics

  • In descriptive statistics covered earlier (central tendencies, measures of variability, skewness, kurtosis, distributions, correlations, etc.), the order of observations in the data was of no consequence.
  • In time series descriptive statistics, order of observations is of primary importance and so autocorrelations, etc. play a vital role in identifying the models and their characteristics.
  • Autocorrelation is a metric that allows us to understand the strength of order in the time-series Time Series Descriptive Statistics
  • In descriptive statistics covered earlier (central tendencies, measures of variability, distributions, correlations, etc.), the order of observations in the data was of no consequence.
  • In time series descriptive statistics, order of observations is of primary importance and so autocorrelations play a vital role in identifying the models and their characteristics

Summary:-

  • We learned about time series data, and the difference between trend, Seasonality, and Random component.
  • The constituent components that a time series may be decomposed into when performing an analysis.

Think Positive Be Creative gives the boosting to acquire deep knowledge one to become expert as an Data Scientist, grab the more relevant information about timeseries like,

Thank you.

--

--