Applied Time Series Topics

Similar documents
Basics: Definitions and Notation. Stationarity. A More Formal Definition

Time Series Analysis -- An Introduction -- AMS 586

Econometric Forecasting Overview

at least 50 and preferably 100 observations should be available to build a proper model

Forecasting using R. Rob J Hyndman. 2.4 Non-seasonal ARIMA models. Forecasting using R 1

10) Time series econometrics

Circle a single answer for each multiple choice question. Your choice should be made clearly.

MODELING INFLATION RATES IN NIGERIA: BOX-JENKINS APPROACH. I. U. Moffat and A. E. David Department of Mathematics & Statistics, University of Uyo, Uyo

Modelling Wind Farm Data and the Short Term Prediction of Wind Speeds

Empirical Market Microstructure Analysis (EMMA)

The regression model with one fixed regressor cont d

Statistics 910, #5 1. Regression Methods

Chapter 3: Regression Methods for Trends

Econometrics. 9) Heteroscedasticity and autocorrelation

9) Time series econometrics

Econometrics. Week 11. Fall Institute of Economic Studies Faculty of Social Sciences Charles University in Prague

Ch3. TRENDS. Time Series Analysis

1 Introduction to Generalized Least Squares

FinQuiz Notes

Forecasting using R. Rob J Hyndman. 2.3 Stationarity and differencing. Forecasting using R 1

Introductory Econometrics

ARIMA Models. Jamie Monogan. January 16, University of Georgia. Jamie Monogan (UGA) ARIMA Models January 16, / 27

Time Series Econometrics For the 21st Century

Forecasting and Estimation

Homework 2. For the homework, be sure to give full explanations where required and to turn in any relevant plots.

Testing for non-stationarity

Analysis. Components of a Time Series

Forecasting: principles and practice 1

Ch 8. MODEL DIAGNOSTICS. Time Series Analysis

Autocorrelation. Think of autocorrelation as signifying a systematic relationship between the residuals measured at different points in time

Econ 300/QAC 201: Quantitative Methods in Economics/Applied Data Analysis. 17th Class 7/1/10

A measurement error model approach to small area estimation

MCMC analysis of classical time series algorithms.

Time series and Forecasting

TIME SERIES ANALYSIS AND FORECASTING USING THE STATISTICAL MODEL ARIMA

Econ 423 Lecture Notes: Additional Topics in Time Series 1

Forecasting Bangladesh's Inflation through Econometric Models

Part 1. Multiple Choice (50 questions, 1 point each) Part 2. Problems/Short Answer (10 questions, 5 points each)

Midterm Suggested Solutions

Iris Wang.

Unemployment Rate Example

Lecture 5: Unit Roots, Cointegration and Error Correction Models The Spurious Regression Problem

3. Linear Regression With a Single Regressor

Problem Set 2 Solution Sketches Time Series Analysis Spring 2010

Suan Sunandha Rajabhat University

Introduction to Regression Analysis. Dr. Devlina Chatterjee 11 th August, 2017

Time Series Modeling. Shouvik Mani April 5, /688: Practical Data Science Carnegie Mellon University

Økonomisk Kandidateksamen 2004 (I) Econometrics 2. Rettevejledning

Are Forecast Updates Progressive?

Forecasting using R. Rob J Hyndman. 3.2 Dynamic regression. Forecasting using R 1

Circle the single best answer for each multiple choice question. Your choice should be made clearly.

Time-Series Analysis. Dr. Seetha Bandara Dept. of Economics MA_ECON

Forecasting. Simon Shaw 2005/06 Semester II

Introduction to Econometrics

Lecture 7: Dynamic panel models 2

Decision 411: Class 7

11.1 Gujarati(2003): Chapter 12

3 Time Series Regression

NANYANG TECHNOLOGICAL UNIVERSITY SEMESTER II EXAMINATION MAS451/MTH451 Time Series Analysis TIME ALLOWED: 2 HOURS

Topic 12 Overview of Estimation

Applied Econometrics (QEM)

Lab: Box-Jenkins Methodology - US Wholesale Price Indicator

Stationarity Revisited, With a Twist. David G. Tucek Value Economics, LLC

Chapter 8: Model Diagnostics

Semi-parametric estimation of non-stationary Pickands functions

Economics 618B: Time Series Analysis Department of Economics State University of New York at Binghamton

8.2 Harmonic Regression and the Periodogram

A nonparametric test for seasonal unit roots

Cointegration, Stationarity and Error Correction Models.

Forecasting U.S.A Imports from China, Singapore, Indonesia, and Thailand.

MA Advanced Econometrics: Spurious Regressions and Cointegration

Vector Auto-Regressive Models

VAR Models and Applications

Lecture 19 Box-Jenkins Seasonal Models

Decision 411: Class 9. HW#3 issues

