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

Similar documents
Forecasting: principles and practice. Rob J Hyndman 1.1 Introduction to Forecasting

ECON 427: ECONOMIC FORECASTING. Ch1. Getting started OTexts.org/fpp2/

Forecasting using R. Rob J Hyndman. 2.3 Stationarity and differencing. Forecasting using R 1

Forecasting: principles and practice 1

Rob J Hyndman. Forecasting using. 3. Autocorrelation and seasonality OTexts.com/fpp/2/ OTexts.com/fpp/6/1. Forecasting using R 1

Forecasting: Methods and Applications

FORECASTING. Methods and Applications. Third Edition. Spyros Makridakis. European Institute of Business Administration (INSEAD) Steven C Wheelwright

Time series and Forecasting

Chapter 7 Forecasting Demand

Forecasting. Simon Shaw 2005/06 Semester II

Forecasting Methods And Applications 3rd Edition

Modelling and Forecasting Australian Domestic Tourism

Introduction to Forecasting

Chapter 8 - Forecasting

Using Temporal Hierarchies to Predict Tourism Demand

peak half-hourly New South Wales

CP:

Time Series Analysis. Smoothing Time Series. 2) assessment of/accounting for seasonality. 3) assessment of/exploiting "serial correlation"

The SAB Medium Term Sales Forecasting System : From Data to Planning Information. Kenneth Carden SAB : Beer Division Planning

peak half-hourly Tasmania

Time series can often be naturally disaggregated

Time Series and Forecasting

Forecasting using R. Rob J Hyndman. 1.3 Seasonality and trends. Forecasting using R 1

BUSI 460 Suggested Answers to Selected Review and Discussion Questions Lesson 7

Time Series and Forecasting

Dennis Bricker Dept of Mechanical & Industrial Engineering The University of Iowa. Forecasting demand 02/06/03 page 1 of 34

Read Section 1.1, Examples of time series, on pages 1-8. These example introduce the book; you are not tested on them.

Chapter 5: Forecasting

Decision 411: Class 3

Week 9: An Introduction to Time Series

DEPARTMENT OF QUANTITATIVE METHODS & INFORMATION SYSTEMS

download instant at

Decision 411: Class 3

Lecture Prepared By: Mohammad Kamrul Arefin Lecturer, School of Business, North South University

Decision 411: Class 3

SHORT TERM LOAD FORECASTING

Time-Series Analysis. Dr. Seetha Bandara Dept. of Economics MA_ECON

Chapter 12: An introduction to Time Series Analysis. Chapter 12: An introduction to Time Series Analysis

Applied Time Series Topics

Forecasting. Chapter Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

Based on the original slides from Levine, et. all, First Edition, Prentice Hall, Inc

Lecture 4 Forecasting

Lecture Prepared By: Mohammad Kamrul Arefin Lecturer, School of Business, North South University

peak half-hourly South Australia

Homework 2. For the homework, be sure to give full explanations where required and to turn in any relevant plots.

INTRODUCTION TO FORECASTING (PART 2) AMAT 167

Antti Salonen PPU Le 2: Forecasting 1

COMPARISON OF PEAK FORECASTING METHODS. Stuart McMenamin David Simons

Advances in promotional modelling and analytics

PPU411 Antti Salonen. Forecasting. Forecasting PPU Forecasts are critical inputs to business plans, annual plans, and budgets

Objectives for Linear Activity. Calculate average rate of change/slope Interpret intercepts and slope of linear function Linear regression

Cyclical Effect, and Measuring Irregular Effect

Forecasting using R. Rob J Hyndman. 3.2 Dynamic regression. Forecasting using R 1

Antti Salonen KPP Le 3: Forecasting KPP227

College Algebra. Word Problems

Empirical Project, part 1, ECO 672

Ch. 12: Workload Forecasting

Industrial Engineering Prof. Inderdeep Singh Department of Mechanical & Industrial Engineering Indian Institute of Technology, Roorkee

CHAPTER 1: Decomposition Methods

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall.

Forecasting. Copyright 2015 Pearson Education, Inc.

Google Adwords. 8WEB Google Adwords. Capture leads & make sales. Y o u r P a r t n e r s I n O n l i n e S a l e s

Outline. Lesson 3: Linear Functions. Objectives:

Forecasting Chapter 3

Applied Modeling & Forecasting. Chapter 1

Forecasting Using Time Series Models

The ARIMA Procedure: The ARIMA Procedure

Chapter 2: Economic Theories, Data, and Graphs

WRF Webcast. Improving the Accuracy of Short-Term Water Demand Forecasts

