WhatsApp Chat Sentiment Analysis in R

Introduction to Time Series Analysis

Introduction to Time Series Analysis


Time series is a series of data points graphed in a time order. It is a series of data numerical data points in successive order. A time series can be taken on any variable that changes over time.


Time series analysis has been exploited for centuries. One evidence of time series analysis is astronomy wherein it was used to study the movement of planets. Generally, the data collected irregularly does not form a time series.

TIME SERIES ANALYSIS is the use of statistical methods to analyze the time series data end extract important data from the series and its characteristics. It can be applied to real-valued, continuous data, discrete numeric data, or discrete symbolic data like sequences of characters, such as alphabets of English language.

Time series analysis helps us understand the forces that can lead to a particular trend within the data thereby enabling us to forecast the data and also monitor it well. This can I turn help in fitting the data into appropriate models.

Types of time series analysis :


It is used to determine patterns and characteristics of the data by plotting a graph and using complex techniques.

Overall trends: it determines trends like increase or decrease of parameters related to the data.

Cyclic patterns: it determines seasonal effects that can impact the data.

Outliers: it determines the points of data that may be erroneous

Turning points: it determines the different trends within a particular data series


Also known as a frequency domain, a Spectral analysis is usually carried out I order to describe certain variations in a time series maybe be accounted for by cyclic components.

For example, when we look at the oceans, all we see is waves. However, these waves are a number of different frequencies. Here spectral analytics is determined by a height vs time basis to determine the frequencies that stand out as waves


This involves making predictions on future behavior with confidence by examining the current behavior and by making models. If a time series has behaved in a certain way in the past, we can easily determine how it will behave in future.

One example is tidal charts are generated by making predictions based on the height of the tides in past. ( ie previous day )


If there is a certain event that upon occurrence, can change a time series, intervention analysis will help us in explaining them. One way of explaining intervention analysis would be to explain whether a plant’s growth rate has changed by changing the amount of light, then we can say that the change in light is the event that has occurred resulting in a change in the time series ( ie. the growth rate ).


Using one or more variable time series, a mechanism that results in a dependent time series can be estimated. This type of analysis determines the relationship between two different time series data sets.

For Example, atmospheric pressure and seawater temperature affect sea level. All of these data are in time series and can relate how and to what degree pressure and temperature affect the sea level. Thus the two parameters here whose relationship can determine would be pressure and temperature.


Moving averages method

In the method of moving average, successive arithmetic averages are computed from overlapping groups of successive values of a time series.

least squares method

The method of least squares is used to fit linear as well as non-linear trends.

Freehand curve method

In this method, a time series graph is plotted by taking time on the x-axis and any other variable on the y-axis .the graph obtained will be irregular .we may observe either the up-down motion of a curve or a smooth curve. If a smooth curve is observed, it means that there are no oscillations or irregularities enlightening on the tendency of data. This is called a trend.

Methods of measurement of cyclical variation

Although the data variations are recurrent, seldom it is found that the data may have similar patterns in recurring oscillations or periods.

Various steps required for measurement of cyclical variation are:

1. Compute the trend values (T) and the seasonal indices(S) by using conventional methods.

Here S is obtained as a fraction.

2. Divide Y-values by the product of trend and seasonal index. This ratio would consist of the cyclical and random component.

C. R = Y / T. S

3. the random variations should be smoothened out by computing moving averages of C.R. values with an appropriate period. Weighted moving average with suitable weights may also be used.

Methods of measurement of seasonal variation

Method of simple average

This is the easiest method of studying seasonal variations. The idea of taking an average of data corresponding to the same period is to eliminate the effect of a random component and thus, the resulting averages consist of the only seasonal component.

Ratio to trend method

This method is used when then cyclical variations are absent from the data, i.e. the time series variable y of trend, seasonal and random components.

Ratio to moving average method

This method assumes that the time series is complete, ie, it contains all the components.

Method to link relatives method

This method is based on the assumption that trends have linear and cyclical variations. The link relatives method involves percentages of the current period as compared with the previous period.

Applications of Time Series Analysis :

1. Stock market analysis

2. Workload projections

3. Inventory related studies

4. Census analysis

5. Process control

6. Quality control

7. Economic Forecasting

8. Budgetary analysis

9. Sales Forecasting

10. Yield Projections