Your SlideShare is downloading. ×
FPP 1. Getting started
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

FPP 1. Getting started

280
views

Published on

Slides for ETC2450. …

Slides for ETC2450.
Forecasting principles and practice: 1. Getting started.

Published in: Education, Technology, Business

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
280
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
19
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. ETC2450Applied forecasting forbusiness and economics1. Getting startedOTexts.com/fpp/1/
  • 2. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started A brief history of forecasting 2
  • 3. Standard business practice today “What-if scenarios” based on assumed and fixed future conditions. Highly subjective. Not replicable or testable. No possible way of quantifying probabilistic uncertainty. Lack of uncertainty statements leads to false sense of accuracy. Largely guesswork.Is this any better than a sheep’s liver orhallucinogens? 1. Getting started A brief history of forecasting 3
  • 4. The rise of stochastic models 1959 exponential smoothing (Brown) 1970 ARIMA models (Box, Jenkins) 1980 VAR models (Sims, Granger) 1980 non-linear models (Granger, Tong, Hamilton, Teräsvirta, . . . ) 1982 ARCH/GARCH (Engle, Bollerslev) 1986 neural networks (Rumelhart) 1989 state space models (Harvey, West, Harrison) 1994 nonparametric forecasting (Tjøstheim, Härdle, Tsay,. . . ) 2002 exponential smoothing state space models (Snyder, Hyndman, Koehler, Ord) 1. Getting started A brief history of forecasting 4
  • 5. Advantages of stochastic models Based on empirical data Computable Replicable Testable Objective measure of uncertainty Able to compute prediction intervals 1. Getting started A brief history of forecasting 5
  • 6. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started Types of data 6
  • 7. Types of dataMost forecasting problems use either 1 Time series data (collected at regular intervals over time) 2 Cross-sectional data are for a single point in time.Time series examples Daily IBM stock prices Monthly rainfall Annual Google profits Quarterly Australian beer productionForecasting is estimating how the sequenceof observations will continue into the future. 1. Getting started Types of data 7
  • 8. Australian beer production 500megaliters 450 400 1995 2000 2005 2010 Year 1. Getting started Types of data 8
  • 9. Types of dataCross-sectional examples House prices for all houses sold in 2009 in Clayton. We are interested in predicting the price of a house not in our data set using house characteristics: position, no. bedrooms, age, etc. Fuel economy data for a range of 2009 model cars. We are interested in predicting the carbon footprint of a vehicle not in our data set using information such as the size of the engine and the fuel efficiency of the car. 1. Getting started Types of data 9
  • 10. Vehicle carbon footprintsModel Cyl. Litres City Highway Carbon MPG MPG footprintChevrolet Aveo 4 1.6 25.0 34 6.6Chrysler PT Cruiser 4 2.4 19.0 24 8.7Dodge Avenger 4 2.4 21.0 30 7.7Ford Escape FWD 4 2.5 20.0 28 8.0Ford Ranger Pickup 2WD 4 2.3 19.0 24 8.7GMC Canyon 2WD 4 2.9 18.0 24 9.2Honda Accord 4 2.4 21.0 30 7.7Honda Civic 4 1.8 25.0 36 6.3... All vehicles with automatic transmission and using regular fuel. How to predict carbon footprint (tons of CO2 per year) for other vehicles? 1. Getting started Types of data 10
  • 11. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started Forecasting models 11
  • 12. Time series modelsTime series models use only information on thevariable to be forecast EDt+1 = f (EDt , EDt−1 , EDt−2 , EDt−3 , . . . , error),where t is time and ED is electricity demand.e.g., ARIMA models and exponential smoothing. Useful when predictor variables not known or measured. Useful if prediction of predictor variables difficult. Doesn’t lead to much understanding of system 1. Getting started Forecasting models 12
  • 13. Cross-sectional modelsCross-sectional models assume that variable tobe forecast is affected by one or more otherpredictor variables. ED = f (current temperature, GDP, population, time of day, day of week, error).e.g., regression models. 1. Getting started Forecasting models 13
  • 14. Mixed modelsMixed model EDt+1 = f (EDt , current temperature, time of day, day of week, error).e.g., dynamic regression models, panel datamodels, longitudinal models, transfer functionmodels 1. Getting started Forecasting models 14
  • 15. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started Some case studies 15
  • 16. CASE STUDY 1: Paperware companyClient: large company manufacturing disposable tableware.Problem: They want forecasts of each of hundreds of items.Series can be stationary, trended or seasonal. They currentlyhave a large forecasting program written in-house but itdoesn’t seem to produce sensible forecasts. They want me totell them what is wrong and fix it.Additional information The program is 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. 1. Getting started Some case studies 16
  • 17. CASE STUDY 1: Paperware companyMethods 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. 1. Getting started Some case studies 17
  • 18. CASE STUDY 2: PBSClient: Federal governmentProblem: Develop methodology to forecast annualbudget for Pharmaceutical Benefit Scheme (around$7billion).Additional information At the time, they used Excel to fit a trend line through three observations from about 10 years earlier. All calculations must be done in Excel. They have under-estimated expenditure by nearly $1billion in last two years. 1. Getting started Some case studies 18
  • 19. CASE STUDY 3: Car fleet companyClient: One of Australia’s largest car fleetcompaniesProblem: how to forecast resale value of vehicles?How should this affect leasing and sales policies?Additional information They can provide a large amount of data on previous vehicles and their eventual resale values. The resale values are currently estimated by a group of specialists. They see me as a threat and do not cooperate. 1. Getting started Some case studies 19
  • 20. CASE STUDY 4: AirlineClient: Ansett.Problem: how to forecast passenger traffic onmajor 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. 1. Getting started Some case studies 20
  • 21. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started The statistical forecasting perspective 21
  • 22. Statistical forecasting Thing to be forecast: a random variable, yi . Forecast distribution: If I is all observations, then yi |I means “the random variable yi given what we know in I ”. The “point forecast” is the mean (or median) of yi |I The “forecast variance” is var[yi |I] A prediction interval or “interval forecast” is a range of values of yi with high probability. ˆ With time series, yt|t−1 = yt |{y1 , y2 , . . . , yt−1 }. ˆ yT +h|T = E[yT +h |y1 , . . . , yT ] (an h-step forecast taking account of all observations up to time T). 1. Getting started The statistical forecasting perspective 22
  • 23. Outline1 A brief history of forecasting2 Types of data3 Forecasting models4 Some case studies5 The statistical forecasting perspective6 Introduction to R 1. Getting started Introduction to R 23
  • 24. Australian GDPausgdp <- ts(scan("gdp.dat"),frequency=4, start=1971+2/4) Class: ts Print and plotting methods available.> ausgdp Qtr1 Qtr2 Qtr3 Qtr41971 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 5312 R 1. Getting started Introduction to 24
  • 25. Australian GDP 7500 > plot(ausgdp) 7000 6500ausgdp 6000 5500 5000 4500 1975 1980 1985 1990 1995 Time 1. Getting started Introduction to R 25
  • 26. 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 1. Getting started Introduction to R 26
  • 27. Credit scorescredit <- read.table("bankdata.csv", header=TRUE, sep=",") Class: data.frame Print and plotting methods available.> head(credit) score savings income fte single time.address time.employed3282 39.39981 0.012 111.168 TRUE FALSE 27 85018 51.79090 0.654 56.400 TRUE FALSE 29 338317 32.81704 0.748 36.744 TRUE TRUE 2 1613766 57.30881 0.616 55.992 TRUE TRUE 14 72325 37.17328 4.132 62.040 TRUE TRUE 2 1413573 33.68829 0.000 43.752 TRUE TRUE 7 7 1. Getting started Introduction to R 27
  • 28. Credit scores 0 20 40 0.0 0.4 0.8 0 150 300 100plot(credit) q qq qq q q qq q qq q q qq qq qq q q q q qq q qq q q q qq q q q q q q q q q q q q q q q q q q q q q q q q q q qq q qq qq q q q qqq q qq q q q q qq qq q q qq q qq q q q q q qqqqq qq q q q 60 qq q q qqq qq q q q qq q q qq q q qq q qq q q qq qq q q q qqqqq q q qqq q qq qq q qq q q q q q q q q q qq q qq q qq q q qq q qq q qqqqq qqq q q q qq score qq qq q q qqq q q qq q qqqqq q qqqq qq qqq qqqq q q q q q q q q q q q q qq q qqq qq qq q q q q qqq qqqq q qq q q q q qq q q qq qq qqq qq qq q qq q q qq qq qqqq q qq qq qqqqq q qq qqq qqq qqq qqqqq q q q qqqq q q q q q q q q q q qq qq q q qq q qq qq q q q qqq q q q qqqqqq q q qqq qqq q qqqqqqq qq q q q q q qqq q q qqq qq q q qq qq qqqqqqq q qqqq q qqq q qqq qq qq qqqqqq qq qqq q q q q q q q q q q q q q qq q qq q qq q qq qq qq qqq q qq qq q qq q qqq qqqqqqqqqqqq q qq qqq q qqqqqq q qqqqqqqq q q qq q q q qq qqq qq qq q q q q q qq q q qq qq qqq qqq qqq qqq q qqqqq q q qqqq q qqq qqqq q qq q q q q q q q q q qq qq qqq q qq qq qq qqq q qq q qqqq q qqqqq qqqq qq q q qqqqqqqqq q q qqq q q q q q q q qq qqqqqq qq q qqqq q q qqqq q q qqq qqqq qqqq qqq qqqq q q qq q q q q q q q q q qq q q qqq qq q qq qq q q q q qqqqq qqqq q qq q q qqqq qq qq qqqqqq q qq qqq q q q qq q qq qq 20 q qq qqqq qqq qq q q qq q q q q q q q qq qqq qq q q q q q qq qqq q q qqq qq qqq qq q q q q q q q q q q q q q q qq q q qqq qqq q q q q qq qq q q qqqqq q qq qq q q q q q q q q qqq q q q qqq q qq qq q q qq q q q q q q q q q q q q q q q 20 40 qq q q q q q q q q q q q q q q q q q savings q q q q q q q q q qqq q q qq q q q qq q q q q q q q q qq qq q q q qqq q q q qq q q q q q q q q qq qq qq q q q q q q q q q q qq qqq qq q q q q qq q q q qqqq q qq q qqq qq q q q qq qq qq q q qqqqq qq q qq qqq q q qq qq q q q q qq qq qq qq qqq qqq q q qq qq q q q qqqq qq q qqqqq qq q q qqq qqq q q q q q q qqq q qqq qqq q q q q q qq qq qq q qq qqq qq qqqqqqqqqqqq q qqq qqqqqq q qqq q qqqqq q qqq q qqqqqqqq q q q qqqqqqq qq q qqqqqqqq qqqqq q qqqqqqq qqqqq q qqqqqqqq qqqqqqq q qq q qq qq qqqq qqqqq qq qq qqqq qqqq qq qqqqq q qqqqq qq qqqqqqq q qqqqq q qqqqqqq qqq qq qqqqq qqqq qqqqqqqqqq qq qq qqq qqqq qq qqqq q q q q q q q q q q qqq qq q qq q qq qq q qq qq q qq qq qqq qq qq qq q qq q q qq q q qqqqq q q qqq q q qqqqqqqqqq qq q qqq qqqqq q qqqqqqq q qqqqqqqqqq q qqqqqqqqqqqqq q qqq q qqqq qq 0 qqqq qq qqq qq q q q q qq qq q 150 250 q q q q q q q q q q q q q q q q q q q q q qq q q q qq q qqq q qq q q q q q q q q q q q qq q qq q q q q qq q q q q q qq q q q q q qq q q qq income q q q q qq qq q qqqqq q q q q q qq qq qq q qq qq q q q q q q q qq qq qq q q qqq qq q q q qqqq qq q q q q qq qq q qq q qq qq q qq q q q q q q q q q qq q qq qq q qqqq qq qq q q qq qq q q q qqqqqqqqqq qq q q q q qqq q qqq q q qq q q q q q q q q q q q qq q qqq q qq q q q qqq q q qq qqqq q q qq q qqqqqqq qq qqqqq q q qqqq q qq qq q qq q q q q q q q qqq q q q qq q qq q qq qq qqq qq qqq qqq q q qqq qqqqqq qqqq q q qqqqq q q qqqqqq q q q qq qqqqqqq q qq q qq qq q q qq q q q q q q q q q q q qq qq qqq q q qq q qqq qqq qq q qqq qqqq qq qqq qq qqq qqqq qq qqqqqqqqqq qq qq q q qqqqqqqqqq q qqqqqqqqqq q qqqqqqq q qqqqq q qq qqq q q qqqq qq q qqqqq q qqq q qq qqq q q qq q qq q q q q q q q qq q qq q qqq qq q qqq q q qqqqqqq qq q q qqqqqqq qqq qq q q qq qq 50 qqqqq qqqqqqqqq q qq q qq q qq qqqq qq q q qqqqq q q q qqq qqqqq qqq qqqq qq qqq qq q qqqqq qqqqqq qqq qqqq qqqqq q qq qq q qqq q q qq q q q q q q q q q q q q q qq q q q qq q q q qq qq q qq q q qqqqqq qq q qq q qqqqqqqqq q q qqqqqq qq qqq q q q q q q qq qq q qq q qq qqq qq qqqqq q qqq q qq q q q q q q q q q q q q q q q q q q q q q q q qq qq qq q qq q qq q qq q q q qqqqqq qq qqq qq q qq q q q qqqqqqqqqqqqq q q qqqqqqqq qq q qqqqqqqqqqqq qqqqqqqq qqqqqqq q qqqqqq qqqq qqq qqq q q qqq qqq qq qqq qqq qqq qq qq qq qqq qq qqqqqq q qqq q q qq q qq qq qq qq qq q qq q qqqqqqqqqq qqqqqqqqqq qqqqqqq q qqqq qqqq qqqqqqq qqq q qqqq qqq qqqq qqq qq qqq qq qqq qq qq qq qq qqq q q q q qq q qqq qqq qq qq q q q q qq q q qq qq q qq qq qq qq qq qq qq qq qqqqqqqqqq qqqqqqqqqqqq q qqqqqqqqqq qq q qq qq qq qqqqqq qq qq qqqq qq q qq qq qq qq qq qq 0.0 0.4 0.8 fte qq qqqq q qqqqqq q q qqqq qq q q q qq qq q q q q q q qqqqq qqqq q qqqq qqq qq q q q qq q qq qq q q qqqqq q q q qq qqqqq qq qqqq q q q qqqqqqqqqq qq q qqqqqqqq q q qqqqqqqqq q qqqqqqqq qqqqqq q qqqq qq qq q qq qq q qqq qqq qq qq qq q qqq q qqqq q qqq qq q qq qq qq q qqq qqqqqqqqq q qqqqqq qq qqq qqq q qqqq qqqq qqq qqqq qqq qq qq qq qq qq qqq qq qq qq qq qq q q q qqq qq qq q q q qq q qq q q qq q qqq qq qq qq qq qq qq qq qq q qqqqqqqqqq qqqqqqqqqq qq qqqqqqq q q qqqqqqq qq qqqq q qq qq qq q qq q qq q 0.0 0.4 0.8 single qqqqqqqqqqqqq q qqqqqqqqqq qqq qqqqq qq qq q qqqq qq qq qq q qq qq qqq q qq qq qq qq q qq qq qq q q qqqqqqqqqq qqqqqqqqq qqqqq qqq qq qqq qqq qqqq qq qq qq q q q q qqq qq q qq q qq qq qq q q q qqq qqqqq qqqq q qqq qqqq qq q qqq qqqq q qqq q q 300 q q q q q q q q q qq qq q q qq q q q q q q q q q q q q q q q q qq q q q q q q 150 qq q q q q q q q time.address q q q q q q q q q qq q qq q q qq q q q qq qq q q q q q q q q q qq q q q q qq q qq qq q q q q qq qq q qqq qq q q qqqqq qq q qq q qq q qq q q qq q q q q q q q q q qq q q qqq qq qq qq qq q q qqqqqqq q q q qq qq qq q qqqqqq q q qq q qq qq q qqqq qq qqqqq qqq qq qqqq q qq qqq q q q q qq qq qqqqqqqqqqq qq qq q q qqqq qq q qqqq q qqq qqqqqqqq q q q qq q q qqqqqqqqqq q qqqq q q qqqqqq qq q qq qqqqqqq qq qqq q qqqqqqqqqq qq qqqqqq q qqqqqqqqq qqqqqq q qqqqqq qq qq qqq qq qqq qq q q qqq q qq q q qq qq qqqqqq q q qq q qq qq qq q qq qqq qq q qq qq q q q q q qq q qqqq qq qqq qqqq qqqqq q q qqqqqqqqqq q qqqqqqqqqq qqqqqq q q qqqqq q q qqqqq q qqqqqqqq qq qqqq qq qqqqqq qq qqq q qq qqqqq qq qq qq qq qq q q q q q q q q q q q q q q qq qq q q qq q qq qqqqqqqqqqq qq q q qqqqq q q qqqqqq q q q qqqq qqqqqqqqqqq q q qqqqqqqqqqqq q q qqq qq qqqqq qq qq qq qq q qq q 0 q q q q qq q q q q q q q q q q qq q q q q qq q q q q qq q q q q q q q qq qq 40 80 q q q q qq q qq q q q q q q q q q qq qq q q q qq q q q q qq qq qqq q q q q q q qq q qq qq q q q qq qqqq qq q q qq q q q qq q qq q qq qq q qq q q q q q q q q qq q qq qq qq q q qqqq q q q q qq q qq qqq q q qq qq qq qqqq q q qqqq qqq qq q q q q q qq q qqq q q qq q time.employed q q q qq q q qq q qq qq q qq q qqq q qqq q q q q q q q q q q qq qqq q q qq q q qqqqqq q q q qq q q q q qqqqqqq q q q q qq qq qq qq q q qqq qq q qqqq q qq qq q q q q q q qq q qqq q qq q qq qq q qqqqqqq q q q q qqqqqq qqq q q qq qqq q q q qq qq qq q qq qq q q q qqqqqq q qqq qq q q qq qqqq qq q qq q q q q q q q q q qq qq qqq qq q qq qq q qq q q q qq q q qq q q qqq q q qq qqq qq q q q qq qq qq qqq q q qq qq qqqq q qq q qq q q qq q q q q q q qq qq q qqqq q qqqqqqqqq q q q qqqqqq q q qq qqq q q qq q qq qq q q qqqqqqq q qqqq q q q qq qq qqq q q qqqq q qq qqqq q qq q q q q q q q qqq q qq qq q q qqq q qqq qqqqqqqqqq q q qqq q qqqqq q qqqq qqqqqqq qq qq qq qq qq qq qq q q qqqqqqq qq qqqq qqqq qqqqq qq q qq q q q q q q q q qqq qq qq q qq q q q qq q qqqqqqqqq q qqq qqqq qqqq q q qqqqqqq qqq qqqq q q q q q qq q q qq qqq q q q qq qqq q qq q qq q qq qqq qqqq qqqqqqq q qq qqq qqqqqqqq qqq qqq q q q q q q q qq qq q qq q qqq q q qqqqq q q qqqqqqqq q q qqqqqqqq qqqq q q qq qq q q q qq q qq qq q q qqqqqq q qq qqqq q qqq qq q qqqqqq q qqq q qq qqq qqq q q q q q q q q q q q qq q qq q qq q qq q q qqq q q q qq qq qq q 0 20 60 100 50 150 250 0.0 0.4 0.8 0 40 80 1. Getting started Introduction to R 28
  • 29. Class package> 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) 1. Getting started Introduction to R 29

×