Introduction to Time Series Analysis. Lecture 1.



Similar documents
Univariate and Multivariate Methods PEARSON. Addison Wesley

Rob J Hyndman. Forecasting using. 11. Dynamic regression OTexts.com/fpp/9/1/ Forecasting using R 1

TIME SERIES ANALYSIS

TIME SERIES ANALYSIS

Time Series Laboratory

State Space Time Series Analysis

Using JMP Version 4 for Time Series Analysis Bill Gjertsen, SAS, Cary, NC

2.2 Elimination of Trend and Seasonality

Time Series Analysis: Basic Forecasting.

Discrete Time Series Analysis with ARMA Models

Promotional Forecast Demonstration

Analysis of algorithms of time series analysis for forecasting sales

Time Series Analysis of Aviation Data

Sales forecasting # 2

How To Model A Series With Sas

MGT 267 PROJECT. Forecasting the United States Retail Sales of the Pharmacies and Drug Stores. Done by: Shunwei Wang & Mohammad Zainal

COMP6053 lecture: Time series analysis, autocorrelation.

ITSM-R Reference Manual

Time Series Analysis

IBM SPSS Forecasting 22

Time Series - ARIMA Models. Instructor: G. William Schwert

Time Series Analysis

Traffic Safety Facts. Research Note. Time Series Analysis and Forecast of Crash Fatalities during Six Holiday Periods Cejun Liu* and Chou-Lin Chen

Time Series HILARY TERM 2010 PROF. GESINE REINERT

Time Series Analysis in Economics. Klaus Neusser

Software Review: ITSM 2000 Professional Version 6.0.

Introduction to Time Series and Forecasting, Second Edition

Financial TIme Series Analysis: Part II

A course in Time Series Analysis. Suhasini Subba Rao

Threshold Autoregressive Models in Finance: A Comparative Approach

Energy Load Mining Using Univariate Time Series Analysis

IBM SPSS Forecasting 21

Predicting Indian GDP. And its relation with FMCG Sales

Time Series Analysis and Forecasting

PITFALLS IN TIME SERIES ANALYSIS. Cliff Hurvich Stern School, NYU

Trend and Seasonal Components

Probability and Random Variables. Generation of random variables (r.v.)

Graphical Tools for Exploring and Analyzing Data From ARIMA Time Series Models

Lecture 4: Seasonal Time Series, Trend Analysis & Component Model Bus 41910, Time Series Analysis, Mr. R. Tsay

Chapter 4: Vector Autoregressive Models

Time Series Analysis

TIME-SERIES ANALYSIS, MODELLING AND FORECASTING USING SAS SOFTWARE

Time Series Analysis III

Forecasting Methods. What is forecasting? Why is forecasting important? How can we evaluate a future demand? How do we make mistakes?

Luciano Rispoli Department of Economics, Mathematics and Statistics Birkbeck College (University of London)

Studying Achievement

Lecture 2: ARMA(p,q) models (part 3)

Introduction to Time Series Analysis. Lecture 6.

Time Series Analysis

KATE GLEASON COLLEGE OF ENGINEERING. John D. Hromi Center for Quality and Applied Statistics

The SAS Time Series Forecasting System

Recent Developments of Statistical Application in. Finance. Ruey S. Tsay. Graduate School of Business. The University of Chicago

USE OF ARIMA TIME SERIES AND REGRESSORS TO FORECAST THE SALE OF ELECTRICITY

Chapter 10 Introduction to Time Series Analysis

Promotional Analysis and Forecasting for Demand Planning: A Practical Time Series Approach Michael Leonard, SAS Institute Inc.

Time Series in Mathematical Finance

SPSS TRAINING SESSION 3 ADVANCED TOPICS (PASW STATISTICS 17.0) Sun Li Centre for Academic Computing lsun@smu.edu.sg

Forecasting areas and production of rice in India using ARIMA model

Springer Texts in Statistics

BNG 202 Biomechanics Lab. Descriptive statistics and probability distributions I

Time Series Analysis by Higher Order Crossings. Benjamin Kedem Department of Mathematics & ISR University of Maryland College Park, MD

CASH DEMAND FORECASTING FOR ATMS

1 Short Introduction to Time Series

Overview of Monte Carlo Simulation, Probability Review and Introduction to Matlab

OUTLIER ANALYSIS. Data Mining 1

UNDERGRADUATE DEGREE DETAILS : BACHELOR OF SCIENCE WITH

Forecasting in supply chains

Advanced Signal Processing and Digital Noise Reduction

