SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
ETC2450

Applied forecasting for
business and economics




1. Getting started
OTexts.com/fpp/1/
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   A brief history of forecasting   2
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 or
hallucinogens?
  1. Getting started   A brief history of forecasting   3
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
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
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   Types of data   6
Types of data
Most 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 production
Forecasting is estimating how the sequence
of observations will continue into the future.
      1. Getting started   Types of data         7
Australian beer production
             500
megaliters

             450
             400




                                    1995    2000           2005       2010

                                                   Year

                   1. Getting started      Types of data          8
Types of data

Cross-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
Vehicle carbon footprints
Model                     Cyl.      Litres     City   Highway     Carbon
                                               MPG      MPG      footprint
Chevrolet Aveo             4          1.6      25.0      34         6.6
Chrysler PT Cruiser        4          2.4      19.0      24         8.7
Dodge Avenger              4          2.4      21.0      30         7.7
Ford Escape FWD            4          2.5      20.0      28         8.0
Ford Ranger Pickup 2WD     4          2.3      19.0      24         8.7
GMC Canyon 2WD             4          2.9      18.0      24         9.2
Honda Accord               4          2.4      21.0      30         7.7
Honda 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
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   Forecasting models   11
Time series models

Time series models use only information on the
variable 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
Cross-sectional models
Cross-sectional models assume that variable to
be forecast is affected by one or more other
predictor variables.
    ED = f (current temperature, GDP,
                    population, time of day, day of week,
                    error).

e.g., regression models.




   1. Getting started         Forecasting models    13
Mixed models
Mixed model
         EDt+1 = f (EDt , current temperature,
                        time of day, day of week, error).

e.g., dynamic regression models, panel data
models, longitudinal models, transfer function
models




   1. Getting started          Forecasting models     14
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   Some case studies   15
CASE STUDY 1: Paperware company
Client: large company manufacturing disposable tableware.
Problem: They 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
     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
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.
  1. Getting started        Some case studies         17
CASE STUDY 2: PBS

Client: Federal government
Problem: Develop methodology to forecast annual
budget 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
CASE STUDY 3: Car fleet company

Client: One of Australia’s largest car fleet
companies
Problem: 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
CASE STUDY 4: Airline

Client: Ansett.
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.
  1. Getting started   Some case studies     20
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   The statistical forecasting perspective   21
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
Outline

1   A brief history of forecasting

2   Types of data

3   Forecasting models

4   Some case studies

5   The statistical forecasting perspective

6   Introduction to R


    1. Getting started   Introduction to R   23
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
1977 5130 5101 5072 5069
1978 5100 5166 5244 5312 R
   1. Getting started    Introduction to          24
Australian GDP
         7500


                  > plot(ausgdp)
         7000
         6500
ausgdp

         6000
         5500
         5000
         4500




                              1975   1980             1985      1990   1995

                                                     Time

                1. Getting started          Introduction to R          25
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




   1. Getting started   Introduction to R   26
Credit scores

credit <- 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.employed
3282 39.39981    0.012 111.168 TRUE FALSE          27             8
5018 51.79090    0.654 56.400 TRUE FALSE           29            33
8317 32.81704    0.748 36.744 TRUE   TRUE           2            16
13766 57.30881   0.616 55.992 TRUE   TRUE          14             7
2325 37.17328    4.132 62.040 TRUE   TRUE           2            14
13573 33.68829   0.000 43.752 TRUE   TRUE           7             7




    1. Getting started          Introduction to R              27
FPP 1. Getting started
FPP 1. Getting started

Contenu connexe

En vedette

Coherent mortality forecasting using functional time series models
Coherent mortality forecasting using functional time series modelsCoherent mortality forecasting using functional time series models
Coherent mortality forecasting using functional time series models
Rob Hyndman
 
Answerkeyoe Exer1
Answerkeyoe  Exer1Answerkeyoe  Exer1
Answerkeyoe Exer1
hdsierra
 
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
aniruudha banhatti
 
Math22 Lecture1
Math22 Lecture1Math22 Lecture1
Math22 Lecture1
hdsierra
 

En vedette (20)

Automatic time series forecasting
Automatic time series forecastingAutomatic time series forecasting
Automatic time series forecasting
 
Forecasting without forecasters
Forecasting without forecastersForecasting without forecasters
Forecasting without forecasters
 
Advances in automatic time series forecasting
Advances in automatic time series forecastingAdvances in automatic time series forecasting
Advances in automatic time series forecasting
 
Visualization of big time series data
Visualization of big time series dataVisualization of big time series data
Visualization of big time series data
 