Economics 312: Urban Land Economics University of Victoria Midterm Examination #1 VERSION 1 SOLUTIONS Spring 2018 Instructor: Martin Farnham

Diploma Part 2. Quantitative Methods. Examiner s Suggested Answers

3 Time Series Regression

CHAPTER 18. Time Series Analysis and Forecasting

QMT 3001 BUSINESS FORECASTING. Exploring Data Patterns & An Introduction to Forecasting Techniques. Aysun KAPUCUGİL-İKİZ, PhD.

Applied Modeling & Forecasting QMIS 320 Chapter 1

The Art of Forecasting

Summary statistics. G.S. Questa, L. Trapani. MSc Induction - Summary statistics 1

YEAR 10 GENERAL MATHEMATICS 2017 STRAND: BIVARIATE DATA PART II CHAPTER 12 RESIDUAL ANALYSIS, LINEARITY AND TIME SERIES

9) Time series econometrics

LECTURE 2: SIMPLE REGRESSION I

Year 10 Mathematics Semester 2 Bivariate Data Chapter 13

MA 181 Lecture Chapter 7 College Algebra and Calculus by Larson/Hodgkins Limits and Derivatives

The TransPacific agreement A good thing for VietNam?

Inference with Simple Regression

Determine the trend for time series data

at least 50 and preferably 100 observations should be available to build a proper model

BEFORE THE PUBLIC UTILITIES COMMISSION OF THE STATE OF COLORADO * * * * *

Operations Management

Time Series in R: Forecasting and Visualisation. Forecast evaluation 29 May 2017

DRIVING ROI. The Business Case for Advanced Weather Solutions for the Energy Market

The value of feedback in forecasting competitions

Time Series Analysis

Abram Gross Yafeng Peng Jedidiah Shirey

Do we need Experts for Time Series Forecasting?

A Dynamic Combination and Selection Approach to Demand Forecasting

4.1 Exponential Functions. For Formula 1, the value of n is based on the frequency of compounding. Common frequencies include:

Forecasting and the importance of being uncertain

Forecasting. BUS 735: Business Decision Making and Research. exercises. Assess what we have learned

Forecasting: principles and practice. Rob J Hyndman 4 Hierarchical forecasting

CHAPTER 14. Time Series Analysis and Forecasting STATISTICS IN PRACTICE:

Transcription:

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

Resources Slides Exercises Textbook Useful links robjhyndman.com/uwa Forecasting: Principles and Practice 2

Outline 1 Introduction 2 Some case studies 3 Time series data 4 Some simple forecasting methods Forecasting: Principles and Practice Introduction 3

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales Forecasting: Principles and Practice Introduction 4

Brief bio Director of Monash University s Business & Economic Forecasting Unit Editor-in-Chief, International Journal of Forecasting How my forecasting methodology is used: Pharmaceutical Benefits Scheme Cancer incidence and mortality Electricity demand Ageing population Fertilizer sales robjhyndman.com Forecasting: Principles and Practice Introduction 4

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 more than 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 to learn more. 7 Unknown: What is forecasting? Is that what the weather people do? Forecasting: Principles and Practice Introduction 5

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

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

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

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

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

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

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, Enterprise Workstation or Server 4 Something else? Forecasting: Principles and Practice Introduction 8

Install required packages install.packages("fpp", dependencies=true) Forecasting: Principles and Practice Introduction 9

Getting help with R # Search for terms help.search("forecasting") # Detailed help help(forecast) # Worked examples example("forecast.ar") # Similar names apropos("forecast") #Help on package help(package="fpp") Forecasting: Principles and Practice Introduction 10

Approximate outline Day Topic Chapter 1 The forecaster s toolbox 1,2 1 Seasonality and trends 6 1 Exponential smoothing 7 2 Time series decomposition 6 2 Time series cross-validation 2 2 Transformations 2 2 Stationarity and differencing 8 2 ARIMA models 8 3 State space models 3 Dynamic regression 9 3 Hierarchical forecasting 9 3 Advanced methods 9 Forecasting: Principles and Practice Introduction 11

Assumptions This is not an introduction to R. I assume you are broadly comfortable with R code and the R environment. This is not a statistics course. I assume you are familiar with concepts such as the mean, standard deviation, quantiles, regression, normal distribution, etc. This is not a theory course. I am not going to derive anything. I will teach you forecasting tools, when to use them and how to use them most effectively. Forecasting: Principles and Practice Introduction 12

