Chapter 1: Introduction to
forecasting
Instructor: Truong Buu Chau
Email: truongbuuchau@[Link]
Faculty of Mathematics and Statistics
December 3, 2023
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 1 / 15
Contents
1 Introduction to forecasting
2 Forecasting data and methods
3 The basic steps in a forecasting task
4 Forecasting using R
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 2 / 15
1. Introduction to forecasting
1 What is forecasting?
Determining future events based on historical facts and
data.
2 Some thoughts on forecasts
I Forecasts tend to be wrong!
I Forecasts can be biased! (Marketing, Sales, etc.)
I Forecasts tend to be better for near future.
3 Why forecasting?
Better to have "Educated guess" about future than to
not forecast at all!
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 3 / 15
1. Introduction to forecasting
Forecasting is about predicting the future as accurately as
possible, given all of the information available, including
historical data and knowledge of any future events that
might impact the forecasts.
Goals are what you would like to have happen. Goals
should be linked to forecasts and plans, but this does not
always occur. Too often, goals are set without any plan for
how to achieve them, and no forecasts for whether they are
realistic.
Planning is a response to forecasts and goals. Planning
involves determining the appropriate actions that are
required to make your forecasts match your goals.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 4 / 15
1. Introduction to forecasting
Modern organisations require:
Short-term forecasts are needed for the scheduling of
personnel, production and transportation. As part of the
scheduling process, forecasts of demand are often also
required.
Medium-term forecasts are needed to determine future
resource requirements, in order to purchase raw materials,
hire personnel, or buy machinery and equipment.
Long-term forecasts are used in strategic planning. Such
decisions must take account of market opportunities,
environmental factors and internal resources.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 5 / 15
2. Forecasting data and methods
How to forecast?
The appropriate forecasting methods depend largely on
what data are available.
Quantitative methods: Sufficient quantitative
information is available.(Time series, explanatory)
Based on data (Objective)
1. numerical information about the past is available
2. it is reasonable to assume that some aspects of the past patterns will
continue into the future.
Qualitative methods: Little or no quantitative
information is available, but sufficient qualitative
knowledge exists.
Based on educated opinion and judgment (Subjective).
These methods are not purely guesswork-there are well-developed structured
approaches to obtaining good forecasts without using historical data.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 6 / 15
2. Forecasting data and methods
Most quantitative prediction problems use either time series
data or cross-sectional data.
Times series data is a set of data (or a sequence of
data points) which collected at regular intervals such as
daily, weekly, annually.
Examples of time series data include:
I Daily IBM stock prices
I Monthly rainfall
I Quarterly sales results for Amazon
I Annual Google profits
Cross-sectional data is data which collected at the
same point of time. Analysis of cross-sectional data
usually consists of comparing the differences among the
subjects (such as individuals, firms, countries, or
regions).
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 7 / 15
3. The basic steps in a forecasting task
A forecasting task usually involves five basic steps.
Step 1: Problem definition.
Step 2: Gathering information.
Step 3: Preliminary (exploratory) analysis.
Step 4: Choosing and fitting models.
Step 5: Using and evaluating a forecasting model.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 8 / 15
3. The basic steps in a forecasting task
Step 1: Problem definition.
Often this is the most difficult part of forecasting.
Defining the problem carefully requires an understanding
of the way the forecasts will be used, who requires the
forecasts, and how the forecasting function fits within
the organisation requiring the forecasts.
A forecaster needs to spend time talking to everyone
who will be involved in collecting data, maintaining
databases, and using the forecasts for future planning.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 9 / 15
3. The basic steps in a forecasting task
Step 2: Gathering information.
There are always at least two kinds of information
required: (a) statistical data, and (b) the accumulated
expertise of the people who collect the data and use the
forecasts.
Often, it will be difficult to obtain enough historical
data to be able to fit a good statistical model.
Occasionally, old data will be less useful due to
structural changes in the system being forecast; then we
may choose to use only the most recent data.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 10 / 15
3. The basic steps in a forecasting task
Step 3: Preliminary (exploratory) analysis.
Always start by graphing the data.
Are there consistent patterns?
Is there a significant trend?
Is seasonality important?
Is there evidence of the presence of business cycles?
Are there any outliers in the data that need to be
explained by those with expert knowledge?
How strong are the relationships among the variables
available for analysis?
Various tools have been developed to help with this analysis.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 11 / 15
3. The basic steps in a forecasting task
Step 4: Choosing and fitting models.
The best model to use depends on the availability of
historical data, the strength of relationships between
the forecast variable and any explanatory variables, and
the way in which the forecasts are to be used.
It is common to compare two or three potential models.
Each model is itself an artificial construct that is based
on a set of assumptions (explicit and implicit) and
usually involves one or more parameters which must be
estimated using the known historical data.
We will discuss regression models, exponential
smoothing methods, Box-Jenkins ARIMA models, and
several advanced methods including neural networks
and vector autoregression.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 12 / 15
3. The basic steps in a forecasting task
Step 5: Using and evaluating a forecasting model.
Once a model has been selected and its parameters
estimated, the model is used to make forecasts.
The performance of the model can only be properly
evaluated after the data for the forecast period have
become available.
A number of methods have been developed to help in
assessing the accuracy of forecasts.
When using a forecasting model in practice, numerous
practical issues arise such as how to handle missing
values and outliers, or how to deal with short time
series.
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 13 / 15
Statistical forecasting
Thing to be forecast: a random variable, yt .
Forecast distribution: If I is all observations, then yt |I
means "the random variable yt given what we know in I".
The "point forecast" is the mean (or median) of yt |I
The "forecast variance" is var[yt |I].
A prediction interval or "interval forecast" is a range of
values of yt with high probability.
With time series, yt|t−1 = yt |{y1 , y2 , . . . , yt−1 }.
ŷT +h|T = E[yT +h |y1 , . . . , yT ] (an h-step forecast taking
account of all observations up to time T ).
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 14 / 15
Forecasting using R
Free and online
Data sets in associated R package ’fpp2’
R code for examples
R RStudio
Truong Buu Chau C03043 - Chapter 1 December 3, 2023 15 / 15