Automatic algorithms for time series forecasting
Automatic algorithms for time series forecastingAutomatic algorithms for time series forecasting
Automatic algorithms for time series forecasting
 
Automatic time series forecasting
Automatic time series forecastingAutomatic time series forecasting
Automatic time series forecasting
 
Coherent mortality forecasting using functional time series models
Coherent mortality forecasting using functional time series modelsCoherent mortality forecasting using functional time series models
Coherent mortality forecasting using functional time series models
 
Demographic forecasting
Demographic forecastingDemographic forecasting
Demographic forecasting
 
MEFM: An R package for long-term probabilistic forecasting of electricity demand
MEFM: An R package for long-term probabilistic forecasting of electricity demandMEFM: An R package for long-term probabilistic forecasting of electricity demand
MEFM: An R package for long-term probabilistic forecasting of electricity demand
 
Academia sinica jan-2015
Academia sinica jan-2015Academia sinica jan-2015
Academia sinica jan-2015
 
Visualization and forecasting of big time series data
Visualization and forecasting of big time series dataVisualization and forecasting of big time series data
Visualization and forecasting of big time series data
 
Exploring the boundaries of predictability
Exploring the boundaries of predictabilityExploring the boundaries of predictability
Exploring the boundaries of predictability
 
Answerkeyoe Exer1
Answerkeyoe  Exer1Answerkeyoe  Exer1
Answerkeyoe Exer1
 
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
Time Series Flow Forecasting Using Artificial Neural Networks for Brahmaputra...
 
Numerical Linear Algebra for Data and Link Analysis.
Numerical Linear Algebra for Data and Link Analysis.Numerical Linear Algebra for Data and Link Analysis.
Numerical Linear Algebra for Data and Link Analysis.
 
Chap11 chie square & non parametrics
Chap11 chie square & non parametricsChap11 chie square & non parametrics
Chap11 chie square & non parametrics
 
Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)Time Series Forecasting using Neural Nets (GNNNs)
Time Series Forecasting using Neural Nets (GNNNs)
 
Math22 Lecture1
Math22 Lecture1Math22 Lecture1
Math22 Lecture1
 
Timeseries forecasting
Timeseries forecastingTimeseries forecasting
Timeseries forecasting
 
Stream flow forecasting
Stream flow forecastingStream flow forecasting
Stream flow forecasting
 

Similaire à FPP 1. Getting started

OK - Im glad you sent this in to me and I got to read it.   You h.docx
OK - Im glad you sent this in to me and I got to read it.   You h.docxOK - Im glad you sent this in to me and I got to read it.   You h.docx
OK - Im glad you sent this in to me and I got to read it.   You h.docx
hopeaustin33688
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
carolinef5
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
donaldp2
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
cuddietheresa
 
2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg
kimsach
 

Similaire à FPP 1. Getting started (20)

MSQA Thesis
MSQA ThesisMSQA Thesis
MSQA Thesis
 
OK - Im glad you sent this in to me and I got to read it.   You h.docx
OK - Im glad you sent this in to me and I got to read it.   You h.docxOK - Im glad you sent this in to me and I got to read it.   You h.docx
OK - Im glad you sent this in to me and I got to read it.   You h.docx
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
 
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docxDescriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
Descriptionsordernametypeformatvallabvarlab1location_idint8.0gNum.docx
 
Sequence-to-Sequence Modeling for Time Series
Sequence-to-Sequence Modeling for Time SeriesSequence-to-Sequence Modeling for Time Series
Sequence-to-Sequence Modeling for Time Series
 
Operations Research_18ME735_module 1_LPP.pdf
Operations Research_18ME735_module 1_LPP.pdfOperations Research_18ME735_module 1_LPP.pdf
Operations Research_18ME735_module 1_LPP.pdf
 
A summary of ongoing research in SYRTO project - Petros Dellaportas. July, 2 ...
A summary of ongoing research in SYRTO project - Petros Dellaportas. July, 2 ...A summary of ongoing research in SYRTO project - Petros Dellaportas. July, 2 ...
A summary of ongoing research in SYRTO project - Petros Dellaportas. July, 2 ...
 
Demand time series analysis and forecasting
Demand time series analysis and forecastingDemand time series analysis and forecasting
Demand time series analysis and forecasting
 
Massive Simulations In Spark: Distributed Monte Carlo For Global Health Forec...
Massive Simulations In Spark: Distributed Monte Carlo For Global Health Forec...Massive Simulations In Spark: Distributed Monte Carlo For Global Health Forec...
Massive Simulations In Spark: Distributed Monte Carlo For Global Health Forec...
 
2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg2 session 2a_hp case study_2010_cfvg
2 session 2a_hp case study_2010_cfvg
 
