STAT 436 / Lecture 16: Key

Similar documents
Transformations for variance stabilization

477/577 In-class Exercise 5 : Fitting Wine Sales

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

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

INTRODUCTION TO TIME SERIES ANALYSIS. The Simple Moving Average Model

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

AR(p) + I(d) + MA(q) = ARIMA(p, d, q)

Lecture 5: Estimation of time series

Modeling and forecasting global mean temperature time series

The log transformation produces a time series whose variance can be treated as constant over time.

TIME SERIES ANALYSIS AND FORECASTING USING THE STATISTICAL MODEL ARIMA

FE570 Financial Markets and Trading. Stevens Institute of Technology

Univariate ARIMA Models

Forecasting using R. Rob J Hyndman. 2.5 Seasonal ARIMA models. Forecasting using R 1

Ch 6. Model Specification. Time Series Analysis

Minitab Project Report - Assignment 6

Stat 565. (S)Arima & Forecasting. Charlotte Wickham. stat565.cwick.co.nz. Feb

STA 6857 ARIMA and SARIMA Models ( 3.8 and 3.9)

Suan Sunandha Rajabhat University

Ch 5. Models for Nonstationary Time Series. Time Series Analysis

Homework 4. 1 Data analysis problems

Stat 153 Time Series. Problem Set 4

STA 6857 ARIMA and SARIMA Models ( 3.8 and 3.9) Outline. Return Rate. US Gross National Product

Classic Time Series Analysis

Chapter 5: Models for Nonstationary Time Series

6 Stationary Models. 6.1 Purpose. 6.2 Strictly stationary series

Scenario 5: Internet Usage Solution. θ j

Econometría 2: Análisis de series de Tiempo

Time Series I Time Domain Methods

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

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

Seasonality. Matthieu Stigler January 8, Version 1.1

Problems from Chapter 3 of Shumway and Stoffer s Book

Lesson 13: Box-Jenkins Modeling Strategy for building ARMA models

Empirical Approach to Modelling and Forecasting Inflation in Ghana

Chapter 12: An introduction to Time Series Analysis. Chapter 12: An introduction to Time Series Analysis

Exercises - Time series analysis

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

STAT 520 FORECASTING AND TIME SERIES 2013 FALL Homework 05

Seasonal Autoregressive Integrated Moving Average Model for Precipitation Time Series

CHAPTER 8 FORECASTING PRACTICE I

Lab: Box-Jenkins Methodology - US Wholesale Price Indicator

Analysis. Components of a Time Series

Lecture 19 Box-Jenkins Seasonal Models

Final Examination 7/6/2011

Firstly, the dataset is cleaned and the years and months are separated to provide better distinction (sample below).

Ch 8. MODEL DIAGNOSTICS. Time Series Analysis

Time Series Outlier Detection

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

MCMC analysis of classical time series algorithms.

Homework 5, Problem 1 Andrii Baryshpolets 6 April 2017

Time Series Econometrics 4 Vijayamohanan Pillai N

STAT Financial Time Series

arxiv: v1 [stat.co] 11 Dec 2012

Univariate Time Series Analysis; ARIMA Models

CHAPTER 8 MODEL DIAGNOSTICS. 8.1 Residual Analysis

COMPUTER SESSION 3: ESTIMATION AND FORECASTING.

Forecasting. Simon Shaw 2005/06 Semester II

0.1 ARIMA: ARIMA Models for Time Series Data

FORECASTING SUGARCANE PRODUCTION IN INDIA WITH ARIMA MODEL

Time Series Analysis -- An Introduction -- AMS 586

2. An Introduction to Moving Average Models and ARMA Models

Advanced Econometrics

Empirical Market Microstructure Analysis (EMMA)

A SEASONAL TIME SERIES MODEL FOR NIGERIAN MONTHLY AIR TRAFFIC DATA

Estimation and application of best ARIMA model for forecasting the uranium price.

SOME BASICS OF TIME-SERIES ANALYSIS

Chapter 8: Model Diagnostics

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

FORECASTING USING R. Dynamic regression. Rob Hyndman Author, forecast

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

EXAMINATIONS OF THE ROYAL STATISTICAL SOCIETY

Analysis of Violent Crime in Los Angeles County

The ARIMA Procedure: The ARIMA Procedure

Modelling Monthly Rainfall Data of Port Harcourt, Nigeria by Seasonal Box-Jenkins Methods

