What is Time Series?
What is Time Series?
A time series is a set of numerical values of some variable obtained at regular
period overtime. The series is usually tabulated or graphed in a manner that
readily conveys the behaviour of the variable under study.
Figure 1, Table 1 (slide no 3) presents the export of cement (in tonnes) by a
cement company between 1994 and 2004. The graph suggests that the series
is time dependent. The management of the company is interested in
determining how the series is dependent on time and in developing a means
of predicting future levels with some degree of reliability. The nature of the
time dependence is often analysed by decomposing the time series into its
components.
1
What is Time Series?
Table 1
2
What are Objectives of Time Series?
1) Identify the Pattern: One of the objective of time-series analysis is to
identify the pattern and isolate the influencing factors (or effects) for
prediction purposes as well as for future planning and control.
2) Ongoing Review of Progress Made: Time series is used for evaluation of
progress made. For example, time series is used for review of the progress
of our Five-Year Plans.
3
What are Objectives of Time Series?
1) Identify the Pattern: One of the objective of time-series analysis is to
identify the pattern and isolate the influencing factors (or effects) for
prediction purposes as well as for future planning and control.
2) Ongoing Review of Progress Made: Time series is used for evaluation of
progress made. For example, time series is used for review of the progress
of our Five-Year Plans.
4
What are Components of Time Series?
The time-series data contain four components: trend, cyclicality, seasonality
and irregularity. Not all time-series have all these components. Figure 2 (this
slide) shows the effects of these time-series components over a period of
time.
1) Trends: Trend Sometimes a time-series displays a steady tendency of either
upward or downward movement in the average (or mean) value of the forecast
variable y over time. Such a tendency is called a trend. When observations are
plotted against time, a straight line describes the increase or decrease in the
time series over a period of time. 5
What are Components of Time Series?
Cycles: Cycles An upward and downward movement in the variable value
about the trend time over a time period are called cycles. A business cycle
may vary in length, usually more than a year but less than 5 to 7 years. The
movement is through four phases: from peak (prosperity) to contradiction
(recession) to trough (depression) to expansion (recovery or growth) as shown
in Fig.
6
What are Components of Time Series?
Seasonal It is a special case of a cycle component of time series in which
fluctuations are repeated usually within a year (e.g. daily, weekly, monthly,
quarterly) with a high degree of regularity. For example, average sales for a
retail store may increase greatly during festival seasons.
Irregular: Irregular variations are rapid charges or bleeps in the data caused by
short term unanticipated and non-recurring factors. Irregular fluctuations can
happen as often as day to day
7
What are Smoothing Methods?
The objective of smoothing methods into smoothen out the random variations
due to irregular components of the time series and thereby provide us with an
overall impression of the pattern of movement in the data over time. In this
section, we shall discuss three smoothing methods:
(i) Moving averages
(ii) Weighted moving averages
(iii) Semi-averages
(iv) Exponential Smoothing
(v) Method of Least Squares
8
What are Smoothing Methods?
(i) Moving Averages: If we attempt to observe the movement of some variable
values over a period of time and try to project this movement into the future,
then it is essential to smooth out first the irregular pattern in the historical
values of the variable, and later use this as the basis for a future projection.
This can be done by using the technique of moving averages.
A moving average is a technique that calculates the overall trend in a data set
from historical data. This technique is very useful for forecasting short-term
trends. It is simply the average of a select set of time periods. It's called
'moving' because as a new demand number is calculated for an upcoming time
period; the oldest number in the set falls off, keeping the time period locked.
9
What are Smoothing Methods?
Moving Averages (continued): Let's look at an example of how the sales
manager at ABC Inc. will forecast demand using the moving average formula.
The formula is illustrated as follows:
Moving Average = (n1 + n2 + n3 + ...) / n
Where n = the number of time periods in the data set. The sum of the first
time period and all Simple Moving Averages
If the observed values of a variable Y are y1,y2,⋯,yn corresponding to the time
periods t1,t2,⋯,tn, respectively, the k-period simple moving averages are
defined as
10
What are Smoothing Methods?
Moving Averages (continued):
where a1,a2,⋯,am is the sequence Example: 3 period simple moving
of k-period simple moving average
averages.
11
What are Smoothing Methods?
Example: Shown is production volume (in ’000 tonnes) for a product. Use these
data to compute a 3-year moving average for all available years. Also determine
the trend and short-term error.
Moving Averages (continued):
12
What are Smoothing Methods?
Moving Averages (continued):
Solution: The first average is computed for the first 3 years as follows:
Moving average (year 1–3) =
The first 3-year moving average can be used to forecast the production
volume in fourth year, 1998. Because 25,000 tonnes production was made in
1998, the error of the forecast is Error1998 = 25,000 – 22,000 = 3000 tonnes.
Similarly, the moving average calculation for the next 3 years is:
Moving average (year 2–4) =
A complete summary of 3-year moving average calculations is given in Table (next
slide) 13
What are Smoothing Methods?
(ii) Weighted Moving Averages: In moving averages, each observation is given
equal importance (weight). However, it may be desired to place more weight
(importance) on certain periods of time than on others. So a moving average in
which some time periods are weighted differently than others is called a
weighted moving average. In such a case different values may be assigned to
compute a weighted average of the most recent n values. Choice of weights is
somewhat arbitrary because there is no set formula to determine them. In
most cases, the most recent observation receives the most weightage, and the
weight decreases for older data values.
A weighted moving average is computed as:
14
What are Smoothing Methods?
Weighted Moving Averages (continued)
Example: Vacuum cleaner sales for 12 months is given below. The owner of the
supermarket decides to forecast sales by weighting the past three months as
follows:
15
What are Smoothing Methods?
Weighted Moving Averages (continued)
16
What are Smoothing Methods?
Weighted Moving Averages (continued)
Example: A food processor uses a moving average to forecast next month’s
demand. Past actual demand (in units) is shown below:
a) Compute a simple five-month moving average to forecast demand for
month 52.
b) (b) Compute a weighted three-month moving average where the weights
are highest for the latest months and descend in order of 3, 2, 1.
17
What are Smoothing Methods?
Weighted Moving Averages (continued)
Example: A food processor uses a moving average to forecast next month’s
demand. Past actual demand (in units) is shown below:
a) Compute a simple five-month moving average to forecast demand for
month 52.
b) (b) Compute a weighted three-month moving average where the weights
are highest for the latest months and descend in order of 3, 2, 1.
18
What are Smoothing Methods?
Weighted Moving Averages (continued)
Solution: Calculations for five-month moving average are shown in Table.
19
What are Smoothing Methods?
Weighted Moving Averages (continued)
20
What are Smoothing Methods?
(iii) Semi-Average Method
❑ The semi-average method permits us to estimate the slope and intercept of
the trend line quite easily if a linear function will adequately describe the
data.
❑ The procedure is simply to divide the data into two parts and compute their
respective arithmetic means. These two points are plotted corresponding to
their midpoint of the class interval covered by the respective part and then
these points are joined by a straight line, which is the required trend line.
❑ The arithmetic mean of the first part is the intercept value, and the slope is
determined by the ratio of the difference in the arithmetic mean of the
number of years between them, that is, the change per unit time. The
resultant is a time series of the form : yො = a + bx.
21
What are Smoothing Methods?
(iii) Semi-Average Method (continued)
❑ The 𝑦ො is the calculated trend value and a and b are the intercept and slope
values respectively. The equation should always be stated completely with
reference to the year where x = 0 and a description of the units of x and y.
Example : Fit a trend line to the following data by the method of semi-
average and forecast the sales for the year 2002.
22
What are Smoothing Methods?
(iii) Semi-Average Method (continued)
❑ Solution: Since number of years are odd in number, therefore divide the
data into equal parts (A and B) of 3 years ignoring the middle year (1996).
The average of part A and B is
Part A is centred upon 1994 and part B on 1998. Plot points 107 and 112 against
their middle years, 1994 and 1998. By joining these points, we obtain the
required trend line as shown Fig. 16.6. The line can be extended and be used for
prediction 23
What are Smoothing Methods?
(iii) Semi-Average Method (continued)
To calculate the time-series Type equation here. 𝑦ො = a + bx, we need
24
What are Smoothing Methods?
(iv) Exponential Smoothing Method
Exponential smoothing is a type of moving-average forecasting technique which
weighs past data from previous time periods with exponentially decreasing
importance in the forecast so that the most recent data carries more weight in
the moving average.
Simple Exponential Smoothing
With simple exponential smoothing, the forecast is made up of the actual value
for the present time period Xt multiplied by a value between 0 and 1 (the
exponential smoothing constant, referred to as α) plus the product of the
present time period forecast Ft and (1 – α). The formula is stated algebraically as
follows:
25
What are Smoothing Methods?
(iv) Exponential Smoothing Method (continued)
The past data for the demand of a product is given as below:
Month Demand
Jan, 2013 584
Feb, 2013 610
Mar, 2013 655
Apr, 2013 747
May, 2013 662
June, 2013 913
Jul,2013 963
If the time-series exponential smoothing function used to forecast the next month’s
demand. Compute the forecast for Aug 2013. Use exponential smoothing coefficient =
0.33
What are Smoothing Methods?
(iv) Exponential Smoothing Method (continued)
Forecast for period ‘t using exponential smoothing method is given as
follows:
Ft = Ft-1 + x (At-1 – Ft-1 )
Forecast for Aug 2013 is calculated as follows:
FAug = FJul + ( Ajul – Fjul) = FJul + a ( 963 – FJul) ;
We do not have forecast for the month of Jul. To arrive at Forecast for
the month of July. To overcome this start from the forecast for a
previous period. Here we start with the forecast for the month of Feb,
2013. Assuming, forecast for Feb, 2013 is assumed to be the same as
Actual for Jan = 584.
What are Smoothing Methods?
(iv) Exponential Smoothing Method (continued)
Then we apply formula for forecast using exponential smoothing
method and work successively for future periods.
What are Smoothing Methods?
The method of least squares from regression analysis is used to find the
trend line of best fit to a time series data. The regression trend line (y) is
defined by the following equation. 𝑦ො = a + bx where 𝑦ො = predicted value of the
dependent variable a = y-axis intercept, b = slope of the regression line (or
the rate of change in y for a given change in x), x = independent variable
(which is time in this case)
29
What are Smoothing Methods?
The trend line of best fit has the properties that (i) the summation of all
vertical deviations about it is zero, that is, Σ (y – ˆy) = 0, (ii) the summation of
all vertical deviations squared is a minimum, that is, Σ (y – ˆy) is least, and (iii)
the line goes through the mean values of variables x and y. For linear
equations, it is found by the simultaneous solution for a and b of the two
normal equations:
30
What are Smoothing Methods?
31
What are Smoothing Methods?
32
What are Smoothing Methods?
33