Assumptions This is not an introduction to R. I assume you are broadly comfortable with R code and the R environment. This is not a statistics course. I assume you are familiar with concepts such as the mean, standard deviation, quantiles, regression, normal distribution, etc. This is not a theory course. I am not going to derive anything. I will teach you forecasting tools, when to use them and how to use them most effectively. Forecasting: Principles and Practice Introduction 12

Assumptions This is not an introduction to R. I assume you are broadly comfortable with R code and the R environment. This is not a statistics course. I assume you are familiar with concepts such as the mean, standard deviation, quantiles, regression, normal distribution, etc. This is not a theory course. I am not going to derive anything. I will teach you forecasting tools, when to use them and how to use them most effectively. Forecasting: Principles and Practice Introduction 12

Outline 1 Introduction 2 Some case studies 3 Time series data 4 Some simple forecasting methods Forecasting: Principles and Practice Some case studies 13

CASE STUDY 1: Paperware company Problem: Want forecasts of each of hundreds of items. Series can be stationary, trended or seasonal. They currently have a large forecasting program written in-house but it doesn t seem to produce sensible forecasts. They want me to tell them what is wrong and fix it. Forecasting: Principles and Practice Some case studies 14

CASE STUDY 1: Paperware company Problem: Want forecasts of each of hundreds of items. Series can be stationary, trended or seasonal. They currently have a large forecasting program written in-house but it doesn t seem to produce sensible forecasts. They want me to tell them what is wrong and fix it. Additional information Program written in COBOL making numerical calculations limited. It is not possible to do any optimisation. Forecasting: Principles and Practice Some case studies 14

CASE STUDY 1: Paperware company Problem: Want forecasts of each of hundreds of items. Series can be stationary, trended or seasonal. They currently have a large forecasting program written in-house but it doesn t seem to produce sensible forecasts. They want me to tell them what is wrong and fix it. Additional information Program written in COBOL making numerical calculations limited. It is not possible to do any optimisation. Their programmer has little experience in numerical computing. Forecasting: Principles and Practice Some case studies 14

CASE STUDY 1: Paperware company Problem: Want forecasts of each of hundreds of items. Series can be stationary, trended or seasonal. They currently have a large forecasting program written in-house but it doesn t seem to produce sensible forecasts. They want me to tell them what is wrong and fix it. Additional information Program written in COBOL making numerical calculations limited. It is not possible to do any optimisation. Their programmer has little experience in numerical computing. They employ no statisticians and want the program to produce forecasts automatically. Forecasting: Principles and Practice Some case studies 14

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 this year s values. (Equivalent to differencing at lag 12 and taking mean.) I Same as H except over 6 months. K I couldn t understand the explanation. Forecasting: Principles and Practice Some case studies 15

CASE STUDY 2: PBS Forecasting: Principles and Practice Some case studies 16

CASE STUDY 2: PBS The Pharmaceutical Benefits Scheme (PBS) is the Australian government drugs subsidy scheme. Many drugs bought from pharmacies are subsidised to allow more equitable access to modern drugs. The cost to government is determined by the number and types of drugs purchased. Currently nearly 1% of GDP. The total cost is budgeted based on forecasts of drug usage. Forecasting: Principles and Practice Some case studies 17

CASE STUDY 2: PBS The Pharmaceutical Benefits Scheme (PBS) is the Australian government drugs subsidy scheme. Many drugs bought from pharmacies are subsidised to allow more equitable access to modern drugs. The cost to government is determined by the number and types of drugs purchased. Currently nearly 1% of GDP. The total cost is budgeted based on forecasts of drug usage. Forecasting: Principles and Practice Some case studies 17

CASE STUDY 2: PBS The Pharmaceutical Benefits Scheme (PBS) is the Australian government drugs subsidy scheme. Many drugs bought from pharmacies are subsidised to allow more equitable access to modern drugs. The cost to government is determined by the number and types of drugs purchased. Currently nearly 1% of GDP. The total cost is budgeted based on forecasts of drug usage. Forecasting: Principles and Practice Some case studies 17

CASE STUDY 2: PBS The Pharmaceutical Benefits Scheme (PBS) is the Australian government drugs subsidy scheme. Many drugs bought from pharmacies are subsidised to allow more equitable access to modern drugs. The cost to government is determined by the number and types of drugs purchased. Currently nearly 1% of GDP. The total cost is budgeted based on forecasts of drug usage. Forecasting: Principles and Practice Some case studies 17

