Presentation is loading. Please wait.

Presentation is loading. Please wait.

Applied Forecasting ST3010 Michaelmas term 2015 Prof. Rozenn Dahyot Room 128 Lloyd Institute School of Computer Science and Statistics Trinity College.

Similar presentations


Presentation on theme: "Applied Forecasting ST3010 Michaelmas term 2015 Prof. Rozenn Dahyot Room 128 Lloyd Institute School of Computer Science and Statistics Trinity College."— Presentation transcript:

1 Applied Forecasting ST3010 Michaelmas term 2015 Prof. Rozenn Dahyot Room 128 Lloyd Institute School of Computer Science and Statistics Trinity College Dublin Rozenn.Dahyot@scss.tcd.ieRozenn.Dahyot@scss.tcd.ie or Rozenn.Dahyot@tcd.ieRozenn.Dahyot@tcd.ie +353 1 896 1760

2 Lecture notes available online @ https://www.scss.tcd.ie/Rozenn.Dahyot/https://www.scss.tcd.ie/Rozenn.Dahyot/ In the ‘teaching’ section. Possibly some materials will be on blackboard

3 Timetable Monday 9am-10am in LB01 4pm-5pm in LB1.07 Friday 10am-11am in Salmon 1 (Hamilton Building)

4 Organization of the course Lectures-tutorials only: No labs but information using R for Forecasting will be provided. Exam 100% No assignments

5 Software R http://www.r-project.org/

6 Content

7 Introduction to forecasting; ARIMA models, GARCH models, Kalman Filters,data transformations, seasonality, exponential smoothing and Holt Winters algorithms, performance measures. Use of transformations and differences.

8 Textbook Forecasting: Methods and Applications by Makridakis, Wheelwright and Hyndman, published by Wiley Many more books in the libraries in Trinity on Forecasting, time series covering the content of this course.

9 Who Forecast?

10 Why Forecast?

11 How to Forecast? In this course we will use maths/stats techniques for forecasting

12 Steps in a Forecasting Procedure? Problem definition Exploratory Analysis Gathering information Selecting and fitting models to make forecast Using and evaluating the forecast

13 Examples https://www.google.ie/trends/ http://static.googleusercontent. com/media/research.google.co m/en//archive/papers/detecting -influenza-epidemics.pdf http://static.googleusercontent. com/media/research.google.co m/en//archive/papers/detecting -influenza-epidemics.pdf

14 Examples…. Warnings Epidemiological modeling of online social network dynamics http://arxiv.org/abs/1401.4208 http://languagelog.ldc.upenn.edu/nll/?p=9977

15 Quantitative Forecasting

16 Quantitative methods

17 Time series models Vs Explanatory models Time series

18 What is the nature of the data to analyse? Examples from fma packages in R airpass beer internet cowtemp Dowjones mink Can you predict how these time series look like ?

19 Visualization tools Numerical values Time plot Season plot

20 Patterns to identify Trends Seasonal Error/noise Visualize and identify patterns: airpass beer internet cowtemp Dowjones mink

21 Time series Definition Sampling rate & Unit of time Preparation of Data before analysis

22 Limitations in this module 1D time series No outliers No missing data

23 Notations Variables Vs numerical values Time series

24

25 Auto-Correlation Function (ACF) Mean value of the time series Autocorrelation at lag k

26 Auto Correlation Function (ACF) Lag k r1r1 r2r2 r3r3 1 2 3

27 > plot(beer-mean(beer),lwd="3") > lines(lag(beer-mean(beer),1),col="red",lwd=3) In red, The lag series beer (lag 1 ). The two time series overlap well.

28 In red, The lag series beer (lag 6 ). The two time series do not overlap well. > plot(beer-mean(beer),lwd="3") > lines(lag(beer-mean(beer),6),col="red",lwd=3)

29 In red, The lag series beer (lag 12 ). The two time series do overlap well. > plot(beer-mean(beer),lwd="3") > lines(lag(beer-mean(beer),12),col="red",lwd=3)

30 For the airpass time series Lag 1 Lag 6 Lag 12

31 Partial AutoCorrelation Function (PACF)

32 Holt-Winters Algorithms Part I

33 Algo I: Simple Exponential Smoothing (SES)

34 What does SES do? What happens when  =1 or  =0 ? SES is an algorithm suitable for a time series with … Algo I: Simple Exponential Smoothing (SES)

35 Algo II: Double Exponential Smoothing (DES)

36 SES(  ) DES(  )

37 SHW + (  )

38 SHW x (  )

39 Linear Regression

40 Useful formulas

41 Auto-Regressive Models – AR(1) Explanatory variable Parameters to estimate

42 Auto-Regressive Models – AR(2) Explanatory variables Parameters to estimate

43 Auto-Regressive Models – AR(p) Parameters to estimate Explanatory variables

44 AR(1): Least Squares estimates of the parameters model Write the least squares solution.

45 AR(1): Least Squares estimates of the parameters model

46 AR(1): Least Squares estimates of the parameters

47 Estimate of  Estimate the standard deviation of the noise

48 Example: dowjones

49 Auto-Regressive Models – AR(p) Parameters to estimate Explanatory variables

50 Moving Average MA(1) Explanatory variable Parameters to estimate Can Least Squares Algorithm be used to estimate the parameters?

51 Moving average MA(q) Parameters to estimate Explanatory variables

52 Exercises

53 Remark

54 Expectation

55

56

57 Summary 17/11/2014 Using ACF and PACF to identify AR(p) and MA(q) Procedure to fit an ARIMA(p,d,q) Definition of BIC/AIC

58 Fitting ARIMA(p,d,q)

59 To avoid overfitting choose p ≤ 3 q ≤ 3 d ≤ 3

60 PACF for AR(1) Maths

61 ACF for MA(1) Maths

62 MA(1) as an AR(∞) For MA(1) the Damped sine wave/exponential decay in the PACF corresponds to these coefficients vanishing towards 0

63 AR(1) as an MA(∞)

64 Criteria to select the best ARIMA model

65 Exercise: Show

66 Hirotugu Aikaike (1927-2009) 1970s: proposed model selection with an information Criterion (AIC)

67 Bayesian information Criterion Thomas Bayes (1701-1761) The BIC was developed by Gideon E. Schwarz, who gave a Bayesian argument for adopting it.Bayesian http://en.wikipedia.org/wiki/Bayesian_information_criterion

68 Seasonal ARIMA(p,d,q)(P,D,Q) s

69 Choose your criterion AIC or BIC (and stick to it). Select the ARIMA model with the lowest AIC or BIC with m=p+q+P+Q

70 ARIMA(0,0,0)(P=1,0,0) s Vs ARIMA(0,0,0)(0,D=1,0) s

71 Summary

72

73 2014 1960s1950s 1970s 1980s1990s SES DES SHW+ SHWx ARIMAAIC BIC Holt Winters

74 Other time series models ARCH (1982): autoregressive conditional heteroskedasticity GARCH (1986): generalized autoregressive conditional heteroskedasticity … More at http://en.wikipedia.org/wiki/Autoregressive_conditional_heteroskedasticity

75 Concluding Remarks time

76 Concluding remarks The Prediction – Update loop Combining experts


Download ppt "Applied Forecasting ST3010 Michaelmas term 2015 Prof. Rozenn Dahyot Room 128 Lloyd Institute School of Computer Science and Statistics Trinity College."

Similar presentations


Ads by Google