Time Series and Forecasting

Statistics of stochastic processes

Non-Stationary Time Series and Unit Root Testing

Unit root problem, solution of difference equations Simple deterministic model, question of unit root

Are Forecast Updates Progressive?

Dynamic Regression Models (Lect 15)

Making sense of Econometrics: Basics

Proposed Changes to the PJM Load Forecast Model

Scenario 5: Internet Usage Solution. θ j

A Diagnostic for Seasonality Based Upon Autoregressive Roots

Trend and Variability Analysis and Forecasting of Wind-Speed in Bangladesh

Time Series and Forecasting

Økonomisk Kandidateksamen 2004 (I) Econometrics 2

Time Series Outlier Detection

Chapter 2: Unit Roots

Read Section 1.1, Examples of time series, on pages 1-8. These example introduce the book; you are not tested on them.

Lesson 2: Analysis of time series

Time Series Methods. Sanjaya Desilva

Regression of Time Series

Questions and Answers on Unit Roots, Cointegration, VARs and VECMs

Prof. Dr. Roland Füss Lecture Series in Applied Econometrics Summer Term Introduction to Time Series Analysis

Implementation of ARIMA Model for Ghee Production in Tamilnadu

EC408 Topics in Applied Econometrics. B Fingleton, Dept of Economics, Strathclyde University

ECON/FIN 250: Forecasting in Finance and Economics: Section 8: Forecast Examples: Part 1

Forecasting Major Vegetable Crops Productions in Tunisia

Transcription:

Applied Time Series Topics Ivan Medovikov Brock University April 16, 2013 Ivan Medovikov, Brock University Applied Time Series Topics 1/34

Overview 1. Non-stationary data and consequences 2. Trends and seasonal cycles 3. Time series forecasting Ivan Medovikov, Brock University Applied Time Series Topics 2/34

1. Stationarity and Non-Stationary Series Stationarity A series is stationary if there is no systematic change in mean & variance over time Example: radio static A series is non-stationary if mean & variance change over time Examples: GDP, population, weather, etc. Ivan Medovikov, Brock University Applied Time Series Topics 3/34

1. Stationarity and Non-Stationary Series Stationary vs Non-Stationary Series 3 Stationary Series 2 1 Value 0-1 -2-3 -4 0 20 40 60 80 100 120 140 160 180 200 Time 5 Non-Stationary Series 0-5 Value -10-15 -20 0 20 40 60 80 100 120 140 160 180 200 Time Ivan Medovikov, Brock University Applied Time Series Topics 4/34

1. Stationarity and Non-Stationary Series Estimation Using Stationary Data Usual econometric techniques work (OLS, t-tests) Under usual assumptions, unbiased & efficient estimates Estimation Using Non-Stationary Data Spurious regression results (biased estimates) Exceptionally high R 2 values and t-ratios No economic meaning Ivan Medovikov, Brock University Applied Time Series Topics 5/34

2. Testing for Non-Stationarity Formally Augmented DickeyFuller test Informally Auto-Correlation Function (ACF) Normal Quantile Plot (Q-Q Plot) Ivan Medovikov, Brock University Applied Time Series Topics 6/34

2. Testing for Non-Stationarity Quantile (Q-Q) Plot Generally: non-stationarity often leads to non-normal residuals Key idea: compare distribution of the residuals to normal Q-Q plot: scatter plot of residual quantiles against normal Stationary data: quantiles match normal (45 line) Non-Stationary data: quantiles don t match (points off 45 line) Ivan Medovikov, Brock University Applied Time Series Topics 7/34

2. Testing for Non-Stationarity QQ Plot of Normal Data versus Standard Normal 3 QQ Plot of Chi 2 Data versus Standard Normal 5 2 4 Quantiles of Input Sample 1 0-1 Quantiles of Input Sample 3 2 1 0-2 -1-3 -3-2 -1 0 1 2 3 Standard Normal Quantiles -2-3 -2-1 0 1 2 3 Standard Normal Quantiles Ivan Medovikov, Brock University Applied Time Series Topics 8/34

2. Testing for Non-Stationarity Example: Q-Q Residuals Plot (Non-Stationary Data) Suppose: regress non-stationary series on its lag 14 Simulated Non-Stationary Series 12 10 8 6 4 2 0-2 0 10 20 30 40 50 60 70 80 90 100 Time Period Ivan Medovikov, Brock University Applied Time Series Topics 9/34

2. Testing for Non-Stationarity Example: Q-Q Residuals Plot (Non-Stationary Data) Result: non-normal regression residuals (indicating problems) 3 QQ Plot of Sample Data versus Standard Normal 2 Quantiles of Input Sample 1 0-1 -2-3 -4-3 -2-1 0 1 2 3 Standard Normal Quantiles Ivan Medovikov, Brock University Applied Time Series Topics 10/34

