103
1. Introduction to forecasting OTexts.org/fpp/1/ OTexts.org/fpp/2/3 Forecasting: Principles and Practice 1 Rob J Hyndman Forecasting: Principles and Practice

Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Embed Size (px)

Citation preview

Page 1: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

1. Introduction to forecasting

OTexts.org/fpp/1/OTexts.org/fpp/2/3

Forecasting: Principles and Practice 1

Rob J Hyndman

Forecasting:

Principles and Practice

Page 2: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Resources

Slides

Exercises

Textbook

Useful links

robjhyndman.com/uwa

Forecasting: Principles and Practice 2

Page 3: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Outline

1 Introduction

2 Some case studies

3 Time series data

4 Some simple forecasting methods

Forecasting: Principles and Practice Introduction 3

Page 4: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 5: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 6: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 7: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 8: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 9: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 10: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 11: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer sales

Page 12: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Brief bio

Forecasting: Principles and Practice Introduction 4

Director of Monash University’sBusiness & EconomicForecasting Unit

Editor-in-Chief, InternationalJournal of Forecasting

How my forecasting methodology is used:

Pharmaceutical Benefits Scheme

Cancer incidence and mortality

Electricity demand

Ageing population

Fertilizer salesrobjhyndman.com

Page 13: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Poll: How experienced are you in forecasting?

1 Guru: I wrote the book, done it for decades,now I do the conference circuit.

2 Expert: It has been my full time job for morethan a decade.

3 Skilled: I have been doing it for years.

4 Comfortable: I understand it and have done it.

5 Learner: I am still learning.

6 Beginner: I have heard of it and would like tolearn more.

7 Unknown: What is forecasting? Is that what theweather people do?

Forecasting: Principles and Practice Introduction 5

Page 14: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Key reference

Hyndman, R. J. & Athanasopoulos, G.

(2013) Forecasting: principles and

practice.

otexts.org/fpp/

Free and online

Data sets in associated R package

R code for examples

Forecasting: Principles and Practice Introduction 6

Page 15: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Key reference

Hyndman, R. J. & Athanasopoulos, G.

(2013) Forecasting: principles and

practice.

otexts.org/fpp/

Free and online

Data sets in associated R package

R code for examples

Forecasting: Principles and Practice Introduction 6

Page 16: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Key reference

Hyndman, R. J. & Athanasopoulos, G.

(2013) Forecasting: principles and

practice.

otexts.org/fpp/

Free and online

Data sets in associated R package

R code for examples

Forecasting: Principles and Practice Introduction 6

Page 17: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Key reference

Hyndman, R. J. & Athanasopoulos, G.

(2013) Forecasting: principles and

practice.

otexts.org/fpp/

Free and online

Data sets in associated R package

R code for examples

Forecasting: Principles and Practice Introduction 6

Page 18: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Key reference

Hyndman, R. J. & Athanasopoulos, G.

(2013) Forecasting: principles and

practice.

otexts.org/fpp/

Free and online

Data sets in associated R package

R code for examples

Forecasting: Principles and Practice Introduction 6

Page 19: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Poll: How proficient are you in using R?

1 Guru: The R core team come to me for advice.2 Expert: I have written several packages on

CRAN.3 Skilled: I use it regularly and it is an important

part of my job.4 Comfortable: I use it often and am comfortable

with the tool.5 User: I use it sometimes, but I am often

searching around for the right function.6 Learner: I have used it a few times.7 Beginner: I’ve managed to download and install

it.8 Unknown: Why are you speaking like a pirate?

Forecasting: Principles and Practice Introduction 7

Page 20: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Which version of R are you using?

Version: (try getRversion() if you don’t know)

1 R 3.0.0 or higher

2 R 2.15.x

3 R 2.14.x

4 Something older.

Edition

1 Standard R (CRAN)

2 Standard R with RStudio

3 Revolution R: Community, EnterpriseWorkstation or Server