Stat 565. Spurious Regression. Charlotte Wickham. stat565.cwick.co.nz. Feb

We will only present the general ideas on how to obtain. follow closely the AR(1) and AR(2) cases presented before.

Ch 9. FORECASTING. Time Series Analysis

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

Some Time-Series Models

Decision 411: Class 9. HW#3 issues

Report for Fitting a Time Series Model

Lecture Notes of Bus (Spring 2017) Analysis of Financial Time Series Ruey S. Tsay

03 Time series with trend and seasonality components. Andrius Buteikis,

University of Oxford. Statistical Methods Autocorrelation. Identification and Estimation

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

Chapter 6: Model Specification for Time Series

Marcel Dettling. Applied Time Series Analysis SS 2013 Week 05. ETH Zürich, March 18, Institute for Data Analysis and Process Design

Introduction to basic time series functions in R

ECONOMETRIA II. CURSO 2009/2010 LAB # 3

Case Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016

A Comparison of the Forecast Performance of. Double Seasonal ARIMA and Double Seasonal. ARFIMA Models of Electricity Load Demand

Using Analysis of Time Series to Forecast numbers of The Patients with Malignant Tumors in Anbar Provinc

FORECASTING THE INVENTORY LEVEL OF MAGNETIC CARDS IN TOLLING SYSTEM

Gaussian Copula Regression Application

Week 9: An Introduction to Time Series

Lecture 6a: Unit Root and ARIMA Models

Lecture 16: ARIMA / GARCH Models Steven Skiena. skiena

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

A Data-Driven Model for Software Reliability Prediction

Transcription:

STAT 436 / 536 - Lecture 16: Key Modeling Non-Stationary Time Series Many time series models are non-stationary. Recall a time series is stationary if the mean and variance are constant in time and the autocorrelation only depends on the lag between two time points. One of our current strategies for non-stationary time series models is to include a regression component for trends or seasonal cycles. When using a regression model, the interest shifts to the residuals. In particular, the residuals should satisfy stationarity. We also have seen that differencing a random walk results in a stationary series. A random walk can be written as x t = x t 1 + w t and then the differenced series x t = x t x t 1 = w t just results in white noice, and hence, is stationary. So why is stationarity important? - Stationarity is a particular kind of dependence structure, one that enables easier modeling of the sequence of random variables. Given a stationary sequence, the ARMA suite of tools can be used to model and explain the dependence structure. - When stationarity is not present, differencing (as in the random walk), is used to try to obtain a resulting series that is stationary. 1

Diagnosing a non-stationary series Sometimes a non-stationary series can be diagnosed visually: Monthly Airline Passenger Count Number of Passengers(thousands) 600 400 200 0 Jan1949 Jan1950 Jan1951 Jan1952 Jan1953 Jan1954 Jan1955 date Jan1956 Jan1957 Jan1958 Jan1959 Jan1960 In fact, this is often what we use for residual diagnostics. The characteristic equation can be used to determine if a series is stationary, assuming the parameter values are known. polyroot(c(1, -1,.25)) [1] 2+0i 2-0i stationary x t = x t 1 1 4 x t 2 + w t ( ) 1 4 B2 B + 1 x t = w t x t = x t 1 + w t (B 1) x t = w t polyroot(c(-1, 1)) [1] 1+0i non-stationary 2

x t = 1 2 x t 1 + 1 2 x t 2 + w t ( 12 B2 12 B + 1 ) x t = w t polyroot(c(1, -.5, -.5)) [1] 1-0i -2+0i non-stationary One last way to diagnose stationarity is to use a unit root test. This is closely related to the idea of a random walk as a unit root corresponds to the solution of the polynomial equation of an AR 1 model. - The arima.sim() function will return an error if you try to simulate a non-stationary model. arima.sim(n = 100, list(ar = c(1))) Error in arima.sim(n = 100, list(ar = c(1))): 'ar' part of model is not stationary The Arima and auto.arima can be used to assess for stationary with the a fitted model; however, there are restrictions in the model that generally result in non-stationary models being fitted (with the integrated piece). library(forecast) #autoplot(wwwusage) plot(auto.arima(wwwusage, stationary = T)) Inverse AR roots Inverse MA roots Imaginary i 0 i Imaginary i 0 i 1 0 1 Real 1 0 1 Real 3