3. Dealing With Non-Stationarity Linear Trends Note that the trend in this example appears linear 14 Simulated Non-Stationary Series 12 10 8 6 4 2 0-2 0 10 20 30 40 50 60 70 80 90 100 Time Period Ivan Medovikov, Brock University Applied Time Series Topics 11/34

3. Dealing With Non-Stationarity Linear Trends Another way of dealing with trend is to difference the series Y t = Y t Y t 1 be the first difference of the series Then, estimate the model using first differences as Y t = β 1 + β 2 Y t 1 + u t If first differences are non-stationary, use second difference 2 Y t = Y t Y t 1 and estimate 2 Y t = β 1 + β 2 2 Y t 1 + u t Ivan Medovikov, Brock University Applied Time Series Topics 12/34

3. Dealing With Non-Stationarity Linear Trends One way to deal with linear trend is to include a trend term Instead of estimating a plain AR(1) model Y t = β 1 + β 2 Y t 1 + u t, Include time t into the regression & estimate Y t = β 1 + β 2 Y t 1 + β 3 t + u t. Ivan Medovikov, Brock University Applied Time Series Topics 13/34

3. Dealing With Non-Stationarity Q-Q Residuals Plot (Stationary Data) Normal residuals once trend is successfully netted 2.5 QQ Plot of Sample Data versus Standard Normal 2 1.5 Quantiles of Input Sample 1 0.5 0-0.5-1 -1.5-2 -2.5-3 -2-1 0 1 2 3 Standard Normal Quantiles Ivan Medovikov, Brock University Applied Time Series Topics 14/34

3. Dealing With Non-Stationarity Non-Linear Trends In some series non-linear trends may be present For example, population, output, may grow exponentially 1400 Non-Stationary Series With Non-Linear Trend 1200 1000 800 600 400 200 0-200 0 10 20 30 40 50 60 70 80 90 100 Time Period Ivan Medovikov, Brock University Applied Time Series Topics 15/34

3. Dealing With Non-Stationarity Non-Linear Trends Non-linear trends can be dealt with by differencing Alternatively, include an exponential time term Y t = β 1 + β 2 Y t 1 + β 3 t β 4 + u t Residual Q-Q plot can be used to check model fit Ivan Medovikov, Brock University Applied Time Series Topics 16/34

3. Dealing With Non-Stationarity Seasonal Trends Some series may exhibit seasonal trends For example, weather patterns, employment, inflation, etc. 6 Non-Stationary Data With Seasonal Trend 4 2 0-2 -4-6 0 10 20 30 40 50 60 70 80 90 100 Time Period Ivan Medovikov, Brock University Applied Time Series Topics 17/34

3. Dealing With Non-Stationarity Seasonal Trends Inclusion of linear or quadratic trend may be insufficient Several approaches to accounting for seasonal trends Differencing Modelling cyclical trends Ivan Medovikov, Brock University Applied Time Series Topics 18/34

3. Dealing With Non-Stationarity Seasonal Differences Suppose trend cycle is repeated with frequency s periods For example, for monthly data Annual cycles s = 12 Quarterly cycles s = 3 Solution: work with seasonal differences s ty t s ty t = Y t Y t s Examine the residual Q-Q plot to check model fit Choice of s may be challenging (experimentation) Ivan Medovikov, Brock University Applied Time Series Topics 19/34

3. Dealing With Non-Stationarity Seasonal Trend Models As with linear or exponential trends, can explicitly include seasonal trend term into the model A common approach is to include cyclical trend term based on sine wave β sin ω(t + θ), where t - time β - cycle amplitude ω - cycle length θ - phase angle (starting phase) Ivan Medovikov, Brock University Applied Time Series Topics 20/34

3. Dealing With Non-Stationarity Seasonal Trend Models Include cyclical trend term into the model by estimating Y t = β 1 + β 2 Y t 1 + (β 3 sin 2πs t + β 4 cos 2πs ) t + u t, where β 3, β 4 - additional model coefficients s - cycle frequency (in periods of time) as before Ivan Medovikov, Brock University Applied Time Series Topics 21/34

3. Dealing With Non-Stationarity Quarterly Trend Example Suppose that we have monthly data and wish to include quarterly trend term Corresponding frequency is s = 3, and we estimate Y t = β 1 + β 2 Y t 1 + (β 3 sin 2π3 t + β 4 cos 2π3 ) t + u t Ivan Medovikov, Brock University Applied Time Series Topics 22/34

3. Dealing With Non-Stationarity Annual Trend Example Suppose that we have monthly data and wish to include annual trend term Corresponding frequency is s = 12, and we estimate ( Y t = β 1 + β 2 Y t 1 + β 3 sin 2π 12 t + β 4 cos 2π ) 12 t + u t Ivan Medovikov, Brock University Applied Time Series Topics 23/34

