732G29 Time series analysis Fall semester 2009 7.5 ECTS-credits Course tutor and examiner: Anders Nordgaard Course web: www.ida.liu.se/~732G29 Course literature:

Slides:



Advertisements
Similar presentations
Decomposition Method.
Advertisements

Exercise 7.5 (p. 343) Consider the hotel occupancy data in Table 6.4 of Chapter 6 (p. 297)
Time series. Characteristics Non-independent observations (correlations structure) Systematic variation within a year (seasonal effects) Long-term increasing.
Time Series and Forecasting
Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
Objectives (BPS chapter 24)
1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Simple Linear Regression Estimates for single and mean responses.
CHAPTER 5 TIME SERIES AND THEIR COMPONENTS (Page 165)
1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Summarizing Bivariate Data Introduction to Linear Regression.
Exponential Smoothing Methods
Time Series Analysis Autocorrelation Naive & Simple Averaging
Forecasting Purpose is to forecast, not to explain the historical pattern Models for forecasting may not make sense as a description for ”physical” behaviour.
Moving Averages Ft(1) is average of last m observations
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc. Chap 13-1 Chapter 13 Simple Linear Regression Basic Business Statistics 11 th Edition.
Some more issues of time series analysis Time series regression with modelling of error terms In a time series regression model the error terms are tentatively.
Chapter 5 Time Series Analysis
Data Sources The most sophisticated forecasting model will fail if it is applied to unreliable data Data should be reliable and accurate Data should be.
Note 14 of 5E Statistics with Economics and Business Applications Chapter 12 Multiple Regression Analysis A brief exposition.
732A34 Time series analysis Fall semester ECTS-credits Course tutor and examiner: Anders Nordgaard Course web: Course literature:
Exercise 7.1 a. Find and report the four seasonal factors for quarter 1, 2, 3 and 4 sn1 = 1.191, sn2 = 1.521, sn3 = 0.804, sn4 = b. What is the.
Forecasting Purpose is to forecast, not to explain the historical pattern Models for forecasting may not make sense as a description for ”physical” beaviour.
CHAPTER 4 MOVING AVERAGES AND SMOOTHING METHODS (Page 107)
Modern methods The classical approach: MethodProsCons Time series regression Easy to implement Fairly easy to interpret Covariates may be added (normalization)
Part II – TIME SERIES ANALYSIS C2 Simple Time Series Methods & Moving Averages © Angel A. Juan & Carles Serrat - UPC 2007/2008.
Correlation and Regression Analysis
Time Series and Forecasting
© 2003 Prentice-Hall, Inc.Chap 12-1 Business Statistics: A First Course (3 rd Edition) Chapter 12 Time-Series Forecasting.
© 2002 Prentice-Hall, Inc.Chap 13-1 Statistics for Managers using Microsoft Excel 3 rd Edition Chapter 13 Time Series Analysis.
Time-Series Analysis and Forecasting – Part V To read at home.
TIME SERIES by H.V.S. DE SILVA DEPARTMENT OF MATHEMATICS
M23- Residuals & Minitab 1  Department of ISM, University of Alabama, ResidualsResiduals A continuation of regression analysis.
CHAPTER 14 MULTIPLE REGRESSION
Name: Angelica F. White WEMBA10. Teach students how to make sound decisions and recommendations that are based on reliable quantitative information During.
Introduction to Linear Regression
1 © 2008 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 5 Summarizing Bivariate Data.
Copyright © 2015 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Tutorial for solution of Assignment week 39 “A. Time series without seasonal variation Use the data in the file 'dollar.txt'. “
Copyright © 2011 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin Time Series Forecasting Chapter 16.
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Time Series Forecasting Chapter 13.
Chap 14-1 Statistics for Business and Economics, 6e © 2007 Pearson Education, Inc. Chapter 14 Additional Topics in Regression Analysis Statistics for Business.
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 27 Time Series.
MBA.782.ForecastingCAJ Demand Management Qualitative Methods of Forecasting Quantitative Methods of Forecasting Causal Relationship Forecasting Focus.
Chapter 11 Linear Regression Straight Lines, Least-Squares and More Chapter 11A Can you pick out the straight lines and find the least-square?
Introduction to Probability and Statistics Thirteenth Edition Chapter 12 Linear Regression and Correlation.
© 2000 Prentice-Hall, Inc. Chap The Least Squares Linear Trend Model Year Coded X Sales
Lecture 8 Simple Linear Regression (cont.). Section Objectives: Statistical model for linear regression Data for simple linear regression Estimation.
1 Lecture 4 Main Tasks Today 1. Review of Lecture 3 2. Accuracy of the LS estimators 3. Significance Tests of the Parameters 4. Confidence Interval 5.
Part 2: Model and Inference 2-1/49 Regression Models Professor William Greene Stern School of Business IOMS Department Department of Economics.
Time series Decomposition Farideh Dehkordi-Vakil.
Lack of Fit (LOF) Test A formal F test for checking whether a specific type of regression function adequately fits the data.
© 1999 Prentice-Hall, Inc. Chap Chapter Topics Component Factors of the Time-Series Model Smoothing of Data Series  Moving Averages  Exponential.
Copyright © 2011 Pearson Education, Inc. Time Series Chapter 27.
732A34 Time series analysis Fall semester ECTS-credits Course tutor and examiner: Anders Nordgaard Course web: Course literature:
Multiple Regression I 1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 4 Multiple Regression Analysis (Part 1) Terry Dielman.
Multiple Regression II 1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 4 Multiple Regression Analysis (Part 2) Terry Dielman.
Time Series and Forecasting
Time Series and Forecasting Chapter 16 McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Times Series Forecasting and Index Numbers Chapter 16 Copyright © 2014 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Regression Analysis Presentation 13. Regression In Chapter 15, we looked at associations between two categorical variables. We will now focus on relationships.
Analysis of financial data Anders Lundquist Spring 2010.
Forecasting. Model with indicator variables The choice of a forecasting technique depends on the components identified in the time series. The techniques.
Chapter 11 – With Woodruff Modications Demand Management and Forecasting Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved.McGraw-Hill/Irwin.
Lecture 9 Forecasting. Introduction to Forecasting * * * * * * * * o o o o o o o o Model 1Model 2 Which model performs better? There are many forecasting.
Forecasting Purpose is to forecast, not to explain the historical pattern Models for forecasting may not make sense as a description for ”physical” behaviour.
Statistics for Managers using Microsoft Excel 3rd Edition
Chapter 4: Seasonal Series: Forecasting and Decomposition
Chapter 13 Simple Linear Regression
...Relax... 9/21/2018 ST3131, Lecture 3 ST5213 Semester II, 2000/2001
Essentials of Statistics for Business and Economics (8e)
Presentation transcript:

