Forecasting JY Le Boudec 1. Contents 1.What is forecasting ? 2.Linear Regression 3.Avoiding Overfitting 4.Differencing 5.ARMA models 6.Sparse ARMA models.

Slides:



Advertisements
Similar presentations
FINANCIAL TIME-SERIES ECONOMETRICS SUN LIJIAN Feb 23,2001.
Advertisements

SMA 6304 / MIT / MIT Manufacturing Systems Lecture 11: Forecasting Lecturer: Prof. Duane S. Boning Copyright 2003 © Duane S. Boning. 1.
Computational Statistics. Basic ideas  Predict values that are hard to measure irl, by using co-variables (other properties from the same measurement.
Objectives 10.1 Simple linear regression
Kriging.
Model Building For ARIMA time series
Part II – TIME SERIES ANALYSIS C5 ARIMA (Box-Jenkins) Models
/k 2DS00 Statistics 1 for Chemical Engineering lecture 4.
Time Series Building 1. Model Identification
Ch11 Curve Fitting Dr. Deshi Ye
How should these data be modelled?. Identification step: Look at the SAC and SPAC Looks like an AR(1)- process. (Spikes are clearly decreasing in SAC.
Regression with ARMA Errors. Example: Seat-belt legislation Story: In February 1983 seat-belt legislation was introduced in UK in the hope of reducing.
BABS 502 Lecture 9 ARIMA Forecasting II March 23, 2009.
Model Fitting Jean-Yves Le Boudec 0. Contents 1 Virus Infection Data We would like to capture the growth of infected hosts (explanatory model) An exponential.
Resampling techniques Why resampling? Jacknife Cross-validation Bootstrap Examples of application of bootstrap.
Chapter 3 Simple Regression. What is in this Chapter? This chapter starts with a linear regression model with one explanatory variable, and states the.
Curve-Fitting Regression
Least Square Regression
Petter Mostad Linear regression Petter Mostad
Parametric Inference.
Machine Learning CUNY Graduate Center Lecture 3: Linear Regression.
BABS 502 Lecture 8 ARIMA Forecasting II March 16 and 21, 2011.
1 Ka-fu Wong University of Hong Kong Pulling Things Together.
Prediction and model selection
ARIMA Forecasting Lecture 7 and 8 - March 14-16, 2011
Financial Econometrics
Chapter 11 Multiple Regression.
Quantitative Business Analysis for Decision Making Simple Linear Regression.
Statistics 350 Lecture 17. Today Last Day: Introduction to Multiple Linear Regression Model Today: More Chapter 6.
BOX JENKINS METHODOLOGY
Box Jenkins or Arima Forecasting. H:\My Documents\classes\eco346\Lectures\chap ter 7\Autoregressive Models.docH:\My Documents\classes\eco346\Lectures\chap.
Binary Variables (1) Coin flipping: heads=1, tails=0 Bernoulli Distribution.
Stats for Engineers Lecture 9. Summary From Last Time Confidence Intervals for the mean t-tables Q Student t-distribution.
R. Kass/W03P416/Lecture 7 1 Lecture 7 Some Advanced Topics using Propagation of Errors and Least Squares Fitting Error on the mean (review from Lecture.
#1 EC 485: Time Series Analysis in a Nut Shell. #2 Data Preparation: 1)Plot data and examine for stationarity 2)Examine ACF for stationarity 3)If not.
MECN 3500 Inter - Bayamon Lecture 9 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
The Examination of Residuals. Examination of Residuals The fitting of models to data is done using an iterative approach. The first step is to fit a simple.
Various topics Petter Mostad Overview Epidemiology Study types / data types Econometrics Time series data More about sampling –Estimation.
Curve-Fitting Regression
Maximum Likelihood Estimation Methods of Economic Investigation Lecture 17.
ELEC 303 – Random Signals Lecture 18 – Classical Statistical Inference, Dr. Farinaz Koushanfar ECE Dept., Rice University Nov 4, 2010.
FORECASTING. Minimum Mean Square Error Forecasting.
Lecture 4: Statistics Review II Date: 9/5/02  Hypothesis tests: power  Estimation: likelihood, moment estimation, least square  Statistical properties.
LINREG linreg(options) depvar start end residuals # list where: depvar The dependent variable. start endThe range to use in the regression. The default.
Ch14: Linear Least Squares 14.1: INTRO: Fitting a pth-order polynomial will require finding (p+1) coefficients from the data. Thus, a straight line (p=1)
Forecasting (prediction) limits Example Linear deterministic trend estimated by least-squares Note! The average of the numbers 1, 2, …, t is.
Over-fitting and Regularization Chapter 4 textbook Lectures 11 and 12 on amlbook.com.
K. Ensor, STAT Spring 2005 Estimation of AR models Assume for now mean is 0. Estimate parameters of the model, including the noise variace. –Least.
Linear Filters. denote a bivariate time series with zero mean. Let.
Machine Learning 5. Parametric Methods.
The Box-Jenkins (ARIMA) Methodology
The Unscented Particle Filter 2000/09/29 이 시은. Introduction Filtering –estimate the states(parameters or hidden variable) as a set of observations becomes.
Stats Term Test 4 Solutions. c) d) An alternative solution is to use the probability mass function and.
Time Series Analysis PART II. Econometric Forecasting Forecasting is an important part of econometric analysis, for some people probably the most important.
Estimation and forecasting for time series models Eric Ward FISH 507 – Applied Time Series Analysis 15 January 2015.
Statistics 350 Lecture 2. Today Last Day: Section Today: Section 1.6 Homework #1: Chapter 1 Problems (page 33-38): 2, 5, 6, 7, 22, 26, 33, 34,
1 Autocorrelation in Time Series data KNN Ch. 12 (pp )
Presentation : “ Maximum Likelihood Estimation” Presented By : Jesu Kiran Spurgen Date :
The simple linear regression model and parameter estimation
Regression Analysis AGEC 784.
Probability Theory and Parameter Estimation I
Lecture 8 ARIMA Forecasting II
Chapter 6: Autoregressive Integrated Moving Average (ARIMA) Models
CHAPTER 16 ECONOMIC FORECASTING Damodar Gujarati
Statistical Methods For Engineers
Regression with ARMA Errors
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
10701 / Machine Learning Today: - Cross validation,
Time Series introduction in R - Iñaki Puigdollers
BOX JENKINS (ARIMA) METHODOLOGY
Presentation transcript:

Forecasting JY Le Boudec 1

Contents 1.What is forecasting ? 2.Linear Regression 3.Avoiding Overfitting 4.Differencing 5.ARMA models 6.Sparse ARMA models 7.Case Studies 2

1. What is forecasting ? Assume you have been able to define the nature of the load It remains to have an idea about its intensity It is impossible to forecast without error The good engineer should Forecast what can be forecast Give uncertainty intervals The rest is outside our control 3

4

2. Linear Regression Simple, for simple cases Based on extrapolating the explanatory variables 5

6

7

8

Estimation and Forecasting In practice we estimate  from y, …, y t When computing the forecast, we pretend  is known, and thus make an estimation error It is hoped that the estimation error is much less than the confidence interval for forecast In the case of linear regression, the theorem gives the global error exactly In general, we won’t have this luxury 9

10

We saw this already A case where estimation error versus prediction uncertainty can be quantified Prediction interval if model is known Prediction interval accounting for estimation (t = 100 observed points) 11

3. The Overfitting Problem The best model is not necessarily the one that fits best 12

Prediction for the better model 13 This is the overfitting problem

How to avoid overfitting Method 1: use of test data Method 2: information criterion 14

15

16

Best Model for Internet Data, polynomial of degree up to 2 17

18 d = 1

Best Model for Internet Data, polynomial of degree up to 10 19

4. Differencing the Data 20

21

22

Point Predictions from Differenced Data 23

Background On Filters (Appendix B) 24 We need to understand how to use discrete filters. Example: write the Matlab command for

25

26 A simple filter Q: compute X back from Y

27

28

29

30 Impulse Response

31

32

33 A filter with stable inverse

How is this prediction done ? This is all very intuitive 34

35

Prediction assuming differenced data is iid 36

Prediction Intervals A prediction without prediction intervals is only a small part of the story The financial crisis might have been avoided if investors had been aware of prediction intervals 37

38

39

Compare the Two 40 Linear Regression with 3 parameters + varianceAssuming differenced data is iid

41

5. Using ARMA Models When the differenced data appears stationary but not iid 42

Test of iid-ness 43

44

ARMA Process 45

46

ARMA Processes are Gaussian (non iid) 47

48

49

ARIMA Process 50

Fitting an ARMA Process Called the Box-Jenkins method Difference the data until stationary Examine ACF to get a feeling of order (p,q) Fit an ARMA model using maximum likelihood 51

Fitting an ARIMA Model Apply Scientific Method 1. make stationary and normal (how ?) 2. bound orders p,q 3. fit an ARMA model to Y t -  i.e. Y t -  » ARMA 4. compute residuals and verify white noise and normal Fitting an ARMA model Pb is : given orders p,q given (x 1, …x n ) (transformed data) compute the parameters of an ARMA (p,q) model that maximizes the likelihood 52 A: the mean , the polynomial coefficients  k and  k, the noise variance  2 Q:What are the parameters ?

This is a non-linear optimization problem Maximizing the likelihood is a non-linear optimization problems Usually solved by iterative, heuristic algorithms, may converge to a local maximum may not converge Some simple, non MLE, heuristics exist for AR or MA models Ex: fit the AR model that has the same theoretical ACF as the sample ACF Common practice is to bootstrap the optimization procedure by starting with a “best guess” AR or MA fit, using heuristic above 53

Fitting ARMA Model is Same as Minimizing One-Step ahead prediction error 54

Best Model Order 55

Check the Residuals 56

Example 57

58

59 Forecasting with ARMA Assume Y t is fitted to an ARMA process The prediction problem is: given Y 1 =y 1,…,Y t =y t find the conditional distribution of Y t+h We know it is normal, with a mean that depends on (y 1,…,y t ) and a variance that depends only on the fitted parameters of the ARMA process There are many ways to compute this; it is readily done by Matlab

60

61

Forecasting Formulae for ARIMA Y = original data X = differenced data, fitted to an ARMA model 1.Obtain point prediction for X using what we just saw 2.Apply Proposition to obtain point prediction for Y 3.Apply formula for prediction interval There are several other methods, but they may have numerical problems. See comments in the lecture notes after prop

63

Improve Confidence Interval If Residuals are not Gaussian (but appear to be iid) Assume residuals are not gaussian but are iid How can we get confidence intervals ? Bootstrap by sampling from residuals 64

65

With bootstrap from residuals With gaussian assumption 66

6. Sparse ARMA Models Problem: avoid many parameters when the degree of the A and C polynomials is high, as in the previous example Based on heuristics Multiplicative ARIMA, constrained ARIMA Holt Winters 67

68

Holt Winters Model 1: EWMA 69

70

EWMA is OK when there is no trend and no periodicity 71

72

73

74

75

76

77

Sparse models give less accurate predictions but have much fewer parameters and are simple to fit. 78 Constrained ARIMA (corrected or not)

79 7. Case Studies

80

81

82

83

84

85

86

87

88 h = 1

89

90 h = 2

91

92 log h = 1 log h = 1

Conclusion Forecasting is useful when savings matter; for example Save money on server space rental Save energy Capturing determinism is perhaps most important and easiest Prediction intervals are useful to avoid gross mistakes Re-scaling the data may help … à vous de jouer. 93

94