4 Something else?Forecasting: Principles and Practice Introduction 8

Page 21: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Install required packages

install.packages("fpp", dependencies=TRUE)

Forecasting: Principles and Practice Introduction 9

Page 22: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Getting help with R# Search for termshelp.search("forecasting")

# Detailed helphelp(forecast)

# Worked examplesexample("forecast.ar")

# Similar namesapropos("forecast")

#Help on packagehelp(package="fpp")

Forecasting: Principles and Practice Introduction 10

Page 23: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Approximate outlineDay Topic Chapter

1 The forecaster’s toolbox 1,21 Seasonality and trends 61 Exponential smoothing 7

2 Time series decomposition 62 Time series cross-validation 22 Transformations 22 Stationarity and differencing 82 ARIMA models 8

3 State space models –3 Dynamic regression 93 Hierarchical forecasting 93 Advanced methods 9

Forecasting: Principles and Practice Introduction 11

Page 24: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Assumptions

This is not an introduction to R. I assume youare broadly comfortable with R code and the Renvironment.

This is not a statistics course. I assume you arefamiliar with concepts such as the mean,standard deviation, quantiles, regression,normal distribution, etc.

This is not a theory course. I am not going toderive anything. I will teach you forecastingtools, when to use them and how to use themmost effectively.

Forecasting: Principles and Practice Introduction 12

Page 25: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Assumptions

This is not an introduction to R. I assume youare broadly comfortable with R code and the Renvironment.

This is not a statistics course. I assume you arefamiliar with concepts such as the mean,standard deviation, quantiles, regression,normal distribution, etc.

This is not a theory course. I am not going toderive anything. I will teach you forecastingtools, when to use them and how to use themmost effectively.

Forecasting: Principles and Practice Introduction 12

Page 26: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Assumptions

This is not an introduction to R. I assume youare broadly comfortable with R code and the Renvironment.

This is not a statistics course. I assume you arefamiliar with concepts such as the mean,standard deviation, quantiles, regression,normal distribution, etc.

This is not a theory course. I am not going toderive anything. I will teach you forecastingtools, when to use them and how to use themmost effectively.

Forecasting: Principles and Practice Introduction 12

Page 27: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Outline

1 Introduction

2 Some case studies

3 Time series data

4 Some simple forecasting methods

Forecasting: Principles and Practice Some case studies 13

Page 28: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 1: Paperware company

Forecasting: Principles and Practice Some case studies 14

Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesn’tseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

Page 29: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 1: Paperware company

Forecasting: Principles and Practice Some case studies 14

Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesn’tseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.

Page 30: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 1: Paperware company

Forecasting: Principles and Practice Some case studies 14

Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesn’tseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.Their programmer has little experience in numericalcomputing.

Page 31: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 1: Paperware company

Forecasting: Principles and Practice Some case studies 14

Problem: Want forecasts of each ofhundreds of items. Series can bestationary, trended or seasonal. Theycurrently have a large forecastingprogram written in-house but it doesn’tseem to produce sensible forecasts.They want me to tell them what iswrong and fix it.

Additional informationProgram written in COBOL making numerical calculationslimited. It is not possible to do any optimisation.Their programmer has little experience in numericalcomputing.They employ no statisticians and want the program toproduce forecasts automatically.

Page 32: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 1: Paperware company

Methods currently used

A 12 month average

C 6 month average

E straight line regression over last 12 months

G straight line regression over last 6 months

H average slope between last year’s and thisyear’s values.(Equivalent to differencing at lag 12 andtaking mean.)

I Same as H except over 6 months.

K I couldn’t understand the explanation.

Forecasting: Principles and Practice Some case studies 15

Page 33: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

Forecasting: Principles and Practice Some case studies 16

Page 34: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

The total cost is budgeted based on forecastsof drug usage.

Forecasting: Principles and Practice Some case studies 17

Page 35: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

The total cost is budgeted based on forecastsof drug usage.

Forecasting: Principles and Practice Some case studies 17

Page 36: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

The total cost is budgeted based on forecastsof drug usage.

Forecasting: Principles and Practice Some case studies 17

Page 37: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

The Pharmaceutical Benefits Scheme (PBS) isthe Australian government drugs subsidy scheme.

Many drugs bought from pharmacies aresubsidised to allow more equitable access tomodern drugs.

The cost to government is determined by thenumber and types of drugs purchased.Currently nearly 1% of GDP.

The total cost is budgeted based on forecastsof drug usage.

Forecasting: Principles and Practice Some case studies 17

Page 38: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

Forecasting: Principles and Practice Some case studies 18

Page 39: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 40: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 41: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 42: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 43: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 44: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 2: PBS

In 2001: $4.5 billion budget, under-forecastedby $800 million.Thousands of products. Seasonal demand.Subject to covert marketing, volatile products,uncontrollable expenditure.Although monthly data available for 10 years,data are aggregated to annual values, and onlythe first three years are used in estimating theforecasts.All forecasts being done with the FORECASTfunction in MS-Excel!

Problem: How to do the forecasting better?

Forecasting: Principles and Practice Some case studies 19

Page 45: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Forecasting: Principles and Practice Some case studies 20

Page 46: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Forecasting: Principles and Practice Some case studies 21

First class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

0.0

1.0

2.0

Business class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

02

46

8

Economy class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

010

2030

Page 47: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Forecasting: Principles and Practice Some case studies 21

First class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

0.0

1.0

2.0

Business class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

02

46

8

Economy class passengers: Melbourne−Sydney

Year

1988 1989 1990 1991 1992 1993

010

2030

Not the real data!Or is it?

Page 48: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Problem: how to forecast passenger traffic onmajor routes.

Additional information

They can provide a large amount of data onprevious routes.

Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

They have a highly capable team of people whoare able to do most of the computing.

Forecasting: Principles and Practice Some case studies 22

Page 49: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Problem: how to forecast passenger traffic onmajor routes.

Additional information

They can provide a large amount of data onprevious routes.

Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

They have a highly capable team of people whoare able to do most of the computing.

Forecasting: Principles and Practice Some case studies 22

Page 50: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Problem: how to forecast passenger traffic onmajor routes.

Additional information

They can provide a large amount of data onprevious routes.

Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

They have a highly capable team of people whoare able to do most of the computing.

Forecasting: Principles and Practice Some case studies 22

Page 51: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

CASE STUDY 3: Airline

Problem: how to forecast passenger traffic onmajor routes.

Additional information

They can provide a large amount of data onprevious routes.

Traffic is affected by school holidays, specialevents such as the Grand Prix, advertisingcampaigns, competition behaviour, etc.

They have a highly capable team of people whoare able to do most of the computing.

Forecasting: Principles and Practice Some case studies 22

Page 52: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Outline

1 Introduction

2 Some case studies

3 Time series data

4 Some simple forecasting methods

Forecasting: Principles and Practice Time series data 23

Page 53: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 54: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 55: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 56: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 57: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 58: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 59: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 60: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series data

Time series consist of sequences ofobservations collected over time.We will assume the time periods are equallyspaced.

Time series examples

Daily IBM stock pricesMonthly rainfallAnnual Google profitsQuarterly Australian beer production

Forecasting is estimating how the sequenceof observations will continue into the future.

Forecasting: Principles and Practice Time series data 24

Page 61: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Australian beer production

Forecasting: Principles and Practice Time series data 25

Year

meg

alite

rs

1995 2000 2005 2010

400

450

500

Page 62: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Looking for stories

Forecasting: Principles and Practice Time series data 26

Page 63: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Looking for stories that make sense

Forecasting: Principles and Practice Time series data 27

Page 64: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Think about what you’re doing