732G29 Time series analysis Fall semester ECTS-credits Course tutor and examiner: Anders Nordgaard Course web: Course literature: Bowerman, O’Connell, Koehler: Forecasting, Time Series and Regression. 4th ed. Thomson, Brooks/Cole ISBN

Organization of this course: (Almost) weekly “meetings”: Mixture between lectures and tutorials A great portion of self-studying Weekly assignments Individual project at the end of the course Individual oral exam Access to a computer is necessary. Computer rooms PC1-PC5 in Building E, ground floor can be used when they are not booked for another course For those of you that have your own PC, software Minitab can be borrowed for installation.

Examination The course is examined by 1.Homework exercises (assignments) and project work 2.Oral exam Homework exercises and project work will be marked Passed or Failed. If Failed, corrections must be done for the mark Pass. Oral exam marks are given according to ECTS grades. To pass the oral exam, all homework exercises and the project work must have been marked Pass. The final grade will be the same grade as for the oral exam.

Communication Contact with course tutor is best through Office in Building B, Entrance 27, 2nd floor, corridor E (the small one close to Building E), room 3E:485. Telephone: Working hours: Odd-numbered weeks: Wed-Fri Even-numbered weeks: Thu-Fri response all weekdays All necessary information will be communicated through the course web. Always use the English version. The first page contains the most recent information (messages) Assignments will successively be put on the course web as well as information about the project. Solutions to assignments can be ed or posted outside office door.

Time series

Characteristics Non-independent observations (correlations structure) Systematic variation within a year (seasonal effects) Long-term increasing or decreasing level (trend) Irregular variation of small magnitude (noise)

Where can time series be found? Economic indicators: Sales figures, employment statistics, stock market indices, … Meteorological data: precipitation, temperature,… Environmental monitoring: concentrations of nutrients and pollutants in air masses, rivers, marine basins,…