- Furthermore, the auto.arima package will also select models that integrate the data to create a differenced series that will be stationary. auto.arima(wwwusage) Series: WWWusage ARIMA(1,1,1) Coefficients: ar1 ma1 0.6504 0.5256 s.e. 0.0842 0.0896 sigma^2 estimated as 9.995: log likelihood=-254.15 AIC=514.3 AICc=514.55 BIC=522.08 Integrated Model A model is integrated with order d, denoted I(d), if the d th difference of {x t } is white noise. d x t = w t (1 B) d x t = w t When d = 1 this is a random walk. rw <- arima.sim(n=500, list( order = c(0,1,0))) autoplot(rw) 10 0 rw 10 0 100 200 300 400 500 Time 4

auto.arima(rw) Series: rw ARIMA(0,1,0) sigma^2 estimated as 1.018: log likelihood=-714.03 AIC=1430.06 AICc=1430.07 BIC=1434.27 The integrated component can also be combined with ARMA models to form an ARIMA. is an ARIMA(p, d, q) model. θ p (B)(1 B) d x t = φ q (B)w t For instance, x t = αx t 1 + x t 1 αx t 2 + w t + βw t 1 x t αx t 1 x t 1 + αx t 2 = w t + βw t 1 (1 αb)(1 B) d x t = (1 + βb)w t is an ARIMA model of order (1,1,1) with an AR parameter of α and an MA parameter of β. Recall the taxi data set. Run the code below and discuss the results. taxi.rides <- read_csv('http://math.montana.edu/ahoegh/teaching/timeseries/data/taxi.csv') taxirides.diff <- taxi.rides %>% arrange(year, month, day) %>% slice(-c(1:4)) %>% mutate(week.numb = rep(1:234, each = 7)) %>% group_by(week.numb) %>% summarize(total.rides = sum(n)) %>% select(total.rides) %>% pull() %>% diff() auto.arima(taxirides.diff) Series: taxirides.diff ARIMA(3,0,1) with zero mean Coefficients: ar1 ar2 ar3 ma1-0.1069-0.3432-0.2949-0.2583 s.e. 0.1406 0.0650 0.0812 0.1419 sigma^2 estimated as 2.644e+10: log likelihood=-3124.72 AIC=6259.45 AICc=6259.71 BIC=6276.7 5

taxirides.summary <- taxi.rides %>% arrange(year, month, day) %>% slice(-c(1:4)) %>% mutate(week.numb = rep(1:234, each = 7)) %>% group_by(week.numb) %>% summarize(total.rides = sum(n)) %>% select(total.rides) %>% pull() auto.arima(taxirides.summary) Series: taxirides.summary ARIMA(3,1,1) Coefficients: ar1 ar2 ar3 ma1-0.1069-0.3432-0.2949-0.2583 s.e. 0.1406 0.0650 0.0812 0.1419 sigma^2 estimated as 2.644e+10: log likelihood=-3124.72 AIC=6259.45 AICc=6259.71 BIC=6276.7 - The arima function can also be used to fit a specific order of an ARIMA model. - As we saw before with ARMA models, AR, ARI, IMA, and ARMA models are all special cases of the ARIMA framework. Seasonal Arima ARIMA models can also have a seasonal component, where the lag corresponds to the seasonal frequency. For example, consider the following model for a time series with weekly seasonal frequency: x t = αx t 7 + w t then this model is a seasonal ARIMA(0, 0, 0)(1, 0, 0) 7. library(forecast) bakery.sales <- read_csv('http://math.montana.edu/ahoegh/teaching/timeseries/data/breadbasket.csv') pastry.count <- bakery.sales %>% filter(item %in% c('pastry','scandinavian','medialuna','muffin','scone' ggtsdisplay(pastry.count) 6

pastry.count 40 30 20 10 0 0 5 10 15 20 0.6 0.6 0.4 0.4 ACF 0.2 PACF 0.2 0.0 0.0 auto.arima(pastry.count) 7 14 21 Lag 7 14 21 Lag Series: pastry.count ARIMA(2,0,2)(1,1,1)[7] with drift Coefficients: ar1 ar2 ma1 ma2 sar1 sma1 drift -0.0402-0.3802 0.3757 0.5374-0.0920-0.4636-0.1164 s.e. 0.2783 0.3361 0.2300 0.3482 0.1744 0.1618 0.0504 sigma^2 estimated as 40.24: log likelihood=-491.05 AIC=998.11 AICc=999.12 BIC=1022.25 7