COURSE DESCRIPTOR Signal Processing II Signalbehandling II 7.5 ECTS credit points (7,5 högskolepoäng)

Time Series Analysis 1. Lecture 8: Time Series Analysis. Time Series Analysis MIT 18.S096. Dr. Kempthorne. Fall 2013 MIT 18.S096

Analysis and Computation for Finance Time Series - An Introduction

Time Series and Forecasting

INTRODUCTION TO GEOSTATISTICS And VARIOGRAM ANALYSIS

FORECASTING IN SAP-SCM (SUPPLY CHAIN MANAGEMENT)

Time Series Analysis and Forecasting Methods for Temporal Mining of Interlinked Documents

9th Russian Summer School in Information Retrieval Big Data Analytics with R

Lecture 1: Asset pricing and the equity premium puzzle

11. Time series and dynamic linear models

Estimating and Forecasting Network Traffic Performance based on Statistical Patterns Observed in SNMP data.

Simple Methods and Procedures Used in Forecasting

7 Time series analysis

Autocovariance and Autocorrelation

SLANGTNG - SOFTWARE FOR STOCHASTIC STRUCTURAL ANALYSIS MADE EASY

LAUREA MAGISTRALE - CURRICULUM IN INTERNATIONAL MANAGEMENT, LEGISLATION AND SOCIETY. 1st TERM (14 SEPT - 27 NOV)

**BEGINNING OF EXAMINATION** The annual number of claims for an insured has probability function: , 0 < q < 1.

Lecture 8: Signal Detection and Noise Assumption

Monitoring the SARS Epidemic in China: A Time Series Analysis

96 PROC. OF THE 10th PYTHON IN SCIENCE CONF. (SCIPY 2011) Time Series Analysis in Python with statsmodels

I. Introduction. II. Background. KEY WORDS: Time series forecasting, Structural Models, CPS

ARMA, GARCH and Related Option Pricing Method

(More Practice With Trend Forecasts)

Time Series Analysis

Agenda. Managing Uncertainty in the Supply Chain. The Economic Order Quantity. Classic inventory theory

Transcription:

Introduction to Time Series Analysis. Lecture 1. Peter Bartlett 1. Organizational issues. 2. Objectives of time series analysis. Examples. 3. Overview of the course. 4. Time series models. 5. Time series modelling: Chasing stationarity. 1

Organizational Issues Peter Bartlett. bartlett@stat. Office hours: Tue 11-12, Thu 10-11 (Evans 399). Joe Neeman. jneeman@stat. Office hours: Wed 1:30 2:30, Fri 2-3 (Evans???). http://www.stat.berkeley.edu/ bartlett/courses/153-fall2010/ Check it for announcements, assignments, slides,... Text: Time Series Analysis and its Applications. With R Examples, Shumway and Stoffer. 2nd Edition. 2006. 2

Organizational Issues Classroom and Computer Lab Section: Friday 9 11, in 344 Evans. Starting tomorrow, August 27: Sign up for computer accounts. Introduction to R. Assessment: Lab/Homework Assignments (25%): posted on the website. These involve a mix of pen-and-paper and computer exercises. You may use any programming language you choose (R, Splus, Matlab, python). Midterm Exams (30%): scheduled for October 7 and November 9, at the lecture. Project (10%): Analysis of a data set that you choose. Final Exam (35%): scheduled for Friday, December 17. 3

A Time Series 400 350 300 250 200 150 100 50 0 0 1000 2000 3000 4000 5000 6000 7000 4

A Time Series 400 350 300 250 200 150 100 50 0 1960 1965 1970 1975 1980 1985 1990 year 5

A Time Series 400 350 300 250 $ 200 150 100 50 0 1960 1965 1970 1975 1980 1985 1990 year 6

A Time Series 400 SP500: 1960 1990 350 300 250 $ 200 150 100 50 0 1960 1965 1970 1975 1980 1985 1990 year 7

A Time Series 340 SP500: Jan Jun 1987 320 300 $ 280 260 240 220 1987 1987.05 1987.1 1987.15 1987.2 1987.25 1987.3 1987.35 1987.4 1987.45 1987.5 year 8

A Time Series 30 SP500 Jan Jun 1987. Histogram 25 20 15 10 5 0 240 250 260 270 280 290 300 310 $ 9

A Time Series 340 SP500: Jan Jun 1987. Permuted. 320 300 $ 280 260 240 220 0 20 40 60 80 100 120 10

Objectives of Time Series Analysis 1. Compact description of data. 2. Interpretation. 3. Forecasting. 4. Control. 5. Hypothesis testing. 6. Simulation. 11