Time series analysis Purpose: Estimate different parts of a time series in order to –understand the historical pattern –judge upon the current status –make forecasts of the future development

Methodologies: MethodThis course? Time series regressionYes Classical decompositionYes Exponential smoothingYes ARIMA modelling (Box-Jenkins)Yes Non-parametric and semi-parametric analysisNo Transfer function and intervention modelsNo State space modellingNo Modern econometric methods: ARCH, GARCH, Cointegration No Spectral domain analysisNo

Time series regression? Let y t =(Observed) value of times series at time point t and assume a year is divided into L seasons Regession model (with linear trend): y t =  0 +  1 t+  j  sj x j,t +  t where x j,t =1 if y t belongs to season j and 0 otherwise, j=1,…,L-1 and {  t } are assumed to have zero mean and constant variance (  2 )

The parameters  0,  1,  s1,…,  s,L-1 are estimated by the Ordinary Least Squares method: (b 0, b 1, b s1, …,b s,L-1 )=argmin {  (y t – (  0 +  1 t+  j  sj x j,t ) 2 } Advantages: Simple and robust method Easily interpreted components Normal inference (conf..intervals, hypothesis testing) directly applicable Forecasting with prediction limits directly applicable Drawbacks: Fixed components in model (mathematical trend function and constant seasonal components) No consideration to correlation between observations

Example: Sales figures jan jan jan jan feb feb feb feb mar mar mar mar apr apr apr apr maj maj maj maj jun jun jun jun jul jul jul jul aug aug aug aug sep sep sep sep okt okt okt okt nov nov nov nov dec dec dec dec

Construct seasonal indicators: x 1, x 2, …, x 12 January ( ): x 1 = 1, x 2 = 0, x 3 = 0, …, x 12 = 0 February ( ):x 1 = 0, x 2 = 1, x 3 = 0, …, x 12 = 0 etc. December ( ):x 1 = 0, x 2 = 0, x 3 = 0, …, x 12 = 1 Use 11 indicators, e.g. x 1 - x 11 in the regression model sales time x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 x IIIIIIIIIIIIII

Analysis with software Minitab ®

Regression Analysis: sales versus time, x1,... The regression equation is sales = time x x x x x x x x x x x11 Predictor Coef SE Coef T P Constant time x x x x x x x x x x x S = R-Sq = 96.6% R-Sq(adj) = 95.5%

Analysis of Variance Source DF SS MS F P Regression Residual Error Total Source DF Seq SS time x x x x x x x x x x x

Unusual Observations Obs time sales Fit SE Fit Residual St Resid R R R denotes an observation with a large standardized residual Predicted Values for New Observations New Obs Fit SE Fit 95.0% CI 95.0% PI ( , ) ( , ) Values of Predictors for New Observations New Obs time x1 x2 x3 x4 x5 x New Obs x7 x8 x9 x10 x

What about serial correlation in data?

Positive serial correlation: Values follow a smooth pattern Negative serial correlation: Values show a “thorny” pattern How to obtain it? Use the residuals.

Residual plot from the regression analysis: Smooth or thorny?

Durbin Watson test on residuals: Thumb rule: If d 3, the conclusion is that residuals (and original data) are correlated. Use shape of figure (smooth or thorny) to decide if positive or negative) (More thorough rules for comparisons and decisions about positive or negative correlations exist.)

Durbin-Watson statistic = 2.05 (Comes in the output ) Value > 1 and < 3  No significant serial correlation in residuals!

What happens when the serial correlation is substantial? Estimated parameters in a regression model get their special properties regarding variance due to the fundamental conditions for the error terms {  t }: Mean value zero Constant variance Uncorrelated (Normal distribution) If any of the first three conditions is violated  Estimated variances of estimated parameters are not correct  Significance tests for parameters are not reliable Prediction limits cannot be trusted

How should the problem be handled? Besides DW-test, carefully perform graphical residual analysis If the serial correlation is modest (DW-test non-significant, and graphs OK) it is usually OK to proceed Otherwise, amendments to the model is need, in particular by modelling the serial correlation (will appear later in this course)

Decompose – Analyse the observed time series in its different components: –Trend part(TR) –Seasonal part(SN) –Cyclical part(CL) –Irregular part(IR) Cyclical part: State-of-market in economic time series In environmental series, usually together with TR Classical decomposition