Kenett On Information NYU-Poly 2013
Kenett On Information NYU-Poly 2013Kenett On Information NYU-Poly 2013
Kenett On Information NYU-Poly 2013
 
Panel slides
Panel slidesPanel slides
Panel slides
 
Corporate bankruptcy prediction using Deep learning techniques
Corporate bankruptcy prediction using Deep learning techniquesCorporate bankruptcy prediction using Deep learning techniques
Corporate bankruptcy prediction using Deep learning techniques
 
Training Module
Training ModuleTraining Module
Training Module
 
Exploratory data analysis
Exploratory data analysisExploratory data analysis
Exploratory data analysis
 
HealthOrzo – Your Health Matters
HealthOrzo – Your Health MattersHealthOrzo – Your Health Matters
HealthOrzo – Your Health Matters
 
Advanced Econometrics L7-8.pptx
Advanced Econometrics L7-8.pptxAdvanced Econometrics L7-8.pptx
Advanced Econometrics L7-8.pptx
 
Determinants of bank's interest margin in the aftermath of the crisis: the ef...
Determinants of bank's interest margin in the aftermath of the crisis: the ef...Determinants of bank's interest margin in the aftermath of the crisis: the ef...
Determinants of bank's interest margin in the aftermath of the crisis: the ef...
 
presentationIDC - 14MAY2015
presentationIDC - 14MAY2015presentationIDC - 14MAY2015
presentationIDC - 14MAY2015
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Dernier (20)

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

FPP 1. Getting started

  • 1. ETC2450 Applied forecasting for business and economics 1. Getting started OTexts.com/fpp/1/
  • 2. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 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 or hallucinogens? 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. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 Introduction to R 1. Getting started Types of data 6
  • 7. Types of data Most 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 production Forecasting is estimating how the sequence of observations will continue into the future. 1. Getting started Types of data 7
  • 8. Australian beer production 500 megaliters 450 400 1995 2000 2005 2010 Year 1. Getting started Types of data 8
  • 9. Types of data Cross-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 footprints Model Cyl. Litres City Highway Carbon MPG MPG footprint Chevrolet Aveo 4 1.6 25.0 34 6.6 Chrysler PT Cruiser 4 2.4 19.0 24 8.7 Dodge Avenger 4 2.4 21.0 30 7.7 Ford Escape FWD 4 2.5 20.0 28 8.0 Ford Ranger Pickup 2WD 4 2.3 19.0 24 8.7 GMC Canyon 2WD 4 2.9 18.0 24 9.2 Honda Accord 4 2.4 21.0 30 7.7 Honda 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. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 Introduction to R 1. Getting started Forecasting models 11
  • 12. Time series models Time series models use only information on the variable 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 models Cross-sectional models assume that variable to be forecast is affected by one or more other predictor 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 models Mixed model EDt+1 = f (EDt , current temperature, time of day, day of week, error). e.g., dynamic regression models, panel data models, longitudinal models, transfer function models 1. Getting started Forecasting models 14
  • 15. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 Introduction to R 1. Getting started Some case studies 15
  • 16. CASE STUDY 1: Paperware company Client: large company manufacturing disposable tableware. Problem: They 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 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 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. 1. Getting started Some case studies 17
  • 18. CASE STUDY 2: PBS Client: Federal government Problem: Develop methodology to forecast annual budget 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 company Client: One of Australia’s largest car fleet companies Problem: 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: Airline Client: Ansett. 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. 1. Getting started Some case studies 20
  • 21. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 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. Outline 1 A brief history of forecasting 2 Types of data 3 Forecasting models 4 Some case studies 5 The statistical forecasting perspective 6 Introduction to R 1. Getting started Introduction to R 23
  • 24. 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 1977 5130 5101 5072 5069 1978 5100 5166 5244 5312 R 1. Getting started Introduction to 24
  • 25. Australian GDP 7500 > plot(ausgdp) 7000 6500 ausgdp 6000 5500 5000 4500 1975 1980 1985 1990 1995 Time 1. Getting started Introduction to R 25
  • 26. 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 1. Getting started Introduction to R 26
  • 27. Credit scores credit <- 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.employed 3282 39.39981 0.012 111.168 TRUE FALSE 27 8 5018 51.79090 0.654 56.400 TRUE FALSE 29 33 8317 32.81704 0.748 36.744 TRUE TRUE 2 16 13766 57.30881 0.616 55.992 TRUE TRUE 14 7 2325 37.17328 4.132 62.040 TRUE TRUE 2 14 13573 33.68829 0.000 43.752 TRUE TRUE 7 7 1. Getting started Introduction to R 27