# Time Series Analysis

*Part 1- Introduction*

A series of articles covering the topic on *Time Series Analysis in Data science.*

## Time Series Analysis

**Introduction**

In most of the data analysis processing you might be dealing with time series data, i.e., data that has been recorded sequentially over a period of time. Time series data often arises when you have monitored processes such as sales over a period of time.

Two important attributes arise from this, **variable and time**. Time is an integral attribute about data collected in this case. In the case of the sales data, time would refer to when the sales were made in either, hourly, daily, monthly or annually.

Time series analysis is a way of analyzing sequential data points. In the process, analysts analyze data points at consistent intervals over a set period of time rather than random records.

**Applications of Time Series Analysis**

Time series analysis helps us **learn how we progress or how an entity progresses over time**. Let’s go back to the sales data; as a data analyst you will want to understand the different trends that might exist in that particular data or products in the business.

The analysis will show** the change in data over time and provide insights into such characters as seasonality, trend and levels.** These characters about the data can later be used to draw insights or predict the occurrences that might come up in future. Time series analysis therefore helps the business understand the cause of change in the sales or the data you are monitoring.

Time series analysis **helps track patterns over time and determine which areas need crucial focus and look into** thereby helping in preparation of these future events or business processes. It can also help determine which products might need change as showcased by their sales trends.

Time series analysis requires a large dataset to ensure that the series can be used to forecast or predict future data based on that historical data.

The visualizations that showcase the trends and patterns in the data guides the business to dig deeper into the business and the data to determine the causes for the changes.

Time series analysis is used on **non-stationary data**, i.e., data that is constantly changing over time. This makes it an important tool in such field as **finance, retail, and economic**. **Stock market analysis** is also another major field that utilizes the power of time series analysis to make excellent predictions and especially where automated trading algorithms are used. **Meteorologist** can also use time series analysis to predict the weather based on historical weather records.

There are however some challenges that might result from time series analysis. In cases of complex models, a lack of fitting might be experienced therefore making the models to fail to distinguish between random errors and true relationships. This makes the forecast incorrect.

## Definitions

**Time series data**- data recorded over consistent intervals of time e.g., daily, monthly, weekly or hourly etc.

**a. Cross-sectional data** — consist of several variable recorded at the same time.

**b. Pooled data**- a combination of both time series data and cross-sectional data.

**c. Seasonality/ seasonal variation** — refers to event that occur at specific and regular time intervals during the course of the year. Large datasets are therefore required in order to ensure that the patterns detected are not as a result of noise or outliers but as a result of the changes in the data, i.e., account for seasonal variance in the data

**d**. **Level **— it is the average value of the series.

**e. Trends analysis** — refers to determining the consistent movement in a certain direction. Two trends can be found, deterministic i.e., this is where we can find the underlying cause, and stochastic which is random and unexplainable.

**f. Functional analysis** can pick out patterns and relationships that exist within the data to identity visible events.

**g. Cyclical component **— these are fluctuations that occur around the trend line with a time duration between repetition or annual. It does not show a constant repetition or fluctuation thereby making it different from the seasonal variations. A good example would be the change that would occur in business metrics due to a recession or market crash.

**h. Noise or irregular component** — these are random uncorrelated changes that follow a normal distribution with a mean of zero and constant variance.

## Forecasting with time series.

Time series forecasting entails predicting the variables future value based on its own past values. An example would be forecasting stock price values or revenue of a product based on the past records on the same product or stock.

**Time series forecasting** is different from **Regression problem** in that when using regression **different independent feature** are used to evaluate or predict the value of the dependent target variable, an example would be predicting house prices using the area of the house, type of material, roofing and location. However, when it comes to **Time Series Forecasting**, there are no other independent feature and instead there is only past values of the same variable that we want to predict.

**Conclusion**

In general, time series analysis showcases the patterns allowing you to draw insights from the record data, as well as help the business plan for the future based on the insights from the historical and forecasted data trends. this makes it an important process in business cases.

Stay tuned for part 2- *Models used in Time Series Analysis.*