3. Dealing With Non-Stationarity Monthly Trend Example Suppose that we have daily data and wish to include monthly trend term Corresponding frequency is s = 30, and we estimate ( Y t = β 1 + β 2 Y t 1 + β 3 sin 2π 30 t + β 4 cos 2π ) 30 t + u t Ivan Medovikov, Brock University Applied Time Series Topics 24/34

3. Dealing With Non-Stationarity Combining Linear, Quadratic and Seasonal Trends Some data may have a combination of trends 250 Non-Stationary Data With Linear And Seasonal Trends 200 150 100 50 0-50 0 20 40 60 80 100 Time Period Ivan Medovikov, Brock University Applied Time Series Topics 25/34

3. Dealing With Non-Stationarity Combined Trends Through Differencing One solution is to apply repeated differencing to the series For example, first remove seasonal trend with seasonal differences s Y t Then, remove linear trend by taking first or second difference 1,s Y t = s Y t s Y t 1 Inspect model fit by examining residuals Q-Q plot Ivan Medovikov, Brock University Applied Time Series Topics 26/34

3. Dealing With Non-Stationarity Combined Trends Through Trend Modelling Alternatively, include both linear and cyclical trend terms into the model Y t = β 1 + β 2 Y t 1 ( ) (1) + β 3 t + β 4 t β 5 (2) + (β 6 sin 2πs t + β 7 cos 2πs ) t (3) + u t, (4) where (1) is the AR(1) part, (2) is the linear and quadratic trend terms, (3) is cyclical trend term and (4) is model error Ivan Medovikov, Brock University Applied Time Series Topics 27/34

4. Time-Series Forecasting Forecasting Trends Suppose ˆβ 1, ˆβ 2,..., ˆβ 7 are estimates from an AR(1) model with linear, exponential and cyclical trends Then at some time T we can predict Linear Trend as ˆL T = ˆβ 3 T Exponential Trend as Ê T = ˆβ 4 T ˆβ 5 Cyclical Trend as ĈT = ˆβ 6 sin 2π s T + ˆβ 7 cos 2π s T Ivan Medovikov, Brock University Applied Time Series Topics 28/34

4. Time-Series Forecasting Seasonal Adjustments and De-Trending Data are often available in seasonally adjusted and/or de-trended form Objective is to remove all trends Approach is to estimate a model with trend components only Ivan Medovikov, Brock University Applied Time Series Topics 29/34

4. Time-Series Forecasting Seasonal Adjustments and De-Trending For example, suppose data have exponential and cyclical trend components Estimate the trend-only model Y t = α 1 t α 2 + (α 3 sin 2πs t + α 4 cos 2πs ) t + u t Calculate the trend estimates Exponential trend component Ê t = ˆα 1 t ˆα2 Cyclical trend component Ĉt = ˆα 3 sin 2π s t + ˆα 4 cos 2π s t Ivan Medovikov, Brock University Applied Time Series Topics 30/34

4. Time-Series Forecasting Seasonal Adjustments and De-Trending De-trended data: Ȳ t = Y t Ê t Seasonally-adjusted data: Ỹ t = Y t Ĉ t Ivan Medovikov, Brock University Applied Time Series Topics 31/34

4. Time-Series Forecasting Forecasting Series Given series value at time t, predict future value as Ŷ t+1 = ˆβ 1 + ˆβ 2 Y t + ˆL t+1 + Êt+1 + Ĉt+1 Question: How to evaluate forecast accuracy? Ivan Medovikov, Brock University Applied Time Series Topics 32/34

4. Time-Series Forecasting Forecast Evaluation: RMSE Consider forecast error ê t = Y t Ŷ t Fine root mean squared error as RMSE = Model with lowest RMSE may be preferred T t=1 ê2 t T Ivan Medovikov, Brock University Applied Time Series Topics 33/34

4. Time-Series Forecasting Forecast Evaluation: LINEX An alternative to RMSE is LINEX loss function L t (ê t ) = exp( aê t ) + aê t 1 L t (ê t ) is penalty for forecast error ê t Key feature: positive and negative errors penalized differently Greater penalty for positive errors when a > 0 Greater penalty for negative errors when a < 0 Choose a based on the problem and select model with lowest Lt (ê t ) Ivan Medovikov, Brock University Applied Time Series Topics 34/34

5. Summary Topics in Applied Time Series 1. Non-stationary data may lead to biased estimates 2. Residual plots (Q-Q plot) may help detect non-stationarity 3. Several ways to account for non-stationarity Differencing Explicit trend modelling 4. RMSE, LINEX loss commonly used to gauge performance Ivan Medovikov, Brock University Applied Time Series Topics 35/34