Professional Documents
Culture Documents
Time Series (Autosaved)
Time Series (Autosaved)
Syllabus
• Time Series Data
• Components of time series
• Additive and Multiplicative models.
• Trend analysis, fitting of trend using principle of least squares- linear
second-degree parabola
• Shifting of origin and Conversion of annual linear trend equation to
quarterly/monthly basis and vice-versa
Time Series Analysis
• Time Series analysis is one of the statistical methods used to determine
the patterns in data collected for a period of time.
• One can also identify the regular or irregular occurrence of any
specific feature over a time period in a time series data.
• Most of the time series data relates to fields like Economics, Business,
Commerce, etc
• For example Production of a product, Cost of a product, Sales of a
product, National income, Salary of an individual, etc..
• By close observation of time series data, one can predict and plan for
future operations in industries and other fields.
Time Series
• Time series is different from more traditional classification and regression
predictive modeling problems.
• A time series is a collection of data points gathered over a period of time
and ordered chronologically.
• If you were to plot the points of time series data on a graph, and one of
your axes would always be time.
• Time series metrics refer to a piece of data that is tracked at an increment
in time. For instance, a metric could refer to how much inventory was sold
in a store from one day to the next.
• Time series analysis involves inferring what has happened to a series of
data points in the past and attempting to predict future values.
• Analyzing time series data allows for extracting meaningful statistics and
other data characteristics
Examples of time series analysis
• Rainfall measurements
• Stock prices
• Annual retail sales
• Monthly subscribers
• Heartbeats per minute
• Annual production of a crop
Example
Example
Time series data can be classified into two
types:
• Measurements gathered at regular time intervals (metrics)
Such analysis requires identifying the pattern of an observed time
series data set. Once the pattern is established, it can be interpreted,
integrated with other data, and used for forecasting
• Measurements gathered at irregular time intervals (events)
Because they happen at irregular intervals, events are unpredictable
and cannot be modeled or forecasted since forecasting assumes that
whatever happened in the past is a good indicator of what will happen
in the future.
Components of Time Series
It is the simplest and most flexible method for estimating a trend. Procedure:
(a) Plot the time series data on a graph.
(b) Draw a freehand smooth curve joining the plotted points.
(c) Examine the direction of the trend based on the plotted points.
(d) Draw a straight line which will pass through the maximum number of plotted
points.
Example 1
Example 1
Merits and Demerits
• Simple and doesn’t require any mathematical calculations.
• The trend drawn by the freehand method can be extended to predict
the future values of the given data.
• However, this method is subjective in nature, predictions obtained by
this method depends on the personal bias and judgement of the
investigator handling the data.
Method of Semi-Averages
• In this method, the semi-averages are calculated to find out the trend
values.
Procedure
(i) The data is divided into two equal parts. In case of odd number of data,
two equal parts can be made simply by omitting the middle year.
(ii) The average of each part is calculated, thus we get two points.
(iii) Each point is plotted at the mid-point (year) of each half.
(iv) Join the two points by a straight line.
(v) The straight line can be extended on either side.
(vi) This line is the trend line by the methods of semi-averages.
Example 2
Example 2
Example 3
Example 3
Merits and Demerits
• Its objective
• The future values can be predicted.
• Easy to understand and apply
• The trend values obtained by this method and the predicted values are not precise.
This is because it depends on mean which is affected by extreme values. If
extreme values are present in either half or both halves of the series, then the trend
line does not give the true picture of the growth factor.
Method of Moving Averages
• In this method, we take arithmetic mean of the values for a certain time
span.
• The time span can be three-years, four -years, five- years and so on
depending on the data set and our interest.
Procedure
(i) Decide the period of moving averages (three- years, four -years).
(ii) In case of odd years, averages can be obtained by calculating,
(v) If the moving average is an even number, the average of first four values
will be placed between 2 nd and 3rd year, similarly the average of the second four
values will be placed between 3rd and 4th year. These two averages will be again
averaged and placed in the 3rd year. This continues for rest of the values in the
problem. This process is called as centering of the averages.
Example 4
Example 4
Example 5
Example 5
Year 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005
Sales(Rs 5 3 7 6 4 8 9 10 8 9 9
in lakhs)
Merits and Demerits
• Its objective.
• Moving Averages Method gives a trend with a fair degree of accuracy.
• Trend values can not be computed for all the years. Some trend values
have to sacrificed at the beginning and at the end.
• The selection of the period of the moving average is not objective.
Method of Least Squares
• The line of best fit is a line from which the sum of the deviations of various points
is zero.
• This is the best method for obtaining the trend values.
• It gives a convenient basis for calculating the line of best fit for the time series.
• It is a mathematical method for measuring trend.
• Further the sum of the squares of these deviations would be least when
compared with other fitting methods. So, this method is known as the Method of
Least Squares and satisfies the following conditions:
(i) The sum of the deviations of the actual values of Y and Ŷ (estimated value of
Y) is Zero. that is Σ(Y–Ŷ) = 0.
(ii)The sum of squares of the deviations of the actual values
of Y and Ŷ (estimated value of Y) is least, that is, Σ(Y–Ŷ)2 is least
Procedure
(i) The straight line trend is represented by the equation Yc = a + bX …(1)
where Yc are the trend values, X is time measured from origin or midpoint, a
and b are constants
(ii) The constants ‘a’ and ‘b’ are estimated by solving the following two normal
Equations ΣY = n a + b ΣX ...(2)
ΣXY = a ΣX + b ΣX2 ...(3)
Where ‘n’ = number of years given in the data.
(iii) By taking the mid-point of the time as the origin, we get ΣX = 0
(iv) When ΣX = 0 , the two normal equations reduces to
The constant ‘a’ gives the mean of Y and ‘b’ gives the rate of change (slope).
(v) By substituting the values of ‘a’ and ‘b’ in the trend equation (1), we get the Line
of Best Fit.
Example 6
Example 5
Example 6
Example 6
Example 7
• Below are the figures of production of a factory (in’000 tons) in sugar
factory:
• Fit a straight line trend by the method of least squares and show the trend
values
• Show the trend on the graph
• What is monthly increase in production?
• Find out short period fluctuations for the given years using additive model
• Eliminate trend by using multiplicative model
Example 8/22
The linear trend of sales of a company is rs 650000 in 2014 and it rises
by 16500 per year
i. Write down the trend equation
ii. If the company knows that its sales in 2017 will be 10% below the
forecasted trend sales, find its expected sales in 2017
Merits
• Given the mathematical form of the trend to be fitted, the least squares method is
an objective method.
• Unlike the moving average method, it is possible to compute trend values for all
the periods and predict the value for a period lying outside the observed data.
• The results of the method of least squares are most satisfactory because the fitted
trend satisfies the two most important properties, i.e. (1) 𝑦0 − 𝑦𝑡 =0
And (2) 𝑦0 − 𝑦𝑡 2 is minimum
Here 𝑦0 denotes the observed values and 𝑦t denotes the calculated trend value.
Demerits
• It is cumbersome method.
• It is not flexible like the moving average method. If some observations
are added, then the entire calculations are to be done once again.
• Since the choice of a particular trend is arbitrary, the method is not,
strictly, objective. (care needs to be exercised to select the type of
trend curve)
FITTING OF PARABOLIC TREND
• Linear trend appropriate in cases where the variable changes by
almost equal amounts and therefore the movements are nearly in a
straight line.
• In case the changes in the variable vary at an approximately constant
rate, a curvilinear trend is appropriate. A quadratic trend equation is
used and its graph is called a second degree parabola.
FITTING OF PARABOLIC TREND
• This are the three equations to find the value of constants a, b and c.
Example
Solution
Example
• Given the data
Year 2006 2007 2008 2009 2010 2011 2012
Sales in 21 21 30 29 62 68 91
lacs
Yc=25+2(X+3)=33+2X
Example
• Given the quarterly trend equation for sales(in Rs thousand) of a
commodity: Yc=65+3.6X
• Origin: First quarter of 2002, X unit=one quarter Y unit= average
quarterly sales.
• Shift the origin to 1st July 2002
Example
• Given the quarterly trend equation for sales(in Rs thousand) of a
commodity: Yc=65+3.6X
• Origin: First quarter of 2002, X unit=one quarter Y unit= average
quarterly sales. Shift the origin to 1st July 2002
• Solution
• Yc=65+3.6(X+1.5)
=70.4+3.6X
Origin: 1st July 2002, X=one quarter Y= average quarterly sales
Conversion of trend equations
• By conversion of a trend equation, we mean the change of trend
equation formulated on one type of time basis into a trend equation
on another type of time basis.
• Thus, if a trend equation of yearly period is transformed into a trend
equation of monthly or quarterly period, or vice versa, it will be called
conversion of a trend equation.
Methods of Conversion
The following methods are to be adopted for converting a given trend
equation into a required trend equation:
(i) To convert an annual trend equation into a monthly trend equation :
Divide a by 12, bX, by 12 x 12 (or 144), cX², by 12 × 12 × 12 (or 1728) and
so on.
(ii) To convert a monthly trend equation into an annual trend equation.
Multiply a by 12, bX by 12 × 12, cX² by 12x12× 12 (or 1728) and so on.
(iii) To convert an annual trend equation into a Quarterly trend equation :
Divide a by 4, bX by 4 × 4 (or 16), cX², by 4 × 4 x 4(or 64) and so on.
(iv) To convert a quarterly trend equation into an annual trend equation :
Multiply a by 4, bX by 4 × 4and cX², by 4 × 4 x 4 and so on.
Example
iii. Find the value of Y for July 2013 on the basis of (ii)
Y=1.5433+0.114(12.5)=1.6858
Example
Example
Example
• Given the following equation
• Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
Convert the above equation
i. To monthly trend equation with January 2007 as origin and
estimate sales for March 2007
ii. To quarterly trend equation with first quarter, 2007 as origin and
estimate sales for third quarter of 2007
Example
• Given the following equation
• Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
Convert the above equation
i. To monthly trend equation with January 2007 as origin and estimate
sales for March 2007
Yc=372/12+288X/144 (monthly trend equation)
Yc=31+2X
Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
Yc=31+2(X+6.5)=44+2X
Origin: 15 Jan 2007, X unit=1 month, Y unit =monthly sales
Sales for March 2007: 44+2(2)= 48
Example
• Given the following equation
• Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
Convert the above equation
ii. To quarterly trend equation with first quarter, 2007 as origin and
estimate sales for third quarter of 2007
Yc=372/4+288X/16 =93+18X (Quarterly trend equation)
Origin:1st July 2006, X unit=1 quarter, Y unit =quarterly sales
Yc=93+18(X+2.5)=138+18X
Origin:First quarter 2007, X unit=1 quarter, Y unit =quarterly sales
Yc=138+18(2)= 174 (third quarter of 2007)
Example: Obtain monthly trend equation
Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
• Origin:2006, X unit=1 year, Y unit= Average monthly sales
• Origin:2006, X unit=1/2 year, Y unit =Annual sales
• Origin:2006, X unit=1/2 year, Y unit= Average monthly sales
Example: Obtain monthly trend equation
Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
• Origin:2006, X unit=1 year, Y unit= Average monthly sales
• Origin:2006, X unit=1/2 year, Y unit =Annual sales
• Origin:2006, X unit=1/2 year, Y unit= Average monthly sales
Example: Shift also to a month
Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
• Yc=372/12+288X/144
• Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
• Origin:2006, X unit=1 year, Y unit= Average monthly sales
• Yc=372+288X/12
• Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
• Origin:2006, X unit=1/2 year, Y unit =Annual sales
• Yc=372/12+288X/6 x 12
• Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
• Origin:2006, X unit=1/2 year, Y unit= Average monthly sales
• Yc=372+288X/6
• Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
Example: Shift to a month
Yc=372+288X
• Origin:2006, X unit=1 year, Y unit =Annual sales
• Yc=372/12+288X/144 =31+2X
• Origin: 1 July 2006, X unit=1 month, Y unit =monthly sales
• Yc= 31+2(X+0.5)=32+2X
• Origin: 15 July 2006, X unit=1 month, Y unit =monthly sales
Example
• Given monthly trend equation
• Yc=130+1.8X
• Origin: 1/7/2002, X unit=1 month, Y unit=monthly sales
Convert into annual trend equation
Example
• Given monthly trend equation
• Yc=130+1.8X
• Origin: 1/7/2002, X unit=1 month, Y unit=monthly sales
Convert into annual trend equation