Lecture 3 - Time Series Analysis - Lecturer
Lecture 3 - Time Series Analysis - Lecturer
APPLICATION (QHO430)
For example,
if data analyst predicts that sales will continue to fall, perhaps a new business
strategy is appropriate.
if salaries of the company’s current target market are
predicted to fall, perhaps a review of the product range or
a new potential market is necessary.
What is a time series data?
Time series are used to make forecasts (Predict).
Forecasting is ongoing
– as new information is received forecasts are updated
and decisions reviewed and modified.
Types of forecasting
In broad terms there are three types of forecasting.
1. Causal Forecasting
This looks at other variables which are influential.
Example: Using regression analysis and finding an equation giving predicted sales in
terms of advertising expenditure.
2. Projective forecasting
This only uses past values of the variable under consideration.
Example: Using time series of past sales to predict future sales.
3. Judgemental Forecasting
This occurs when there is no numerical data available. Example: Sales of a new product.
Frequency of time series data
A time series data can be collected
Every year Year 2010 2011 2012 2013
Profit (£m) by ABC ltd. 2.3 2.6 3.1 3.3
Every quarter
Quarter Quarter 1 Quarter 2 Quarter 3 Quarter 4
N° of tourists to the UK (million) 3.6 5.2 13.2 4.3
Every month
Month Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
Sale of milk (pint) 120 123 133 125 130 132 132 132 133 125 128 128
•Non-monetary
This data involves variables measured in non-monetary units such as N° of
units sold, N° of accidents, N° of members registered students, etc...
Quarter 2013 2014 2015 2016
N° of students recruited by a university 3487 2897 2777 2467
Types of forecasting
We will look at projective forecasting. Week Sales (1000s of litres)
1 17
Example: 2 21
3 19
The table shows the sales of petrol
4 23
over a 12-week period. 5 18
6 16
How could we predict the sales 7 20
for week 13? 8 18
9 22
What methods could we use? 10 20
. 11 15
12 22
Types of forecasting
•Naïve
One possibility could be to use the Week Sales (1000s of litres)
latest value as our forecast. 1 17
Forecast for week 13 = 22 (000 litres) 2 21
3 19
4 23
• Moving average 5 18
We could find the average of the most 6 16
recent values. 7 20
Forecast = Sum of most recent n values 8 18
n 9 22
Suppose we decided to take 10 20
the 3 most recent sales figures 11 15
12 22
Forecast for Week 13 = 20 + 15 +22
3
Forecast for Week 13 = 19 (000 litres)
Types of forecasting
•Weighted Moving Average Week Sales (1000s of litres)
We could decide that the most recent 1 17
sales figures were the most representative. 2 21
So we might choose different weights 3 19
for each data value 4 23
e.g 50% most recent, 5 18
30% second most recent 6 16
20% third most recent 7 20
8 18
Forecast for Week 13 9 22
Recall: 50% = 0.5 10 20
11 15
0.5 22 0.3 15 0.2 20
12 22
= 19.5 (000 litres)
Types of forecasting
Exponential Smoothing
This is a type of weighted moving average.
A smoothing constant (α) between 0 and 1 is chosen.
The larger the value of smoothing constant, the greater the weight on the most
recent figures.
The new forecast is given by:
Whether there is a regular pattern of seasonal variations, and if so, over how many
periods they repeat
Upward Trend
Constant with
seasonal
variation
We can see that earnings (in current prices) are increasing over the years (as they should be), at a
particular rate.
If we want to find the trend for earnings, we want to find the model that best fit.
But first thing first – Draw a line graph on Excel.
Annual time series – Line graph in Excel
The line graph is easy to draw on Excel. To do this quickly, we need to go through the following steps:
The demand for coffee is fairly constant at around 200 drinks per day except on Fridays where demand increases to
300 drinks. The regular jump in numbers on Fridays is called the seasonality – Regular pattern.
Trend of the daily time series
The trend (blue dotted line) is fairly flat as it is represented by the 6 points moving averages (see trendline).
First, click anywhere (any cell) on the time series data (For example this cell).
Click on Data → Forecast Sheet →Create.
Note: This Excel facility may not be available for Apple users.
Predicting time series with trend and seasonality – Graphically
What does the following output represent?
Start of prediction
Historical data
Predictions
Time series data – Quarterly
Quarterly data is data that is published 4 times a year
(every three month).
Example:
Number of visits to a Museum.
Note: The trend is downward (over the years) and the seasonality is regular every 4 seasons
Time series data – Trend
To predict the trend for this quarterly time series, we need to use the “Moving Average” with 4 point period.
Time series data – Predictions
The predictions are obtained using the Excel “Forecast Sheet” facility (See previous slide).
Time series data – Numerical predictions
The numerical predictions are
also obtained using the
“Forecast Sheet” option.
•Ensure you make time to learn what the ONS can offer you, and perhaps your employer (now or in the
future too)
Extra Reading - Inflation
Inflation is the measure of how much goods
and services rise and fall over time –
https://www.ons.gov.uk/economy/
inflationandpriceindices/timeseries/cdko/mm23
The government uses a notional basket of
good to represent everything that we spend
our money on. They collect over 700 prices
every month is places all around the country to
gauge how prices change for the goods that
represent our current way of life.
This basket is not static and changes over
time. It should reflect what individuals pay for
and includes travel and services such as
mobile, internet etc