CASE STUDY 2: PBS Forecasting: Principles and Practice Some case studies 18

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 2: PBS In 2001: $4.5 billion budget, under-forecasted by $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 only the first three years are used in estimating the forecasts. All forecasts being done with the FORECAST function in MS-Excel! Problem: How to do the forecasting better? Forecasting: Principles and Practice Some case studies 19

CASE STUDY 3: Airline Forecasting: Principles and Practice Some case studies 20

CASE STUDY 3: Airline First class passengers: Melbourne Sydney 0.0 1.0 2.0 1988 1989 1990 1991 1992 1993 Year Business class passengers: Melbourne Sydney 0 2 4 6 8 0 10 20 30 1988 1989 1990 1991 1992 1993 Year Economy class passengers: Melbourne Sydney 1988 1989 1990 1991 1992 1993 Forecasting: Principles and Practice Year Some case studies 21

CASE STUDY 3: Airline First class passengers: Melbourne Sydney 0.0 1.0 2.0 0 2 4 6 8 0 10 20 30 Not the real data! Or is it? 1988 1989 1990 1991 1992 1993 Year Business class passengers: Melbourne Sydney 1988 1989 1990 1991 1992 1993 Year Economy class passengers: Melbourne Sydney 1988 1989 1990 1991 1992 1993 Forecasting: Principles and Practice Year Some case studies 21

CASE STUDY 3: Airline Problem: how to forecast passenger traffic on major routes. Additional information They can provide a large amount of data on previous routes. Traffic is affected by school holidays, special events such as the Grand Prix, advertising campaigns, competition behaviour, etc. They have a highly capable team of people who are able to do most of the computing. Forecasting: Principles and Practice Some case studies 22

CASE STUDY 3: Airline Problem: how to forecast passenger traffic on major routes. Additional information They can provide a large amount of data on previous routes. Traffic is affected by school holidays, special events such as the Grand Prix, advertising campaigns, competition behaviour, etc. They have a highly capable team of people who are able to do most of the computing. Forecasting: Principles and Practice Some case studies 22

CASE STUDY 3: Airline Problem: how to forecast passenger traffic on major routes. Additional information They can provide a large amount of data on previous routes. Traffic is affected by school holidays, special events such as the Grand Prix, advertising campaigns, competition behaviour, etc. They have a highly capable team of people who are able to do most of the computing. Forecasting: Principles and Practice Some case studies 22

CASE STUDY 3: Airline Problem: how to forecast passenger traffic on major routes. Additional information They can provide a large amount of data on previous routes. Traffic is affected by school holidays, special events such as the Grand Prix, advertising campaigns, competition behaviour, etc. They have a highly capable team of people who are able to do most of the computing. Forecasting: Principles and Practice Some case studies 22

Outline 1 Introduction 2 Some case studies 3 Time series data 4 Some simple forecasting methods Forecasting: Principles and Practice Time series data 23

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Time series data Time series consist of sequences of observations collected over time. We will assume the time periods are equally spaced. Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer production Forecasting is estimating how the sequence of observations will continue into the future. Forecasting: Principles and Practice Time series data 24

Australian beer production megaliters 400 450 500 1995 2000 2005 2010 Year Forecasting: Principles and Practice Time series data 25

Looking for stories Forecasting: Principles and Practice Time series data 26

Looking for stories that make sense Forecasting: Principles and Practice Time series data 27

Think about what you re doing Forecasting: Principles and Practice Time series data 28

Time series in R Australian GDP ausgdp <- ts(scan("gdp.dat"),frequency=4, start=1971+2/4) Class: ts Print and plotting methods available. > ausgdp Qtr1 Qtr2 Qtr3 Qtr4 1971 4612 4651 1972 4645 4615 4645 4722 1973 4780 4830 4887 4933 1974 4921 4875 4867 4905 1975 4938 4934 4942 4979 1976 5028 5079 5112 5127 Forecasting: Principles and Practice Time series data 29

Time series in R Australian GDP ausgdp <- ts(scan("gdp.dat"),frequency=4, start=1971+2/4) Class: ts Print and plotting methods available. > ausgdp Qtr1 Qtr2 Qtr3 Qtr4 1971 4612 4651 1972 4645 4615 4645 4722 1973 4780 4830 4887 4933 1974 4921 4875 4867 4905 1975 4938 4934 4942 4979 1976 5028 5079 5112 5127 Forecasting: Principles and Practice Time series data 29

