1 / 43

732A34 Time series analysis Fall semester 2009

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

carlburns
Download Presentation

732A34 Time series analysis Fall semester 2009

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 732A34 Time series analysis Fall semester 2009 • 6 ECTS-credits • Course tutor and examiner: Anders Nordgaard • Course web: www.ida.liu.se/~732A34 • Course literature: • Bowerman, O’Connell, Koehler: Forecasting, Time Series and Regression. 4th ed. Thomson, Brooks/Cole 2005. ISBN 0-534-40977-6. • Complementary handouts

  2. Organization of this course: • Weekly “meetings”: Mixture between lectures, computer exercises and seminars • A great portion of self-studying • Weekly assignments from computer exercises • Individual written exam • Access to a computer is necessary. • For those of you that have your own PC, software Minitab can be borrowed for installation.

  3. Examination The course is examined by 1.Assignments 2.Final written exam Assignments will be marked Passed or Failed. If Failed, corrections must be done for the mark Pass. Written exam marks are given according to ECTS grades. The final grade will be the same grade as for the written exam.

  4. Communication Contact with course tutor is best through e-mail: Anders.Nordgaard@liu.se. Office in Building B, Entrance 27, 2nd floor, corridor E (the small one close to Building E), room 3E:485. Telephone: 013-281974 Normal working hours: Odd-numbered weeks: Wed-Fri 8.00-16.30 Even-numbered weeks: Thu-Fri 8.00-16.30 E-mail 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) Instructions for the computer exercises and their embedded assignments will successively be put on the course webt. Solutions to assignments can be e-mailed or posted outside office door.

  5. Time series • What kind of patterns can visually be detected? • Is the development stable or non-stable?

  6. What kind of patterns can visually be detected? • Is the development stable or non-stable?

  7. 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)

  8. 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,… Sports statistics? Electromagnetic och thermal fields Where can time series be found? Time series analysis • Estimate/Investigate different parts of a time series in order to • understand the historical pattern • judge upon the current status • make forecasts of the future development • judge upon the quality of data

  9. Methodologies

  10. Models for Time Series Regression • The ordinary linear regression model: • With time series data (y ), observation number is (most often) equivalent to time point of observing  • What kind of variables x1, … , xk could we think of? • Other time series? • Specific (compulsory) variables

  11. The “principle” of regression modelling: Thus all explanatory variables are treated as deterministic. Alternatively, the statistical properties of yt are conditional on the values of x1,t , … , xk,t in the available data set. How does this limit our selection of explanatory variables?

  12. BPI highly correlated with year. Could year be an explanatory variable? Possible models: linear trend quadratic trend

  13. Linear trend (?) Periodic pattern in data (seasonal effect?) Possible model: where seasonal indicators (dummies)

  14. Is the fitted model satisfactory? How could we resolve the seemingly non-random deviations from the fitted curve?

  15. Model:

  16. Without CPI With CPI No improvement!

  17. Some critical points with Times Series Regression models: • The mean of yt is modelled, usually by some mathematical function • Least-squares estimation of parameters is valid if the error terms {t } • have zero mean and constant variance • are uncorrelated • Statistical inference (confidence and prediction intervals, tests of hypotheses) from standard software output is valid ifthe error terms {t } • are normally distributed

  18. yt Decomposition yt A time series can be thought of as built-up by a number of components

  19. What kind of components can we think of? Long-term? Short-term? Deterministic? Purely random?

  20. Decomposition – 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 • Multiplicative model: • yt=TRt·SNt ·CLt ·IRt • Suitable for economic indicators • Level is present in TRtor in TCt=(TR∙CL)t • SNt , IRt(and CLt) works as indices •  Seasonal variation increases with level of yt

  21. Additive model: • yt=TRt+SNt+CLt +IRt • More suitable for environmental data • Requires constant seasonal variation • SNt , IRt(and CLt) vary around 0 Additive or multiplicative model?

  22. sales figures jan-98-dec-01 observed (blue), deseasonalised (magenta) 50 50 40 40 30 30 20 20 10 10 0 0 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 observed (blue), estimated trend (green) observed TR SN fitted IR 50 50 40 40 30 30 20 20 10 10 0 0 -10 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 Example 1: Sales figures, additive decomposition

  23. Example 2:

  24. Estimation of components, working scheme • Seasonally adjustment/Deseasonalisation: • SNt 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)

  25. CMAtbecomes a rough estimate of (TR∙CL)t . • Rough seasonal components are obtained by • yt/CMAt in a multiplicative model • yt – CMAtin an additive model • Mean values of the rough seasonal components are calculated for each season separately.  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:

  26. 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.

  27. 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 Estimatestrt of linear or quadratic trend component. • The residuals from the regression fit constitutes estimates, irt of the irregular component If cyclical component is present: • Alternative 1: • 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

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

  29. Alternative 2: • Apply simple linear regression on the seasonally adjusted values Estimatestrt of linear or quadratic trend component. • Detrend deasonalised data • in a multiplicative model • in an additive model • Estimate the cyclical component my moving averages: • Estimate the irregular components as • in a multiplicative model • in an additive model

  30. Example, cont: Homes sales data Minitab can be used for decomposition by StatTime seriesDecomposition Choice of model Option to choose between two sets of components

  31. Time Series Decomposition Data Sold Length 47,0000 NMissing 0 Trend Line Equation Yt = 5,77613 + 4,30E-02*t Seasonal Indices Period Index 1 -4,09028 2 -4,13194 3 0,909722 4 -1,09028 5 3,70139 6 0,618056 7 4,70139 8 4,70139 9 -1,96528 10 0,118056 11 -1,29861 12 -2,17361 Accuracy of Model MAPE: 16,4122 MAD: 0,9025 MSD: 1,6902

  32. 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

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

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

  35. 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

  36. Analysis with multiplicative model:

  37. Time Series Decomposition Data Sold Length 47,0000 NMissing 0 Trend Line Equation Yt = 5,77613 + 4,30E-02*t Seasonal Indices Period Index 1 0,425997 2 0,425278 3 1,14238 4 0,856404 5 1,52471 6 1,10138 7 1,65646 8 1,65053 9 0,670985 10 1,02048 11 0,825072 12 0,700325 Accuracy of Model MAPE: 16,8643 MAD: 0,9057 MSD: 1,6388

  38. additive

  39. additive additive

More Related