Forecasting: Principles and Practice Time series data 28

Page 65: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RAustralian GDPausgdp <- ts(scan("gdp.dat"),frequency=4,

start=1971+2/4)Class: tsPrint and plotting methods available.

> ausgdpQtr1 Qtr2 Qtr3 Qtr4

1971 4612 46511972 4645 4615 4645 47221973 4780 4830 4887 49331974 4921 4875 4867 49051975 4938 4934 4942 49791976 5028 5079 5112 51271977 5130 5101 5072 50691978 5100 5166 5244 53121979 5349 5370 5388 53961980 5388 5403 5442 5482

Forecasting: Principles and Practice Time series data 29

Page 66: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RAustralian GDPausgdp <- ts(scan("gdp.dat"),frequency=4,

start=1971+2/4)Class: tsPrint and plotting methods available.

> ausgdpQtr1 Qtr2 Qtr3 Qtr4

1971 4612 46511972 4645 4615 4645 47221973 4780 4830 4887 49331974 4921 4875 4867 49051975 4938 4934 4942 49791976 5028 5079 5112 51271977 5130 5101 5072 50691978 5100 5166 5244 53121979 5349 5370 5388 53961980 5388 5403 5442 5482

Forecasting: Principles and Practice Time series data 29

Page 67: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RAustralian GDPausgdp <- ts(scan("gdp.dat"),frequency=4,

start=1971+2/4)Class: tsPrint and plotting methods available.

> ausgdpQtr1 Qtr2 Qtr3 Qtr4

1971 4612 46511972 4645 4615 4645 47221973 4780 4830 4887 49331974 4921 4875 4867 49051975 4938 4934 4942 49791976 5028 5079 5112 51271977 5130 5101 5072 50691978 5100 5166 5244 53121979 5349 5370 5388 53961980 5388 5403 5442 5482

Forecasting: Principles and Practice Time series data 29

Page 68: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in R

Forecasting: Principles and Practice Time series data 30

Time

ausg

dp

1975 1980 1985 1990 19954500

5000

5500

6000

6500

7000

7500 > plot(ausgdp)

Page 69: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in R

Residential electricity sales

> elecsalesTime Series:Start = 1989End = 2008Frequency = 1[1] 2354.34 2379.71 2318.52 2468.99 2386.09 2569.47[7] 2575.72 2762.72 2844.50 3000.70 3108.10 3357.50

[13] 3075.70 3180.60 3221.60 3176.20 3430.60 3527.48[19] 3637.89 3655.00

Forecasting: Principles and Practice Time series data 31

Page 70: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)

Forecasting: Principles and Practice Time series data 32

Page 71: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 72: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 73: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 74: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 75: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 76: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Time series in RMain package used in this course> library(fpp)This loads:

some data for use in examples and exercisesforecast package (for forecasting functions)tseries package (for a few time seriesfunctions)fma package (for lots of time series data)expsmooth package (for more time seriesdata)lmtest package (for some regressionfunctions)

Forecasting: Principles and Practice Time series data 32

Page 77: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Outline

1 Introduction

2 Some case studies

3 Time series data

4 Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 33

Page 78: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 34

Australian quarterly beer production

meg

alite

rs

1995 2000 2005

400

450

500

Page 79: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 34

Australian quarterly beer production

meg

alite

rs

1995 2000 2005

400

450

500

Can you think of any forecasting methods for these data?

Page 80: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 35

Number of pigs slaughtered in Victoria

thou

sand

s

1990 1991 1992 1993 1994 1995

8090

100

110

Page 81: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 35

Number of pigs slaughtered in Victoria

thou

sand

s

1990 1991 1992 1993 1994 1995

8090

100

110

How would you forecast these data?

Page 82: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 36

Dow Jones index (daily ending 15 Jul 94)

0 50 100 150 200 250

3600

3700

3800

3900

Page 83: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 36

Dow Jones index (daily ending 15 Jul 94)

