Which of the following do you think is an example of a time series? Even if you don’t know, try making a guess.
Time Series is generally data that is collected over time and is dependent on it.
Here we see that the count of cars is independent of time, hence it is not a time series. While the CO2 level increases with respect to time, hence it is time series.
Let us now look at the normal definition of Time Series.
A series of data points collected in time order is known as a time series. Most of the business houses work on time series data to analyze sales numbers for the next year, website traffic, count of traffic, a number of calls received, etc. Data of a time series can be used for forecasting.
Not every day collected with respect to time represents time series.
Some of the examples of the time series are :
Stock Price :
Passenger Count of an airline:
Temperature over Time:
A number of visitors in a hotel :
Now that we can differentiate between a Time Series and a non-Time Series data, let us explore Time Series further.
Now as we have an understanding of what a time series is and the difference between a time series and a non-time series, let’s now look at the components of a time series.
Components of a Time Series
- Trend: Trend is a general direction in which something is developing or changing. So we see an increasing trend in this time series. We can see that the passenger count is increasing with the number of years. Let’s visualize the trend of a time series:
Example
Here the red line represents an increasing trend of the time series.
2.Seasonality: Another clear pattern can also be seen in the above time series, i.e., the pattern is repeating at a regular time interval which is known as the seasonality. Any predictable change or pattern in a time series that recurs or repeats over a specific time period can be said to be seasonality. Let’s visualize the seasonality of the time series:
Example
We can see that the time series is repeating its pattern every 12 months i.e there is a peak every year during the month of January and a trough every year in the month of September, hence this time series has a seasonality of 12 months.
Difference between a time series and regression problem
Here you might think that as the target variable is numerical it can be predicted using regression techniques, but a time series problem is different from a regression problem in the following ways:
- The main difference is that a time series is time-dependent. So the basic assumption of a linear regression model that the observations are independent doesn’t hold in this case.
- Along with an increasing or decreasing trend, most Time Series have some form of seasonality trends,i.e. variations specific to a particular time frame.
So, predicting a time series using regression techniques is not a good approach.
Time series analysis comprises methods for analyzing time-series data in order to extract meaningful statistics and other characteristics of the data. Time series forecasting is the use of a model to predict future values based on previously observed values.