Presentation is loading. Please wait.

Presentation is loading. Please wait.

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:

Similar presentations


Presentation on theme: "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:"— 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 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) Characteristics:

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

10 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 x 1, …, x k could we think of? Other time series? Specific (compulsory) variables Models for Time Series Regression

11 The “principle” of regression modelling: Thus all explanatory variables are treated as deterministic. Alternatively, the statistical properties of y t are conditional on the values of x 1,t, …, x k,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 y t 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 if the error terms {  t } – are normally distributed

18 Decomposition ytyt ytyt 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=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

21 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 Additive or multiplicative model?

22 Example 1: Sales figures, additive decomposition sales figures jan-98-dec-01 0 10 20 30 40 50 14710131619222528313437404346 observed (blue), deseasonalised (magenta) 0 10 20 30 40 50 14710131619222528313437404346 observed (blue), estimated trend (green) 0 10 20 30 40 50 14710131619222528313437404346 -10 0 10 20 30 40 50 14710131619222528313437404346 observedTRSNfittedIR

23 Example 2:

24 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) Estimation of components, working scheme

25 – CMA t becomes a rough estimate of (TR∙CL) t. –Rough seasonal components are obtained by y t /CMA t in a multiplicative model y t – CMA t in 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  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: Alternative 1: oEstimate 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 oCommon values for 2m+1: 3, 5, 7, 9, 11, 13 oChoice 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 om is chosen so to minimise the serial correlation and the variance of ir t. o2m+1 is called (number of) points of the Moving Average.

29 Alternative 2: o Apply simple linear regression on the seasonally adjusted values  Estimates tr t of linear or quadratic trend component. o Detrend deasonalised data - in a multiplicative model - in an additive model o Estimate the cyclical component my moving averages: o 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

32 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

33

34

35

36 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

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

38 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 ) 31.817-0.444 51.577-0.473 71.564-0.424 91.602-0.396 111.542-0.431 131.612-0.405 A 7-points or 9-points moving average seems most reasonable.

39 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

40 Analysis with multiplicative model:

41 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

42 additive

43


Download ppt "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:"

Similar presentations


Ads by Google