Classical decomposition: An example Monthly sales for a souvenir shop at a beach resort town in Queensland. (Makridakis, Wheelwright and Hyndman, 1998) 12 x 104 10 8 6 4 2 0 0 10 20 30 40 50 60 70 80 90 12

Transformed data 12 11.5 11 10.5 10 9.5 9 8.5 8 7.5 7 0 10 20 30 40 50 60 70 80 90 13

Trend 12 11.5 11 10.5 10 9.5 9 8.5 8 7.5 7 0 10 20 30 40 50 60 70 80 90 14

Residuals 1.5 1 0.5 0 0.5 1 0 10 20 30 40 50 60 70 80 90 15

Trend and seasonal variation 12 11.5 11 10.5 10 9.5 9 8.5 8 7.5 7 0 10 20 30 40 50 60 70 80 90 16

Objectives of Time Series Analysis 1. Compact description of data. Example: Classical decomposition: X t = T t + S t + Y t. 2. Interpretation. Example: Seasonal adjustment. 3. Forecasting. Example: Predict sales. 4. Control. 5. Hypothesis testing. 6. Simulation. 17

Unemployment data Monthly number of unemployed people in Australia. (Hipel and McLeod, 1994) 8 x 105 7.5 7 6.5 6 5.5 5 4.5 4 1983 1984 1985 1986 1987 1988 1989 1990 18

Trend 8 x 105 7.5 7 6.5 6 5.5 5 4.5 4 1983 1984 1985 1986 1987 1988 1989 1990 19

Trend plus seasonal variation 8 x 105 7.5 7 6.5 6 5.5 5 4.5 4 1983 1984 1985 1986 1987 1988 1989 1990 20

Residuals 8 x 104 6 4 2 0 2 4 6 1983 1984 1985 1986 1987 1988 1989 1990 21

Predictions based on a (simulated) variable 8 x 105 7.5 7 6.5 6 5.5 5 4.5 4 1983 1984 1985 1986 1987 1988 1989 1990 22

Objectives of Time Series Analysis 1. Compact description of data: X t = T t + S t + f(y t ) + W t. 2. Interpretation. Example: Seasonal adjustment. 3. Forecasting. Example: Predict unemployment. 4. Control. Example: Impact of monetary policy on unemployment. 5. Hypothesis testing. Example: Global warming. 6. Simulation. Example: Estimate probability of catastrophic events. 23

Overview of the Course 1. Time series models 2. Time domain methods 3. Spectral analysis 4. State space models(?) 24

Overview of the Course 1. Time series models (a) Stationarity. (b) Autocorrelation function. (c) Transforming to stationarity. 2. Time domain methods 3. Spectral analysis 4. State space models(?) 25

Overview of the Course 1. Time series models 2. Time domain methods (a) AR/MA/ARMA models. (b) ACF and partial autocorrelation function. (c) Forecasting (d) Parameter estimation (e) ARIMA models/seasonal ARIMA models 3. Spectral analysis 4. State space models(?) 26

Overview of the Course 1. Time series models 2. Time domain methods 3. Spectral analysis (a) Spectral density (b) Periodogram (c) Spectral estimation 4. State space models(?) 27

Overview of the Course 1. Time series models 2. Time domain methods 3. Spectral analysis 4. State space models(?) (a) ARMAX models. (b) Forecasting, Kalman filter. (c) Parameter estimation. 28

Time Series Models A time series model specifies the joint distribution of the sequence {X t } of random variables. For example: P[X 1 x 1,...,X t x t ] for all t and x 1,...,x t. Notation: X 1, X 2,... is a stochastic process. x 1, x 2,... is a single realization. We ll mostly restrict our attention to second-order properties only: EX t, E(X t1, X t2 ). 29

Time Series Models Example: White noise: X t WN(0, σ 2 ). i.e., {X t } uncorrelated, EX t = 0, VarX t = σ 2. Example: i.i.d. noise: {X t } independent and identically distributed. P[X 1 x 1,...,X t x t ] = P[X 1 x 1 ] P[X t x t ]. Not interesting for forecasting: P[X t x t X 1,...,X t 1 ] = P[X t x t ]. 30

Gaussian white noise P[X t x t ] = Φ(x t ) = 1 2π xt e x2 /2 dx. 2.5 2 1.5 1 0.5 0 0.5 1 1.5 2 2.5 0 5 10 15 20 25 30 35 40 45 50 31

Gaussian white noise 2.5 2 1.5 1 0.5 0 0.5 1 1.5 2 2.5 0 5 10 15 20 25 30 35 40 45 50 32