Time series in R Australian GDP ausgdp <- ts(scan("gdp.dat"),frequency=4, start=1971+2/4) Class: ts Print and plotting methods available. > ausgdp Qtr1 Qtr2 Qtr3 Qtr4 1971 4612 4651 1972 4645 4615 4645 4722 1973 4780 4830 4887 4933 1974 4921 4875 4867 4905 1975 4938 4934 4942 4979 1976 5028 5079 5112 5127 Forecasting: Principles and Practice Time series data 29

Time series in R ausgdp 4500 5000 5500 6000 6500 7000 7500 > plot(ausgdp) 1975 1980 1985 1990 1995 Time Forecasting: Principles and Practice Time series data 30

Time series in R Residential electricity sales > elecsales Time Series: Start = 1989 End = 2008 Frequency = 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

Time series in R Main package used in this course > library(fpp) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

Time series in R Main package used in this course > library(fpp) This loads: some data for use in examples and exercises forecast package (for forecasting functions) tseries package (for a few time series functions) fma package (for lots of time series data) expsmooth package (for more time series data) lmtest package (for some regression functions) Forecasting: Principles and Practice Time series data 32

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

Some simple forecasting methods Australian quarterly beer production megaliters 400 450 500 1995 2000 2005 Forecasting: Principles and Practice Some simple forecasting methods 34

Some simple forecasting methods Australian quarterly beer production megaliters 400 450 500 1995 2000 2005 Can you think of any forecasting methods for these data? Forecasting: Principles and Practice Some simple forecasting methods 34

Some simple forecasting methods Number of pigs slaughtered in Victoria thousands 80 90 100 110 1990 1991 1992 1993 1994 1995 Forecasting: Principles and Practice Some simple forecasting methods 35

Some simple forecasting methods Number of pigs slaughtered in Victoria thousands 80 90 100 110 1990 1991 1992 1993 1994 1995 How would you forecast these data? Forecasting: Principles and Practice Some simple forecasting methods 35

Some simple forecasting methods Dow Jones index (daily ending 15 Jul 94) 3600 3700 3800 3900 0 50 100 150 200 250 Forecasting: Principles and Practice Some simple forecasting methods 36

Some simple forecasting methods Dow Jones index (daily ending 15 Jul 94) 3600 3700 3800 3900 0 50 100 150 200 250 How would you forecast these data? Forecasting: Principles and Practice Some simple forecasting methods 36

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Average method Forecast of all future values is equal to mean of historical data {y 1,..., y T }. Forecasts: ŷ T+h T = ȳ = (y 1 + + y T )/T Naïve method (for time series only) Forecasts equal to last observed value. Forecasts: ŷ T+h T = y T. Consequence of efficient market hypothesis. Seasonal naïve method Forecasts equal to last value from same season. Forecasts: ŷ T+h T = y T+h km where m = seasonal period and k = (h 1)/m +1. Forecasting: Principles and Practice Some simple forecasting methods 37

Some simple forecasting methods Forecasts for quarterly beer production 400 450 500 1995 2000 2005 Which method is which? Forecasting: Principles and Practice Some simple forecasting methods 38

Some simple forecasting methods Forecasts for quarterly beer production Mean method Naive method Seasonal naive method 400 450 500 1995 2000 2005 Which method is which? Forecasting: Principles and Practice Some simple forecasting methods 38

Drift method Forecasts equal to last value plus average change. Forecasts: ŷ T+h T = y T + h T 1 T (y t y t 1 ) t=2 = y T + h T 1 (y T y 1 ). Equivalent to extrapolating a line drawn between first and last observations. Forecasting: Principles and Practice Some simple forecasting methods 39

Drift method Forecasts equal to last value plus average change. Forecasts: ŷ T+h T = y T + h T 1 T (y t y t 1 ) t=2 = y T + h T 1 (y T y 1 ). Equivalent to extrapolating a line drawn between first and last observations. Forecasting: Principles and Practice Some simple forecasting methods 39

Drift method Forecasts equal to last value plus average change. Forecasts: ŷ T+h T = y T + h T 1 T (y t y t 1 ) t=2 = y T + h T 1 (y T y 1 ). Equivalent to extrapolating a line drawn between first and last observations. Forecasting: Principles and Practice Some simple forecasting methods 39

3600 3700 3800 3900 Some simple forecasting methods Dow Jones Index (daily ending 15 Jul 94) 0 50 100 150 200 250 300 Day Forecasting: Principles and Practice Some simple forecasting methods 40

Some simple forecasting methods 3600 3700 3800 3900 Mean method Naive method Drift model Dow Jones Index (daily ending 15 Jul 94) 0 50 100 150 200 250 300 Day Forecasting: Principles and Practice Some simple forecasting methods 40

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

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

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

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