0 50 100 150 200 250

3600

3700

3800

3900

How would you forecast these data?

Page 84: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 85: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 86: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 87: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 88: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 89: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 90: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 91: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 92: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Average method

Forecast of all future values is equal to mean ofhistorical data {y1, . . . , yT}.Forecasts: yT+h|T = y = (y1 + · · ·+ yT)/T

Naïve method (for time series only)

Forecasts equal to last observed value.Forecasts: yT+h|T = yT.Consequence of efficient market hypothesis.

Seasonal naïve method

Forecasts equal to last value from same season.Forecasts: yT+h|T = yT+h−km where m =seasonal period and k = b(h− 1)/mc+1.

Forecasting: Principles and Practice Some simple forecasting methods 37

Page 93: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 38

Forecasts for quarterly beer production

1995 2000 2005

400

450

500

Which method is which?

Page 94: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 38

Forecasts for quarterly beer production

1995 2000 2005

400

450

500

Mean methodNaive methodSeasonal naive method

Which method is which?

Page 95: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Drift method

Forecasts equal to last value plus averagechange.

Forecasts:

yT+h|T = yT +h

T − 1

T∑t=2

(yt − yt−1)

= yT +h

T − 1(yT − y1).

Equivalent to extrapolating a line drawnbetween first and last observations.

Forecasting: Principles and Practice Some simple forecasting methods 39

Page 96: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Drift method

Forecasts equal to last value plus averagechange.

Forecasts:

yT+h|T = yT +h

T − 1

T∑t=2

(yt − yt−1)

= yT +h

T − 1(yT − y1).

Equivalent to extrapolating a line drawnbetween first and last observations.

Forecasting: Principles and Practice Some simple forecasting methods 39

Page 97: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Drift method

Forecasts equal to last value plus averagechange.

Forecasts:

yT+h|T = yT +h

T − 1

T∑t=2

(yt − yt−1)

= yT +h

T − 1(yT − y1).

Equivalent to extrapolating a line drawnbetween first and last observations.

Forecasting: Principles and Practice Some simple forecasting methods 39

Page 98: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 40

Dow Jones Index (daily ending 15 Jul 94)

Day

0 50 100 150 200 250 300

3600

3700

3800

3900

Page 99: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Forecasting: Principles and Practice Some simple forecasting methods 40

Dow Jones Index (daily ending 15 Jul 94)

Day

0 50 100 150 200 250 300

3600

3700

3800

3900

Mean methodNaive methodDrift model

Page 100: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Mean: meanf(x, h=20)

Naive: naive(x, h=20) or rwf(x, h=20)

Seasonal naive: snaive(x, h=20)

Drift: rwf(x, drift=TRUE, h=20)

Forecasting: Principles and Practice Some simple forecasting methods 41

Page 101: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Mean: meanf(x, h=20)

Naive: naive(x, h=20) or rwf(x, h=20)

Seasonal naive: snaive(x, h=20)

Drift: rwf(x, drift=TRUE, h=20)

Forecasting: Principles and Practice Some simple forecasting methods 41

Page 102: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Mean: meanf(x, h=20)

Naive: naive(x, h=20) or rwf(x, h=20)

Seasonal naive: snaive(x, h=20)

Drift: rwf(x, drift=TRUE, h=20)

Forecasting: Principles and Practice Some simple forecasting methods 41

Page 103: Forecasting - Rob J Hyndman · Fertilizer sales. Brief bio Forecasting: Principles and Practice Introduction 4 ... CASE STUDY 2: PBS Forecasting: Principles and Practice Some case

Some simple forecasting methods

Mean: meanf(x, h=20)

Naive: naive(x, h=20) or rwf(x, h=20)

Seasonal naive: snaive(x, h=20)

Drift: rwf(x, drift=TRUE, h=20)

Forecasting: Principles and Practice Some simple forecasting methods 41