Time Series Models Example: Binary i.i.d. P[X t = 1] = P[X t = 1] = 1/2. 1 0.8 0.6 0.4 0.2 0 0.2 0.4 0.6 0.8 1 0 5 10 15 20 25 30 35 40 45 50 33

Random walk S t = t i=1 X i. Differences: S t = S t S t 1 = X t. 8 6 4 2 0 2 4 0 5 10 15 20 25 30 35 40 45 50 34

Random walk ES t? VarS t? 10 5 0 5 10 15 0 5 10 15 20 25 30 35 40 45 50 35

Random Walk Recall S&P500 data. (Notice that it s smooth) 340 SP500: Jan Jun 1987 320 300 $ 280 260 240 220 1987 1987.05 1987.1 1987.15 1987.2 1987.25 1987.3 1987.35 1987.4 1987.45 1987.5 year 36

Random Walk Differences: S t = S t S t 1 = X t. 10 SP500, Jan Jun 1987. first differences 8 6 4 2 $ 0 2 4 6 8 10 1987 1987.05 1987.1 1987.15 1987.2 1987.25 1987.3 1987.35 1987.4 1987.45 1987.5 year 37

Trend and Seasonal Models X t = T t + S t + E t = β 0 + β 1 t + i (β i cos(λ i t) + γ i sin(λ i t)) + E t 6 5.5 5 4.5 4 3.5 3 2.5 0 50 100 150 200 250 38

Trend and Seasonal Models X t = T t + E t = β 0 + β 1 t + E t 6 5.5 5 4.5 4 3.5 3 2.5 0 50 100 150 200 250 39

Trend and Seasonal Models X t = T t + S t + E t = β 0 + β 1 t + i (β i cos(λ i t) + γ i sin(λ i t)) + E t 6 5.5 5 4.5 4 3.5 3 2.5 0 50 100 150 200 250 40

Trend and Seasonal Models: Residuals 0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5 0 50 100 150 200 250 41

Time Series Modelling 1. Plot the time series. Look for trends, seasonal components, step changes, outliers. 2. Transform data so that residuals are stationary. (a) Estimate and subtract T t, S t. (b) Differencing. (c) Nonlinear transformations (log, ). 3. Fit model to residuals. 42

Nonlinear transformations Recall: Monthly sales. (Makridakis, Wheelwright and Hyndman, 1998) 12 x 104 12 11.5 10 11 10.5 8 10 6 9.5 9 4 8.5 2 8 7.5 0 0 10 20 30 40 50 60 70 80 90 7 0 10 20 30 40 50 60 70 80 90 43

Time Series Modelling 1. Plot the time series. Look for trends, seasonal components, step changes, outliers. 2. Transform data so that residuals are stationary. (a) Estimate and subtract T t, S t. (b) Differencing. (c) Nonlinear transformations (log, ). 3. Fit model to residuals. 44

Differencing Recall: S&P 500 data. 340 SP500: Jan Jun 1987 10 SP500, Jan Jun 1987. first differences 8 320 6 300 4 2 $ 280 $ 0 260 2 4 240 6 8 220 1987 1987.05 1987.1 1987.15 1987.2 1987.25 1987.3 1987.35 1987.4 1987.45 1987.5 year 10 1987 1987.05 1987.1 1987.15 1987.2 1987.25 1987.3 1987.35 1987.4 1987.45 1987.5 year 45

Differencing and Trend Define the lag-1 difference operator, (think first derivative ) X t = X t X t 1 = (1 B)X t, where B is the backshift operator, BX t = X t 1. If X t = β 0 + β 1 t + Y t, then If X t = k i=0 β it i + Y t, then X t = β 1 + Y t. k X t = k!β k + k Y t, where k X t = ( k 1 X t ) and 1 X t = X t. 46

Differencing and Seasonal Variation Define the lag-s difference operator, s X t = X t X t s = (1 B s )X t, where B s is the backshift operator applied s times, B s X t = B(B s 1 X t ) and B 1 X t = BX t. If X t = T t + S t + Y t, and S t has period s (that is, S t = S t s for all t), then s X t = T t T t s + s Y t. 47

Time Series Modelling 1. Plot the time series. Look for trends, seasonal components, step changes, outliers. 2. Transform data so that residuals are stationary. (a) Estimate and subtract T t, S t. (b) Differencing. (c) Nonlinear transformations (log, ). 3. Fit model to residuals. 48

Outline 1. Objectives of time series analysis. Examples. 2. Overview of the course. 3. Time series models. 4. Time series modelling: Chasing stationarity. 49