Multiplicative model: y t =TR t ·SN t ·CL t ·IR t Suitable for economic indicators Level is present in TR t or in TC t =(TR∙CL) t SN t, IR t (and CL t ) works as indices  Seasonal variation increases with level of y t

Additive model: y t =TR t +SN t +CL t +IR t More suitable for environmental data Requires constant seasonal variation SN t, IR t (and CL t ) vary around 0

Example 1: Sales data

Example 2:

Estimation of components, working scheme 1.Seasonally adjustment/Deseasonalisation: SN t usually has the largest amount of variation among the components. The time series is deseasonalised by calculating centred and weighted Moving Averages: where L=Number of seasons within a year (L=2 for ½-year data, 4 for quaerterly data och 12 för monthly data)

– M t becomes a rough estimate of (TR∙CL) t. –Rough seasonal components are obtained by y t /M t in a multiplicative model y t – M t in an additive model –Mean values of the rough seasonal components are calculated for eacj season separetly.  L means. –The L means are adjusted to have an exact average of 1 (i.e. their sum equals L ) in a multiplicative model. Have an exact average of 0 (i.e. their sum equals zero) in an additive model. –  Final estimates of the seasonal components are set to these adjusted means and are denoted:

–The time series is now deaseasonalised by in a multiplicative model in an additive model where is one of depending on which of the seasons t represents.

2. Seasonally adjusted values are used to estimate the trend component and occasionally the cyclical component. If no cyclical component is present: Apply simple linear regression on the seasonally adjusted values  Estimates tr t of linear or quadratic trend component. The residuals from the regression fit constitutes estimates, ir t of the irregular component If cyclical component is present: Estimate trend and cyclical component as a whole (do not split them) by i.e. A non-weighted centred Moving Average with length 2m+1 caclulated over the seasonally adjusted values

–Common values for 2m+1: 3, 5, 7, 9, 11, 13 –Choice of m is based on properties of the final estimate of IR t which is calculated as in a multiplicative model in an additive model –m is chosen so to minimise the serial correlation and the variance of ir t. –2m+1 is called (number of) points of the Moving Average.

Example, cont: Home sales data Minitab can be used for decomposition by Stat  Time series  Decomposition Choice of model Option to choose between two models

Time Series Decomposition Data Sold Length 47,0000 NMissing 0 Trend Line Equation Yt = 5, ,30E-02*t Seasonal Indices Period Index 1 -4, , , , , , , , , , , ,17361 Accuracy of Model MAPE: 16,4122 MAD: 0,9025 MSD: 1,6902

Deseasonalised data have been stored in a column with head DESE1. Moving Averages on these column can be calculated by Stat  Time series  Moving average Choice of 2m+1

MSD should be kept as small as possible TC component with 2m +1 = 3 (blue)

By saving residuals from the moving averages we can calculate MSD and serial correlations for each choice of 2m+1. 2m+1MSDCorr(e t,e t-1 ) A 7-points or 9-points moving average seems most reasonable.

Serial correlations are simply calculated by Stat  Time series  Lag and further Stat  Basic statistics  Correlation Or manually in Session window: MTB > lag ’RESI4’ c50 MTB > corr ’RESI4’ c50

Analysis with multiplicative model:

Time Series Decomposition Data Sold Length 47,0000 NMissing 0 Trend Line Equation Yt = 5, ,30E-02*t Seasonal Indices Period Index 1 0, , , , , , , , , , , , Accuracy of Model MAPE: 16,8643 MAD: 0,9057 MSD: 1,6388

additive

Classical decomposition, summary Multiplicative model: Additive model:

Deseasonalisation Estimate trend+cyclical component by a centred moving average: where L is the number of seasons (e.g. 12, 4, 2)

Filter out seasonal and error (irregular) components: –Multiplicative model: -- Additive model:

Calculate monthly averages Multiplicative model: for seasons m=1,…,L Additive model:

Normalise the monhtly means Multiplicative model: Additive model:

Deseasonalise Multiplicative model: Additive model: where sn t = sn m for current month m

Fit trend function, detrend (deaseasonalised) data Multiplicative model: Additive model:

Estimate cyclical component and separate from error component Multiplicative model: Additive model: